From c675ddd8301002b0c265dc002169cb47c292b994 Mon Sep 17 00:00:00 2001 From: "will.newton" Date: Thu, 24 Sep 2015 01:11:25 -0700 Subject: [PATCH] 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} --- webrtc/modules/video_capture/linux/device_info_linux.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/webrtc/modules/video_capture/linux/device_info_linux.cc b/webrtc/modules/video_capture/linux/device_info_linux.cc index aac85d1d79..10c0981e34 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 @@ int32_t DeviceInfoLinux::FillCapabilities(int fd) 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 @@ int32_t DeviceInfoLinux::FillCapabilities(int fd) { 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.