[GnomeMeeting-list] My cpia_usb initialization problem



I am running Redhat 7.1, with the kernel updated to
2.4.3-13, using the cpia_usb kernel module that comes
with it from Redhat, with the gnomemeeting-0.11 rpm's
for both sources and binaries, except where re-compiled.

With this change, the initialization on video test may
fail the first time, but it suceeds in subsequent tries.
Before, it would only fail.  The difference is that all
of the setup calls are done regardless of previous
failures, rather than quitting at the first failure.  When
I did this the first time by commenting out individual
terms to see which was giving the failure, it was in
the SetColourFormatConverter call.  There may be
an order dependency there, but I wasn't able to get
it to work by merely moving that call to the end.
There is some driver state being affected, because
once the camera has been initialized properly by
my changed version of gnomemeeting, I can then
exit and run the unchanged version, and it works
fine until I unplug and re-plug in the camera, then I
have to run the changed version to get the setup
right again.

Included below are my changes to the webcam.cpp file,
with the old file first, changed file second:

157,164c157,164
<   if (grabber->Open (opts->video_device, FALSE) &&
<       grabber->SetVideoFormat
<       (opts->video_format ? PVideoDevice::NTSC : PVideoDevice::PAL) &&
<       grabber->SetChannel (opts->video_channel) &&
<       grabber->SetColourFormatConverter ("YUV420P") &&
<       grabber->SetFrameRate (opts->tr_fps)  &&
<       grabber->SetFrameSizeConverter (height, width, FALSE))
<
---
  if (grabber->Open (opts->video_device, FALSE)
      && (grabber->SetChannel (opts->video_channel)
      & grabber->SetVideoFormat
      (opts->video_format ? PVideoDevice::NTSC : PVideoDevice::PAL)
      & grabber->SetColourFormatConverter ("YUV420P")
      & grabber->SetFrameRate (opts->tr_fps)
      & grabber->SetFrameSizeConverter (height, width, FALSE)
      ))
189a190
      // this assumes that delete will close first...

I hope this is helpful in making the code more robust.

Art



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