Re: [GnomeMeeting-list] Firewire Cameras on MacOSX?



On 03/07/2003 at 07:00:53(+0200), Damien Sandras used 1.5K just to say:
> Compiling support for both Firewire devices at the same time can also
> give problems in GnomeMeeting itself, for example here :
> ---
> #ifdef TRY_1394AVC
>     if (video_device == "/dev/raw1394" ||
>        strncmp (video_device, "/dev/video1394", 14) == 0) {
>             grabber = new PVideoInput1394AvcDevice();
>        }
>     else
> #endif
> #ifdef TRY_1394DC
>     if (video_device == "/dev/raw1394" ||
>         strncmp (video_device, "/dev/video1394", 14) == 0)
>            grabber = new PVideoInput1394DcDevice();
>     else
> #endif
>       {
>          grabber = new PVideoInputDevice();
>       }
> ---
> 
> Of course, if somebody promises me to do the required tests, I can
> update the code (after my holidays) and we can try to have both things
> compiled at the same time to see if it works.

I always imagined this part of the code including some fallback, since the
PVideoInput1394{Avc,Dc}Device classes are supposed to return failure if they
cannot find an appropriate device. However, they can check for cameras only on
Open(), because that's when they are given the device name. So something like:

#ifdef TRY_1394AVC
    if (video_device == "/dev/raw1394" ||
        strncmp (video_device, "/dev/video1394", 14) == 0) {
            grabber = new PVideoInput1394AvcDevice();
            if (grabber->Open(video_device, FALSE))
	        grabber->Close();
	    else
	    	grabber = NULL; /* how do we destroy classes? */
        }
#endif
#ifdef TRY_1394DC
    if (grabber == NULL && (video_device == "/dev/raw1394" ||
        strncmp (video_device, "/dev/video1394", 14) == 0))
           grabber = new PVideoInput1394DcDevice();
	   /* do the same as above */
#endif
    if (grabber == NULL)
      {
         grabber = new PVideoInputDevice();
      }

may or may not help (haven't looked at the rest of the gnomemeeting code).  At
least, that's how I imagined things in the beginning.

Maybe a wrapper class around both 1394{avc,dc} would be even easier to
implement. It doesn't sound like a terribly hard think to do but... anyone
willing to code it? :) I don't really have any time lately. This gets a little
pwlib specific though.

-- 
(    Georgi Georgiev   (  LBJ, LBJ, how many JOKES did you tell        (
 )    chutz gg3 net     ) today??!                                      )
(   +81(90)6266-1163   (                                               (



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