Re: [Linux-uvc-devel] [SVN] Added preliminary pan/tilt support for Quickcam Orbit MP
Linux UVC driver and tools
Brought to you by:
pinchartl
|
From: michel X. <mx...@ma...> - 2006-02-07 15:32:33
|
Le Mardi 7 Février 2006 14:45, Laurent Pinchart a écrit :
> > The pantilt reset now work fine , but the pan tilt relative, not really
> > like i need :)
> > as i did not really understand, how the signed value are in the 4 char
> > array, i have try to set up one union like that :
> > union pantilt {
> > struct {
> > short pan;
> > short tilt;
> > } s16;
> > int value;
> > } pantilt;
> > so i expect s16.pan reffer to the signed value of pan and
> > s16.tilt to the tilt value.
> > as a result the sign of relative goes right, tilt and pan is not mixed
> > and i can scan min to max or max to min , but difficukt to stop the scan
> > between :(
>
> I just noticed that there's an endianess problem in the driver. Please try
> the following code.
>
> ---------------------------------------------------------------------------
>-- union pantilt {
> unsigned char bytes[4];
> int value;
> } pantilt;
>
> pantilt.bytes[0] = (pan >> 0) & 0xff;
> pantilt.bytes[1] = (pan >> 8) & 0xff;
> pantilt.bytes[2] = (tilt >> 0) & 0xff;
> pantilt.bytes[3] = (tilt >> 8) & 0xff;
>
> ctrl.value = pantilt.value;
> ---------------------------------------------------------------------------
>--
>
> This will only work on little endian platforms. Please note that the
> interface will probably change as soon as I find time to rework the
> controls handling code.
>
> Laurent Pinchart
> _______________________________________________
> Linux-uvc-devel mailing list
> Lin...@li...
> http://lists.berlios.de/mailman/listinfo/linux-uvc-devel
Feb 7 15:29:51 linux kernel: uvcvideo: Failed to query (135) UVC control 4
(unit 2) : -110.
Feb 7 15:29:51 linux kernel: uvcvideo: Failed to query (130) UVC control 4
(unit 2) : -75.
Feb 7 15:30:06 linux kernel: uvcvideo: Failed to query (1) UVC control 1
(unit 2) : -32.
Feb 7 15:30:06 linux kernel: uvcvideo: Failed to query (1) UVC control 1
(unit 2) : -32.
Feb 7 15:30:40 linux su: (to root) michel on /dev/pts/4
Feb 7 15:30:40 linux su: (to root) michel on /dev/pts/4
--
Michel Xhaard
http://mxhaard.free.fr
|