UVC Problem with Turning ON and OFF camera... RC = 258 error

Mar 22, 2013 at 1:48 AM
Hello all,
If any of you could help me with this I would greatly appreciate it..

I am using the similar driver and code that had been posted by Douglas Boling for the WebCam in Windows CE 6.0 and I am performing the following calls that I have no trouble doing at least once:
  1. Getting Handle to "CAM1:"
  2. Call the driver with IOCTL_CAMERA_DEVICE_STARTVIDEOSTREAM - That turns on the Camera light
  3. Getting first by calling the driver with IOCTL_CAMERA_DEVICE_GETNEXTVIDEOFRAME,
  4. Then continually getting Frames by calling the driver with IOCTL_CAMERA_DEVICE_GETNEXTVIDEOFRAME, where I can see the video....
    In order to Shut Down, I do the following:
  5. Calling the driver with IOCTL_CAMERA_DEVICE_STOPVIDEOSTREAM - that does NOT turn OFF the Camera light
  6. CloseHandle
Now when I try to turn ON and OFF the camera couple of times in the row (following the same steps 1-6), sometimes it works and sometimes it does NOT work... it is very inconstant... But it definitely gets locked up after at least 3 times...

When it doesn't work, it goes into step 3 and when I try to execute the IOCTL_CAMERA_DEVICE_GETNEXTVIDEOFRAME, it returns an rc error 258, and after that I can't get it to work again, with the same issues...

Here are my questions:
a. Did any of you guys experience this issue?
b. Do you think that this could be the problem with how the Driver is called?
c. Do you have any suggestions on where I can look?

Please let me know.

Thank you all in advance,

Green On Windows CE