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.
Showing the changes to include/uapi/linux (3 of 5 files). Show all
Unified · Split
| @@ -104,6 +104,7 @@ · 103 unmodified lines | ||
| 104 | 104 | #define UVC_CT_ROLL_ABSOLUTE_CONTROL 0x0f |
| 105 | 105 | #define UVC_CT_ROLL_RELATIVE_CONTROL 0x10 |
| 106 | 106 | #define UVC_CT_PRIVACY_CONTROL 0x11 |
| 107 | +#define UVC_CT_REGION_OF_INTEREST_CONTROL 0x14 | |
| 107 | 108 | |
| 108 | 109 | /* A.9.5. Processing Unit Control Selectors */ |
| 109 | 110 | #define UVC_PU_CONTROL_UNDEFINED 0x00 |
| @@ -16,6 +16,7 @@ · 15 unmodified lines | ||
| 16 | 16 | #define UVC_CTRL_DATA_TYPE_BOOLEAN 3 |
| 17 | 17 | #define UVC_CTRL_DATA_TYPE_ENUM 4 |
| 18 | 18 | #define UVC_CTRL_DATA_TYPE_BITMASK 5 |
| 19 | +#define UVC_CTRL_DATA_TYPE_RECT 6 | |
| 19 | 20 | |
| 20 | 21 | /* Control flags */ |
| 21 | 22 | #define UVC_CTRL_FLAG_SET_CUR (1 << 0) |
| @@ -38,6 +39,18 @@ · 16 unmodified lines | ||
| 38 | 39 | |
| 39 | 40 | #define UVC_MENU_NAME_LEN 32 |
| 40 | 41 | |
| 42 | +/* V4L2 driver-specific controls */ | |
| 43 | +#define V4L2_CID_UVC_REGION_OF_INTEREST_RECT (V4L2_CID_USER_UVC_BASE + 1) | |
| 44 | +#define V4L2_CID_UVC_REGION_OF_INTEREST_AUTO (V4L2_CID_USER_UVC_BASE + 2) | |
| 45 | +#define V4L2_UVC_REGION_OF_INTEREST_AUTO_EXPOSURE (1 << 0) | |
| 46 | +#define V4L2_UVC_REGION_OF_INTEREST_AUTO_IRIS (1 << 1) | |
| 47 | +#define V4L2_UVC_REGION_OF_INTEREST_AUTO_WHITE_BALANCE (1 << 2) | |
| 48 | +#define V4L2_UVC_REGION_OF_INTEREST_AUTO_FOCUS (1 << 3) | |
| 49 | +#define V4L2_UVC_REGION_OF_INTEREST_AUTO_FACE_DETECT (1 << 4) | |
| 50 | +#define V4L2_UVC_REGION_OF_INTEREST_AUTO_DETECT_AND_TRACK (1 << 5) | |
| 51 | +#define V4L2_UVC_REGION_OF_INTEREST_AUTO_IMAGE_STABILIZATION (1 << 6) | |
| 52 | +#define V4L2_UVC_REGION_OF_INTEREST_AUTO_HIGHER_QUALITY (1 << 7) | |
| 53 | + | |
| 41 | 54 | struct uvc_menu_info { |
| 42 | 55 | __u32 value; |
| 43 | 56 | __u8 name[UVC_MENU_NAME_LEN]; |
| @@ -215,6 +215,13 @@ enum v4l2_colorfx { · 214 unmodified lines | ||
| 215 | 215 | */ |
| 216 | 216 | #define V4L2_CID_USER_THP7312_BASE (V4L2_CID_USER_BASE + 0x11c0) |
| 217 | 217 | |
| 218 | +/* | |
| 219 | + * The base for the uvc driver controls. | |
| 220 | + * See linux/uvcvideo.h for the list of controls. | |
| 221 | + * We reserve 64 controls for this driver. | |
| 222 | + */ | |
| 223 | +#define V4L2_CID_USER_UVC_BASE (V4L2_CID_USER_BASE + 0x11e0) | |
| 224 | + | |
| 218 | 225 | /* MPEG-class control IDs */ |
| 219 | 226 | /* The MPEG controls are applicable to all codec controls |
| 220 | 227 | * and the 'MPEG' part of the define is historical */ |