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}
This commit is contained in:
will.newton 2015-09-24 01:11:25 -07:00 committed by Commit bot
parent 74d85e19ae
commit c675ddd830

View File

@ -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.