[Sumover-dev] [svn commit] r4338 - vic/branches/mpeg4/video

sumover-dev at cs.ucl.ac.uk sumover-dev at cs.ucl.ac.uk
Fri Dec 12 02:05:08 GMT 2008


Author: douglask
Date: Fri Dec 12 02:05:04 2008
New Revision: 4338

Modified:
   vic/branches/mpeg4/video/grabber-v4l2.cpp

Log:
Added some more debug output for problamatic V4L2 capture devices that don't
support CIF  or 320x240 resolutions


Modified: vic/branches/mpeg4/video/grabber-v4l2.cpp
==============================================================================
--- vic/branches/mpeg4/video/grabber-v4l2.cpp	(original)
+++ vic/branches/mpeg4/video/grabber-v4l2.cpp	Fri Dec 12 02:05:04 2008
@@ -361,9 +361,9 @@
         fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
         v4l2_ioctl(fd_, VIDIOC_G_FMT, &fmt);
 
-        unsigned int test_width[] = {CIF_WIDTH, 320};
-        unsigned int test_height[] = {CIF_HEIGHT, 240};
-        for (unsigned int i = 0; i < sizeof(test_width); i++) {
+        unsigned int test_width[] = {CIF_WIDTH, 320, 0};
+        unsigned int test_height[] = {CIF_HEIGHT, 240, 0};
+        for (unsigned int i = 0; test_width[i] != 0; i++) {
                 fmt.fmt.pix.width = test_width[i];
                 fmt.fmt.pix.height = test_height[i];
                 fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUV420;
@@ -381,6 +381,8 @@
                         if (fmt.fmt.pix.height == test_height[i] && fmt.fmt.pix.width == test_width[i]) {
                                 have_YUV422P = 1;
                                 debug_msg("Device supports V4L2_PIX_FMT_YUV422 capture at %dx%d\n",test_width[i],test_height[i]);
+                        } else {
+                                debug_msg("V4L2_PIX_FMT_YUV422 capture at %dx%d not supported, returned %dx%d\n",test_width[i],test_height[i],fmt.fmt.pix.width,fmt.fmt.pix.height);
                         }
                 }
 
@@ -391,6 +393,8 @@
                         if (fmt.fmt.pix.height == test_height[i] && fmt.fmt.pix.width == test_width[i]) {
                                 have_YUV422 = 1;
                                 debug_msg("Device supports V4L2_PIX_FMT_YUYV (YUV 4:2:2) capture at %dx%d\n",test_width[i],test_height[i]);
+                        } else {
+                                debug_msg("V4L2_PIX_FMT_YUYV (YUV 4:2:2) capture at %dx%d not supported, returned %dx%d\n",test_width[i],test_height[i],fmt.fmt.pix.width,fmt.fmt.pix.height);
                         }
                 }
 
@@ -402,6 +406,8 @@
                         if (fmt.fmt.pix.height == test_height[i] && fmt.fmt.pix.width == test_width[i]) {
                                 have_MJPEG = 1;
                                 debug_msg("Device supports V4L2_PIX_FMT_MJPEG capture at %dx%d\n",test_width[i],test_height[i]);
+                        } else {
+                                debug_msg("V4L2_PIX_FMT_MJPEG capture at %dx%d not supported, returned %dx%d\n",test_width[i],test_height[i],fmt.fmt.pix.width,fmt.fmt.pix.height);
                         }
                 }
 
@@ -412,6 +418,8 @@
                         if (fmt.fmt.pix.height == test_height[i] && fmt.fmt.pix.width == test_width[i]) {
                                 have_MJPEG = 1;
                                 debug_msg("Device supports V4L2_PIX_FMT_JPEG capture at %dx%d\n",test_width[i],test_height[i]);
+                        } else {
+                                debug_msg("V4L2_PIX_FMT_JPEG capture at %dx%d not supported, returned %dx%d\n",test_width[i],test_height[i],fmt.fmt.pix.width,fmt.fmt.pix.height);
                         }
                 }
 #endif



More information about the Sumover-dev mailing list