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

Unified Diff: webrtc/modules/video_capture/linux/device_info_linux.cc

Issue 1317613003: video_capture: Better support for UYVY (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Improve UYVY camera support Created 5 years, 3 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: webrtc/modules/video_capture/linux/device_info_linux.cc
diff --git a/webrtc/modules/video_capture/linux/device_info_linux.cc b/webrtc/modules/video_capture/linux/device_info_linux.cc
index aac85d1d794c81a28cc1be2d104051dddefd512e..10c0981e34af99627213a0357d52347a3172a0a3 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.
« 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