Go to file
wu@webrtc.org 221b522118 Return the number of /dev/video* without trying to open it.
Consider the case when there're /dev/video0 and /dev/video1. But for somereason the video0 is not in a correct state and can't be open. As a result, current NumberOfDevices will return 1, which is fine. However, we will then never be able to get the device we really want - /dev/video1. Consider the code below, the GetCaptureDevice will fail because it calls into DeviceInfoLinux::GetDeviceName(0, ...) which will again try to open the /dev/video0. So the root cause is the mismatching of the NumberOfDevices and GetDeviceName.

Since we will open the device in DeviceInfoLinux::GetDeviceName anyway, I think we should return the number of /dev/video* in DeviceInfoLinux::NumberOfDevices without trying to open it. Otherwise the DeviceInfoLinux::NumberOfDevices should return more information like which /dev/video* is valid which is not.

bool found = false;
for (int i = 0; i < vie_capture->NumberOfCaptureDevices(); ++i) {
  if (vie_capture->GetCaptureDevice(i, ...) == 0) {
    found = true;
    break;
  }
}
Review URL: http://webrtc-codereview.appspot.com/148004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@635 4adac7df-926f-26a2-2b94-8c16560cd09d
2011-09-21 16:57:15 +00:00
peerconnection * Update to use libjingle r85. 2011-09-19 21:59:33 +00:00
src Return the number of /dev/video* without trying to open it. 2011-09-21 16:57:15 +00:00
test Add a unit testing framework. 2011-09-14 17:02:44 +00:00
third_party google-gflags is an open source command line parsing library for C++ that is useful for our test programs. 2011-09-09 13:00:24 +00:00
third_party_mods Fix the bad video issue on Window client by increasing the rtp recv buffer size. 2011-09-21 16:53:45 +00:00
tools Matlab scripts useful for parsing the output from DataLog 2011-09-02 13:24:38 +00:00
android-webrtc.mk Some changes made in android makefile 2011-08-15 17:40:56 +00:00
Android.mk Enable protobuf for apm module 2011-08-05 22:20:03 +00:00
AUTHORS git-svn-id: http://webrtc.googlecode.com/svn/trunk@11 4adac7df-926f-26a2-2b94-8c16560cd09d 2011-05-30 11:51:34 +00:00
codereview.settings Modify codereview.settings 2011-09-06 10:12:28 +00:00
DEPS * Update to use libjingle r85. 2011-09-19 21:59:33 +00:00
libvpx.mk Change android makefile to reflect recent file structure change 2011-07-13 17:49:49 +00:00
LICENSE git-svn-id: http://webrtc.googlecode.com/svn/trunk@11 4adac7df-926f-26a2-2b94-8c16560cd09d 2011-05-30 11:51:34 +00:00
license_template.txt git-svn-id: http://webrtc.googlecode.com/svn/trunk@11 4adac7df-926f-26a2-2b94-8c16560cd09d 2011-05-30 11:51:34 +00:00
LICENSE_THIRD_PARTY Integrate the built-in WASAPI AEC DMO to VoE. 2011-09-13 17:17:49 +00:00
OWNERS Review URL: http://webrtc-codereview.appspot.com/137002 2011-08-25 16:52:34 +00:00
PATENTS Modified patent grant 2011-05-31 22:47:37 +00:00
PRESUBMIT.py Adding owners check in presubmit script. 2011-06-09 07:07:24 +00:00
WATCHLISTS Updating WATCHLIST with a video_coding watch and adding myself to it. 2011-09-19 07:50:48 +00:00
webrtc.gyp Add a unit testing framework. 2011-09-14 17:02:44 +00:00