Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(752)

Unified Diff: media/video/capture/linux/video_capture_device_linux.cc

Issue 10824205: fix detection of video capture device on linux (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/capture/linux/video_capture_device_linux.cc
===================================================================
--- media/video/capture/linux/video_capture_device_linux.cc (revision 150360)
+++ media/video/capture/linux/video_capture_device_linux.cc (working copy)
@@ -85,10 +85,11 @@
// Failed to open this device.
continue;
}
- // Test if this is a V4L2 device.
+ // Test if this is a V4L2 capture device.
v4l2_capability cap;
if ((ioctl(fd, VIDIOC_QUERYCAP, &cap) == 0) &&
- (cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) {
+ (cap.capabilities & V4L2_CAP_VIDEO_CAPTURE) &&
+ !(cap.capabilities & V4L2_CAP_VIDEO_OUTPUT)) {
// This is a V4L2 video capture device
name.device_name = StringPrintf("%s", cap.card);
device_names->push_back(name);
@@ -203,10 +204,11 @@
return;
}
- // Test if this is a V4L2 device.
+ // Test if this is a V4L2 capture device.
v4l2_capability cap;
if (!((ioctl(device_fd_, VIDIOC_QUERYCAP, &cap) == 0) &&
- (cap.capabilities & V4L2_CAP_VIDEO_CAPTURE))) {
+ (cap.capabilities & V4L2_CAP_VIDEO_CAPTURE) &&
+ !(cap.capabilities & V4L2_CAP_VIDEO_OUTPUT))) {
// This is not a V4L2 video capture device.
close(device_fd_);
device_fd_ = -1;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698