Hi all,
In the intialisation section of my application, I reset the pan & tilt of a
Logitech QuickCam Sphere (046d:08b5) using ioctl(VIDIOCPWCMPTRESET).
Sometimes during the reset, the webcam stays stuck after panning to one of
its exteme position (the tilt doesnt and comes back to the center). On the
Motion wiki, in the PWC API section (
http://www.lavrsen.dk/twiki/bin/view/PWC/ApplicationProgrammingInterface#VIDIOCPWCMPTSTATUS),
I read that "When setting the angle or doing a reset, you have to poll the
status regularly until the command completes or returns an error.". So I
added a call to ioctl(VIDIOCPWCMPTSTATUS). This is what the section looks
like:

int i=3;
if(ioctl(c->fd, VIDIOCPWCMPTRESET, &i)>=0) {
   while(((ret=ioctl(c->fd,  VIDIOCPWCMPTSTATUS, &s))>=0) && (s.status==0))
{
      fprintf(stderr, "PWC: ret = %d, status=%d\n", ret, s.status);
      usleep(500*1000);
      CLEAR(s);
   }
   fprintf(stderr, "PWC: ret = %d, status=%d\n", ret, s.status);
}

I added the two fprintf statments to see what was happening, and
ioctl(VIDIOCPWCMPTSTATUS) always returns -1. The while loop is never
executed.
Does anyone know why ioctl(VIDIOCPWCMPTSTATUS) fails, and how to prevent a
pan/tilt reset to leave the webcam stuck at one end ?
Thanks
Gilles
_______________________________________________
pwc mailing list
[email protected]
http://lists.saillard.org/mailman/listinfo/pwc

Reply via email to