mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
media: uvcvideo: implement UVC v1.5 ROI
Implement support for ROI as described in UVC 1.5: 4.2.2.1.20 Digital Region of Interest (ROI) Control ROI control is implemented using V4L2 control API as two UVC-specific controls: V4L2_CID_UVC_REGION_OF_INTEREST_RECT and V4L2_CID_UVC_REGION_OF_INTEREST_AUTO. Reviewed-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Yunke Cao <yunkec@google.com> Reviewed-by: Yunke Cao <yunkec@google.com> Tested-by: Yunke Cao <yunkec@google.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Link: https://lore.kernel.org/r/20250203-uvc-roi-v17-16-5900a9fed613@chromium.org Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> [hverkuil: fix control names: "Of" -> "of", "Controls" -> "Ctrls"]
This commit is contained in:
@@ -104,6 +104,7 @@
|
||||
#define UVC_CT_ROLL_ABSOLUTE_CONTROL 0x0f
|
||||
#define UVC_CT_ROLL_RELATIVE_CONTROL 0x10
|
||||
#define UVC_CT_PRIVACY_CONTROL 0x11
|
||||
#define UVC_CT_REGION_OF_INTEREST_CONTROL 0x14
|
||||
|
||||
/* A.9.5. Processing Unit Control Selectors */
|
||||
#define UVC_PU_CONTROL_UNDEFINED 0x00
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#define UVC_CTRL_DATA_TYPE_BOOLEAN 3
|
||||
#define UVC_CTRL_DATA_TYPE_ENUM 4
|
||||
#define UVC_CTRL_DATA_TYPE_BITMASK 5
|
||||
#define UVC_CTRL_DATA_TYPE_RECT 6
|
||||
|
||||
/* Control flags */
|
||||
#define UVC_CTRL_FLAG_SET_CUR (1 << 0)
|
||||
@@ -38,6 +39,18 @@
|
||||
|
||||
#define UVC_MENU_NAME_LEN 32
|
||||
|
||||
/* V4L2 driver-specific controls */
|
||||
#define V4L2_CID_UVC_REGION_OF_INTEREST_RECT (V4L2_CID_USER_UVC_BASE + 1)
|
||||
#define V4L2_CID_UVC_REGION_OF_INTEREST_AUTO (V4L2_CID_USER_UVC_BASE + 2)
|
||||
#define V4L2_UVC_REGION_OF_INTEREST_AUTO_EXPOSURE (1 << 0)
|
||||
#define V4L2_UVC_REGION_OF_INTEREST_AUTO_IRIS (1 << 1)
|
||||
#define V4L2_UVC_REGION_OF_INTEREST_AUTO_WHITE_BALANCE (1 << 2)
|
||||
#define V4L2_UVC_REGION_OF_INTEREST_AUTO_FOCUS (1 << 3)
|
||||
#define V4L2_UVC_REGION_OF_INTEREST_AUTO_FACE_DETECT (1 << 4)
|
||||
#define V4L2_UVC_REGION_OF_INTEREST_AUTO_DETECT_AND_TRACK (1 << 5)
|
||||
#define V4L2_UVC_REGION_OF_INTEREST_AUTO_IMAGE_STABILIZATION (1 << 6)
|
||||
#define V4L2_UVC_REGION_OF_INTEREST_AUTO_HIGHER_QUALITY (1 << 7)
|
||||
|
||||
struct uvc_menu_info {
|
||||
__u32 value;
|
||||
__u8 name[UVC_MENU_NAME_LEN];
|
||||
|
||||
@@ -215,6 +215,13 @@ enum v4l2_colorfx {
|
||||
*/
|
||||
#define V4L2_CID_USER_THP7312_BASE (V4L2_CID_USER_BASE + 0x11c0)
|
||||
|
||||
/*
|
||||
* The base for the uvc driver controls.
|
||||
* See linux/uvcvideo.h for the list of controls.
|
||||
* We reserve 64 controls for this driver.
|
||||
*/
|
||||
#define V4L2_CID_USER_UVC_BASE (V4L2_CID_USER_BASE + 0x11e0)
|
||||
|
||||
/* MPEG-class control IDs */
|
||||
/* The MPEG controls are applicable to all codec controls
|
||||
* and the 'MPEG' part of the define is historical */
|
||||
|
||||
Reference in New Issue
Block a user