Laurent,
Laurent Pinchart escreveu:
> Hi Paulo,
>
> On Thursday 26 February 2009 21:53:58 Paulo Assis wrote:
>
>> Hi,
>> In order to proper add dynamic controls to the uvc driver, I need at least
>> the vid string for the selected device.
>> I tried libwebcam approach by using /sys/class/video4linux, but this
>> proved highly distribution dependent and has caused a lot of trouble,
>>
>
> Really ? The /sys tree shouldn't be distribution dependent. What kind of
> problems have you run into ?
>
>
Here is a little example for video0:
In Ubuntu I can get the values from:
/sys/class/video4linux/video0/device/input/ <-(here I list the
contents and there is always only one dir with some index lets say input6)
so vid I can get from input6/id/vendor and pid from input6/id/product
In Mandriva 2009 vid:pid is set in:
/sys/class/video4linux/video0/device/input/event6
libwebcam (not sure what distro was used for development) gets this
values from:
/sys/class/video4linux/video0/device/idVendor and
/sys/class/video4linux/video0/device/idProduct
>> so no I'm parsing the values passed in the device card field of
>> v4l2_capability struct. UVC sets this to "UVC Camera (vid:pid)" and since I
>> only need these fields for the uvc driver there shouldn't be a problem,
>> right?
>> Or are there any plans to change this field in the future ?
>>
>
> There are no plans, but the card field isn't meant to convey that
> information.
> The format might change in the future without notice.
>
>
This may prove to be a problem, but for now it seems my best option.
I've set the code so that in case parsing these values fails, dynamic
controls are added anyway,
since you need to run the process with root user so that it can succeed,
only logitech owners will
bother doing with it (although it produces a really ugly output :-) ).
The best solution for users is setting a udev script so that these
controls are added upon device connection,
but this seems to be a bit difficult for a lot of people, so they rather
start guvcview with root privileges once.
Best regards,
Paulo
_______________________________________________
Linux-uvc-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel