stream hu
2012-01-11 02:04:08 UTC
Hi,all:
I'm studying the UVC by reading the document about UVC, such as
"USB_Video_Class_1.1.pdf" , and so on.
In the document, there is "Extension Unit Control Requests", which defines
the format of the request sent to the device. I have known the defination
of the request type and data, but confused with the CS(wValue) and
Extension Unit ID and Inferface, what's the value of them?
I want to send a command to the device which the device supported.
In windows, I can use uvc extension unit in DirectShow by IExtensionUnit
interface, and I send the data as the following: 20 46 b4 31; 20 38 b4 02;
20 40 b4 00; 20 41 b4 00; 20 44 b4 01, then the device will zoom in the
video(0x31 means that).
And in linux, I have used the libusb_control_transfer to do the function,
the code is:
unsigned char ioBuffer[4] = {0x20,0x46,0xb4,0x31};
response = libusb_control_transfer(
handle, //handle
0x21, //bmRequestType
0x01, //bRequest
0x0400, //wValue
0x0400, //wIndex
ioBuffer, //data
4, //wLength
0 //timeout
);
it seems that the device also has respond on the command.
But I'm wondering what should I do in UVC extension unit?
According to the "doc/Documentation/video4linux/uvcvideo.txt", I can do
this through two ways:
- through mappings of XU controls to V4L2 controls
- through a driver-specific ioctl interface
But I failed in mapping the controls and don't know the detail of ioctl
interface, so could anyone give some advices on how to write the XMl file
for Mapping or give me a example about it?
Any advices will be appreciated.
Thanks very much!
Stream
I'm studying the UVC by reading the document about UVC, such as
"USB_Video_Class_1.1.pdf" , and so on.
In the document, there is "Extension Unit Control Requests", which defines
the format of the request sent to the device. I have known the defination
of the request type and data, but confused with the CS(wValue) and
Extension Unit ID and Inferface, what's the value of them?
I want to send a command to the device which the device supported.
In windows, I can use uvc extension unit in DirectShow by IExtensionUnit
interface, and I send the data as the following: 20 46 b4 31; 20 38 b4 02;
20 40 b4 00; 20 41 b4 00; 20 44 b4 01, then the device will zoom in the
video(0x31 means that).
And in linux, I have used the libusb_control_transfer to do the function,
the code is:
unsigned char ioBuffer[4] = {0x20,0x46,0xb4,0x31};
response = libusb_control_transfer(
handle, //handle
0x21, //bmRequestType
0x01, //bRequest
0x0400, //wValue
0x0400, //wIndex
ioBuffer, //data
4, //wLength
0 //timeout
);
it seems that the device also has respond on the command.
But I'm wondering what should I do in UVC extension unit?
According to the "doc/Documentation/video4linux/uvcvideo.txt", I can do
this through two ways:
- through mappings of XU controls to V4L2 controls
- through a driver-specific ioctl interface
But I failed in mapping the controls and don't know the detail of ioctl
interface, so could anyone give some advices on how to write the XMl file
for Mapping or give me a example about it?
Any advices will be appreciated.
Thanks very much!
Stream