video_capture: Better support for UYVY
A couple of places were missing handling of UYVY video formats.
BUG=webrtc:4816
Review URL: https://codereview.webrtc.org/1317613003
Cr-Commit-Position: refs/heads/master@{#10044}
diff --git a/webrtc/modules/video_capture/linux/device_info_linux.cc b/webrtc/modules/video_capture/linux/device_info_linux.cc
index aac85d1..10c0981 100644
--- a/webrtc/modules/video_capture/linux/device_info_linux.cc
+++ b/webrtc/modules/video_capture/linux/device_info_linux.cc
@@ -257,11 +257,12 @@
video_fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
video_fmt.fmt.pix.sizeimage = 0;
- int totalFmts = 3;
+ int totalFmts = 4;
unsigned int videoFormats[] = {
V4L2_PIX_FMT_MJPEG,
V4L2_PIX_FMT_YUV420,
- V4L2_PIX_FMT_YUYV };
+ V4L2_PIX_FMT_YUYV,
+ V4L2_PIX_FMT_UYVY };
int sizes = 13;
unsigned int size[][2] = { { 128, 96 }, { 160, 120 }, { 176, 144 },
@@ -300,6 +301,10 @@
{
cap.rawType = kVideoMJPEG;
}
+ else if (videoFormats[fmts] == V4L2_PIX_FMT_UYVY)
+ {
+ cap.rawType = kVideoUYVY;
+ }
// get fps of current camera mode
// V4l2 does not have a stable method of knowing so we just guess.