[GnomeMeeting-list] [PATCH] Add USE_CURRENT_HARDWARE_SIZE hint



OK, I can take a hint... ;-)

Chris
--- pwlib/src/ptlib/unix/video4linux.cxx.orig	Sun Sep 21 15:54:35 2003
+++ pwlib/src/ptlib/unix/video4linux.cxx	Mon Sep 22 00:08:27 2003
@@ -192,6 +192,7 @@
 #define HINT_CGWIN_FAILS                    0x0080  /// ioctl VIDIOCGWIN always fails.
 #define HINT_FORCE_LARGE_SIZE               0x0100  /// driver does not work in small video size.
 #define HINT_FORCE_DEPTH_16                 0x0200  /// CPiA cameras return a wrong value for the depth, and if you try to use that wrong value, it fails.
+#define HINT_USE_CURRENT_HARDWARE_SIZE      0x0400  // Use defaults instead of claimed limits
 
 static struct {
   char     *name_regexp;        // String used to match the driver name
@@ -245,6 +246,15 @@
     VIDEO_PALETTE_YUV420P 
   },
 
+  /** This should really apply to all Philips-based
+   *  webcams without the decompressor module loaded.
+   */
+  { "^Logitech QuickCam",
+    "Logitech QuickCam, using default settings",
+    HINT_USE_CURRENT_HARDWARE_SIZE,
+    VIDEO_PALETTE_YUV420P 
+  },
+
   /** Creative VideoBlaster Webcam II USB
    */
   {"CPiA Camera",
@@ -355,9 +365,16 @@
   }
 
   // set height and width
-  frameHeight = videoCapability.maxheight;
-  frameWidth  = videoCapability.maxwidth;
-  
+  struct video_window vwin;
+  if ( HINT(HINT_USE_CURRENT_HARDWARE_SIZE) &&
+       (::ioctl(videoFd, VIDIOCGWIN, &vwin) == 0) ) {
+    frameHeight = vwin.height;
+    frameWidth = vwin.width;
+  }
+  else {
+    frameHeight = videoCapability.maxheight;
+    frameWidth  = videoCapability.maxwidth;
+  }
 
   // Init audio
   struct video_audio videoAudio;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]