Commit ce824a56 authored by magjed's avatar magjed Committed by Commit bot

Add support for pixel format UYVY in Linux video capture

BUG=410202
TEST=Use Kinect camera on Linux. Go to page https://src.chromium.org/svn/trunk/src/chrome/test/data/webrtc/manual/peerconnection.html. Press button "Get devices". An entry "Microsoft Kinect Camera" should show up in the "Video source" list. Press button "Request GetUserMedia". You should get a stream with size 640x480 in the preview.

Review URL: https://codereview.chromium.org/539443003

Cr-Commit-Position: refs/heads/master@{#293178}
parent 828da409
...@@ -43,7 +43,8 @@ enum { kTypicalFramerate = 30 }; ...@@ -43,7 +43,8 @@ enum { kTypicalFramerate = 30 };
// V4L2 color formats VideoCaptureDeviceLinux support. // V4L2 color formats VideoCaptureDeviceLinux support.
static const int32 kV4l2RawFmts[] = { static const int32 kV4l2RawFmts[] = {
V4L2_PIX_FMT_YUV420, V4L2_PIX_FMT_YUV420,
V4L2_PIX_FMT_YUYV V4L2_PIX_FMT_YUYV,
V4L2_PIX_FMT_UYVY
}; };
// USB VID and PID are both 4 bytes long. // USB VID and PID are both 4 bytes long.
...@@ -82,6 +83,9 @@ VideoPixelFormat VideoCaptureDeviceLinux::V4l2ColorToVideoCaptureColorFormat( ...@@ -82,6 +83,9 @@ VideoPixelFormat VideoCaptureDeviceLinux::V4l2ColorToVideoCaptureColorFormat(
case V4L2_PIX_FMT_YUYV: case V4L2_PIX_FMT_YUYV:
result = PIXEL_FORMAT_YUY2; result = PIXEL_FORMAT_YUY2;
break; break;
case V4L2_PIX_FMT_UYVY:
result = PIXEL_FORMAT_UYVY;
break;
case V4L2_PIX_FMT_MJPEG: case V4L2_PIX_FMT_MJPEG:
case V4L2_PIX_FMT_JPEG: case V4L2_PIX_FMT_JPEG:
result = PIXEL_FORMAT_MJPEG; result = PIXEL_FORMAT_MJPEG;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment