Hello Lukas,

Thank you very much for your patch. I am glad to see that you could find a
way to make it work on your computer.

For info: 
http://dev.openwengo.com/trac/openwengo/trac.cgi/attachment/ticket/1071/Dire
ctXWebcamDriver.patch


2 remarks:

#######################################
1/ on the setCap "sequential" algorithm
#######################################

I agree that this is bad. And it should be changed with a "hint" framework.

Each physical webcam name should give a hint to the library as to which
palette it prefers.

The current algorithm supposes that we will find an optimal sequence of
dependency between all the palettes and that all the webcams in the world
will fit into that algorithm.

Experience has shown that this is a wrong approach and you patch makes it
very clear :

Your gave priority to YUV2 over UYVY and that is very normal if we follow
the results you gave on

http://dev.openwengo.com/trac/openwengo/trac.cgi/wiki/HardwareSupportNg

but I added UYVY for another Vaio computer where YUV2 was giving garbage
results (it also said it supported YUV2 and UYVY)

So I suspect that by giving priority to YUV2 over UYVY it works for your
computer but not for this other one ...

Would you be interested in trying to patch such a "hint" algorithm (a simple
one dedicated for palette support) ? The idea is not original and not just
weird : I saw something like that implemented in Ekiga [1] that has a better
support than we have under linux.

(oh yes, I forget to say that the palette support under linux is yet quite
another story because the webcam drivers do not support all the palettes
supported by the webcams)

This kind of "hinting" algorithm, with a good default setup would lead us to
a better webcam support because we would not break previously supported
webcams when adding a new one.

[1] -
http://cvs.sourceforge.net/viewcvs.py/openh323/pwlib/plugins/vidinput_v4l/vi
dinput_v4l.cxx, cf extract at the end of the email


#######################################
2/ hack around _isOpen
#######################################

I just browsed quicly through your patch. What exactly did make necessary
this toying around with _isOpen ? I didn't figure it out in my browsing.


Jérôme
-----------


EXTRACT FROM openh263.pwlib

////////////////////////////////////////////////////////////////////////////
///
// Linux Video4Linux Driver Hints Tables.
//
// In an ideal API, we wouldn't need these hints on setup.  There are enough
// wrinkles it seems we have to provide a static list of hints for known
// issues.

#define HINT_CSWIN_ZERO_FLAGS               0x0001
#define HINT_CSPICT_ALWAYS_WORKS            0x0002  /// ioctl return value
indicates pict was set ok.
#define HINT_CGPICT_DOESNT_SET_PALETTE      0x0004
#define HINT_HAS_PREF_PALETTE               0x0008  /// use this <b
style="color:black;background-color:#ffff66">palette</b> with this camera.
#define HINT_ALWAYS_WORKS_320_240           0x0010  /// Camera always  opens
OK at this size.
#define HINT_ALWAYS_WORKS_640_480           0x0020  /// Camera always  opens
OK at this size.
#define HINT_ONLY_WORKS_PREF_PALETTE        0x0040  /// Camera always (and
only) opens at pref <b
style="color:black;background-color:#ffff66">palette</b>.
#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_FORCE_DBLBUF                   0x0400  /// Force double
buffering on quickcam express

static struct {
  char     *name_regexp;        // String used to match the driver name
  char     *name;               // String used for ptrace output
  char     *version;             // Apply the <b
style="color:black;background-color:#ff9999">hint</b> if kernel
                                // version < given version,
                                // 0 means always apply
  unsigned hints;               // <b
style="color:black;background-color:#ff9999">Hint</b> flags
  int      pref_palette;        // Preferred <b
style="color:black;background-color:#ffff66">palette</b>.
} driver_hints[] = {

    /**Philips usb web cameras
       Native format is 420(P) so use it.
     */
    
  { "^Philips [0-9]+ webcam$",
    "Philips USB webcam",
    NULL,
    HINT_HAS_PREF_PALETTE,
    VIDEO_PALETTE_YUV420P },
  
  /**Brooktree based capture boards.

     The current bttv driver doesn't fail CSPICT calls with unsupported
     palettes.  It also doesn't return a useful value from CGPICT calls
     to readback the <b
style="color:black;background-color:#ffff66">palette</b>. Not needed anymore
from 2.4.23
   */
    { "^BT8(4|7)(8|9)",
      "Brooktree BT848 and BT878 based capture boards",
      "2.4.23",
      HINT_CSWIN_ZERO_FLAGS |
      HINT_CSPICT_ALWAYS_WORKS |
      HINT_CGPICT_DOESNT_SET_PALETTE |
      HINT_HAS_PREF_PALETTE,
      VIDEO_PALETTE_YUV420P },

  /** Quickcam Express (qc-usb driver) */
  { "<b style="color:black;background-color:#a0ffff">Logitech</b> [USB
Camera|QuickCam USB]",
    "Quickcam Express (qc-usb driver)",
    NULL,
    HINT_FORCE_DBLBUF,
    0},
  
  /** <b style="color:black;background-color:#99ff99">Sony</b> Vaio Motion
Eye camera
      Linux kernel 2.4.7 has meye.c driver module.
   */
  { "meye",
    "<b style="color:black;background-color:#99ff99">Sony</b> Vaio Motion
Eye Camera",
    NULL,
    HINT_CGPICT_DOESNT_SET_PALETTE |
    HINT_CSPICT_ALWAYS_WORKS       |
    HINT_ALWAYS_WORKS_320_240      |
    HINT_ALWAYS_WORKS_640_480      |
    HINT_CGWIN_FAILS               |
    HINT_ONLY_WORKS_PREF_PALETTE   |
    HINT_HAS_PREF_PALETTE,
    VIDEO_PALETTE_YUV422 },

  /** USB camera, which only works in large size.
   */
  { "<b style="color:black;background-color:#a0ffff">Logitech</b> USB
Webcam",
    "<b style="color:black;background-color:#a0ffff">Logitech</b> USB Webcam
which works in large size only",
    NULL,
    HINT_FORCE_LARGE_SIZE,
    VIDEO_PALETTE_YUV420P 
  },

  /** Creative VideoBlaster Webcam II USB
   */
  {"CPiA Camera",
   "CPIA which works with cpia and cpia_usb driver modules",
   NULL,
   HINT_FORCE_DEPTH_16 |
   HINT_ONLY_WORKS_PREF_PALETTE   |
   HINT_HAS_PREF_PALETTE,
   VIDEO_PALETTE_YUV422
  },

 /** Intel PC Pro Camera
 
 */
  { "SPCA50X USB Camera",
    "Intel PC Pro Camera uses the spca50x driver",
    NULL,
    HINT_ONLY_WORKS_PREF_PALETTE        |
    HINT_HAS_PREF_PALETTE,
    VIDEO_PALETTE_RGB24
  },


  /** Default device with no special settings
   */
  { "",
    "V4L Supported Device",
    0,
    0,
    0 }

_______________________________________________
Wengophone-devel mailing list
[email protected]
http://dev.openwengo.com/mailman/listinfo/wengophone-devel

Reply via email to