[pwc] VIDIOCPWCMPTRESET
Gilles GIGAN
gilles.gigan at gmail.com
Thu Jun 12 08:08:37 CEST 2008
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.saillard.org/pipermail/pwc/attachments/20080612/2d3fa6d5/attachment.htm
More information about the pwc
mailing list