Dynamic controls API
--------------------
This file documents the dynamic controls API and its associated ioctls. Please
keep in mind that this is a work in progress. The API can change at any time,
and the documentation is probably unaccurate. Questions and remarks can be
sent to the Linux UVC development mailing list at linux-uvc-devel@lists.berlios.de.
1. Introduction
The UVC specification allows for vendor-specific extensions through extension
units. With more and more products being UVC compliant, the number of controls
defined through extension units is expected to grow rapidly.
The Linux UVC driver supports extension unit controls (XU controls) through a
hardcode control list. This implementation requires vendors to submit a list
of their controls to the Linux UVC project, and wastes kernel memory to store
control information that are useful for a small number of cameras only. The
dynamic controls API aims at solving those issues.
The basic idea is to provide a userspace API through which applications can
add control definitions at runtime.
2. Security
The API doesn't currently provide any access control facility. Any application
allowed to access a UVC device will be able to add control definitions with no
limit. Suggestions are welcome.
3. IOCTLs
---- UVCIOC_CTRL_ADD - Define a vendor UVC control ----
Argument: struct uvc_xu_control_info
Description:
This ioctl allows userspace applications to add an Extension Unit UVC
control definition to the driver.
Return value:
On success 0 is returned. On error -1 is returned and errno is set
appropriately.
ENOMEM
Not enough memory to perform the operation.
EEXIST
Control is already defined.
Data types:
* struct uvc_xu_control_info
__u8 entity[16] Extension unit GUID
__u8 index Control index in the unit's bmControl bit field
__u8 selector Control selector
__u16 size Control size (in bytes)
__u32 flags See below
* struct uvc_xu_control_info flags field
UVC_CONTROL_SET_CUR Control is writable.
UVC_CONTROL_GET_CUR Control is readable.
UVC_CONTROL_GET_MIN Control supports GET MIN queries.
UVC_CONTROL_GET_MAX Control supports GET MAX queries.
UVC_CONTROL_GET_RES Control supports GET RES queries.
UVC_CONTROL_GET_DEF Control supports GET DEF queries.
UVC_CONTROL_RESTORE Control should be restored when resuming from
sleep.
---- UVCIOC_CTRL_MAP - Map a UVC control to a V4L2 control ----
Argument: struct uvc_xu_control_mapping
Description:
This ioctl creates a mapping between a UVC control or part of a UVC
control and a V4L2 control. Once mappings are defined, userspace
applications can access vendor-defined UVC control through the V4L2
control API.
To create a mapping, applications fill the uvc_xu_control_mapping
structure with information about an existing UVC control defined with
UVCIOC_CTRL_ADD and a new V4L2 control.
A UVC control can be mapped to several V4L2 controls. For instance,
a UVC pan/tilt control could be mapped to separate pan and tilt V4L2
controls. The UVC control is divided into non overlapping fields using
the 'size' and 'offset' fields and are then independantly mapped to
V4L2 control.
For signed integer V4L2 controls the data_type field should be set to
UVC_CTRL_DATA_TYPE_SIGNED. Other values are currently ignored.
Return value:
On success 0 is returned. On error -1 is returned and errno is set
appropriately.
ENOMEM
Not enough memory to perform the operation.
EINVAL
No such UVC control.
EOVERFLOW
The requested offset and size would overflow the UVC control.
EEXIST
Mapping already exists.
Data types:
* struct uvc_xu_control_mapping
__u32 id V4L2 control identifier
__u8 name[32] V4L2 control name
__u8 entity[16] UVC extension unit GUID
__u8 selector UVC control selector
__u8 size V4L2 control size (in bits)
__u8 offset V4L2 control offset (in bits)
enum v4l2_ctrl_type
v4l2_type V4L2 control type
enum uvc_control_data_type
data_type UVC control data type
* enum uvc_control_data_type
UVC_CTRL_DATA_TYPE_RAW Raw control (byte array)
UVC_CTRL_DATA_TYPE_SIGNED Signed integer
UVC_CTRL_DATA_TYPE_UNSIGNED Unsigned integer
UVC_CTRL_DATA_TYPE_BOOLEAN Boolean
UVC_CTRL_DATA_TYPE_ENUM Enumeration
UVC_CTRL_DATA_TYPE_BITMASK Bitmask
---- UVCIOC_CTRL_GET - Get the value of a UVC control ----
Argument: struct uvc_xu_control
Description:
This ioctl retrieves the current value of the UVC control identified
by its extension unit ID and control selector. Applications must set
the control size and provide a pointer to a writable buffer big enough
to fit the data.
Data are taken directly from the device without any driver-side
processing. Applications are responsible for data buffer formatting,
including little-endian/big-endian conversion.
Return value:
On success 0 is returned. On error -1 is returned and errno is set
appropriately.
EINVAL
No such UVC control, or control isn't readable.
EFAULT
data references an inaccessible memory area.
Data types:
* struct uvc_xu_control
__u8 unit Extension unit ID
__u8 selector Control selector
__u16 size Control data size (in bytes)
__u8 *data Control value
---- UVCIOC_CTRL_SET - Set the value of a UVC control ----
Argument: struct uvc_xu_control
Description:
This ioctl sets the value of the UVC control identified by its
extension unit ID and control selector. Applications must set the
control size and provide a pointer to a readable buffer containing the
data.
Data are passed directly to the device without any driver-side
processing. Applications are responsible for data buffer formatting,
including little-endian/big-endian conversion.
Return value:
On success 0 is returned. On error -1 is returned and errno is set
appropriately.
EINVAL
No such UVC control, or control isn't writable.
EFAULT
data references an inaccessible memory area.
Data types:
* struct uvc_xu_control
See UVCIOC_CTRL_GET
没有合适的资源?快使用搜索试试~ 我知道了~
uvc驱动 linux下摄像头驱动
4星 · 超过85%的资源 需积分: 47 282 下载量 45 浏览量
2010-08-26
10:37:12
上传
评论 2
收藏 1.04MB GZ 举报
温馨提示
共60个文件
tmp:10个
svn-base:9个
cmd:8个
linux下摄像头驱动,支持v4l2,支持的摄像头列表可在http://linux-uvc.berlios.de/ 查询
资源推荐
资源详情
资源评论
收起资源包目录
linux-uvc_trunk_arne(dfx21bu04).tar.gz (60个子文件)
linux-uvc_trunk_arne
uvcvideo.mod.c 4KB
uvc_driver.c.r125 49KB
.uvcvideo.mod.o.cmd 13KB
.uvc_v4l2.o.cmd 17KB
uvc_driver.o 166KB
uvc_video.o 119KB
uvcvideo.ko 651KB
.uvcvideo.o.cmd 486B
uvc_driver.c 51KB
uvc_video.c 28KB
uvc_driver.c.r127 49KB
.uvc_ctrl.o.cmd 16KB
Module.symvers 0B
uvc_driver_back.c 51KB
uvc_ctrl.c 29KB
uvc_video.c~ 28KB
uvcvideo.h 23KB
uvc_queue.c 11KB
uvc_queue.o 79KB
dynctrl.txt 6KB
uvc_driver.c~ 51KB
.svn
props
all-wcprops 1KB
entries 1KB
text-base
uvc_ctrl.c.svn-base 29KB
uvc_queue.c.svn-base 11KB
uvc_v4l2.c.svn-base 28KB
uvc_video.c.svn-base 28KB
Makefile.svn-base 707B
dynctrl.txt.svn-base 6KB
uvcvideo.h.svn-base 22KB
uvc_compat.h.svn-base 6KB
uvc_driver.c.svn-base 50KB
format 2B
tmp
tempfile.5.tmp 50KB
tempfile.3.tmp 21KB
props
tempfile.4.tmp 49KB
tempfile.8.tmp 22KB
tempfile.6.tmp 21KB
text-base
tempfile.7.tmp 29KB
tempfile.10.tmp 23KB
tempfile.tmp 29KB
tempfile.2.tmp 28KB
tempfile.9.tmp 50KB
prop-base
prop-base
.uvc_video.o.cmd 17KB
.tmp_versions
uvcvideo.mod 383B
uvc_driver_back.c~ 51KB
uvc_driver.c.2.mine 50KB
uvc_v4l2.c 28KB
uvc_v4l2.o 131KB
uvcvideo.mod.o 48KB
uvcvideo.o 604KB
TAGS 15KB
uvc_driver.c.mine 50KB
uvc_ctrl.o 117KB
.uvcvideo.ko.cmd 298B
.uvc_queue.o.cmd 16KB
.uvc_driver.o.cmd 17KB
uvc_compat.h 6KB
Makefile 707B
uvcvideo.h~ 23KB
共 60 条
- 1
mmz_xiaokong
- 粉丝: 102
- 资源: 17
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
前往页