Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/videoio.h
| Show First 20 Lines • Show All 159 Lines • ▼ Show 20 Lines | |||||
| /* | /* | ||||
| * Structures | * Structures | ||||
| */ | */ | ||||
| struct v4l2_fract { | struct v4l2_fract { | ||||
| u_int32_t numerator; | u_int32_t numerator; | ||||
| u_int32_t denominator; | u_int32_t denominator; | ||||
| }; | }; | ||||
| struct v4l2_rect { | |||||
| int32_t left; | |||||
| int32_t top; | |||||
| u_int32_t width; | |||||
| u_int32_t height; | |||||
| }; | |||||
| struct v4l2_capability { | struct v4l2_capability { | ||||
| u_int8_t driver[16]; | u_int8_t driver[16]; | ||||
| u_int8_t card[32]; | u_int8_t card[32]; | ||||
| u_int8_t bus_info[32]; | u_int8_t bus_info[32]; | ||||
| u_int32_t version; | u_int32_t version; | ||||
| u_int32_t capabilities; | u_int32_t capabilities; | ||||
| u_int32_t device_caps; | u_int32_t device_caps; | ||||
| u_int32_t reserved[3]; | u_int32_t reserved[3]; | ||||
| ▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | struct v4l2_pix_format_mplane { | ||||
| u_int8_t quantization; | u_int8_t quantization; | ||||
| u_int8_t xfer_func; | u_int8_t xfer_func; | ||||
| u_int8_t reserved[7]; | u_int8_t reserved[7]; | ||||
| } __packed; | } __packed; | ||||
| #define V4L2_TYPE_IS_MULTIPLANAR(type) \ | #define V4L2_TYPE_IS_MULTIPLANAR(type) \ | ||||
| ((type) == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE || \ | ((type) == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE || \ | ||||
| (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) | (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) | ||||
| struct v4l2_clip { | |||||
| struct v4l2_rect c; | |||||
| struct v4l2_clip *next; | |||||
| }; | |||||
| struct v4l2_window { | |||||
| struct v4l2_rect w; | |||||
| u_int32_t field; | |||||
| u_int32_t chromakey; | |||||
| struct v4l2_clip *clips; | |||||
| u_int32_t clipcount; | |||||
| void *bitmap; | |||||
| u_int8_t global_alpha; | |||||
| }; | |||||
| struct v4l2_format { | struct v4l2_format { | ||||
| u_int32_t type; | u_int32_t type; | ||||
| union { | union { | ||||
| struct v4l2_pix_format pix; | struct v4l2_pix_format pix; | ||||
| struct v4l2_pix_format_mplane pix_mp; | struct v4l2_pix_format_mplane pix_mp; | ||||
| struct v4l2_window win; | |||||
| void *_align; | void *_align; | ||||
| u_int8_t raw_data[200]; | u_int8_t raw_data[200]; | ||||
| } fmt; | } fmt; | ||||
| }; | }; | ||||
| struct v4l2_fmtdesc { | struct v4l2_fmtdesc { | ||||
| u_int32_t index; /* Format number */ | u_int32_t index; /* Format number */ | ||||
| u_int32_t type; /* enum v4l2_buf_type */ | u_int32_t type; /* enum v4l2_buf_type */ | ||||
| ▲ Show 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | struct v4l2_queryctrl { | ||||
| int32_t minimum; /* Note signedness */ | int32_t minimum; /* Note signedness */ | ||||
| int32_t maximum; | int32_t maximum; | ||||
| int32_t step; | int32_t step; | ||||
| int32_t default_value; | int32_t default_value; | ||||
| u_int32_t flags; | u_int32_t flags; | ||||
| u_int32_t reserved[2]; | u_int32_t reserved[2]; | ||||
| }; | }; | ||||
| struct v4l2_querymenu { | |||||
| u_int32_t id; | |||||
| u_int32_t index; | |||||
| union { | |||||
| u_int8_t name[32]; | |||||
| int64_t value; | |||||
| }; | |||||
| u_int32_t reserved; | |||||
| } __packed; | |||||
| struct v4l2_cropcap { | |||||
| u_int32_t type; | |||||
| struct v4l2_rect bounds; | |||||
| struct v4l2_rect defrect; | |||||
| struct v4l2_fract pixelaspect; | |||||
| }; | |||||
| struct v4l2_crop { | |||||
| u_int32_t type; | |||||
| struct v4l2_rect c; | |||||
| }; | |||||
| struct v4l2_frmsize_discrete { | struct v4l2_frmsize_discrete { | ||||
| u_int32_t width; /* Frame width [pixel] */ | u_int32_t width; /* Frame width [pixel] */ | ||||
| u_int32_t height; /* Frame height [pixel] */ | u_int32_t height; /* Frame height [pixel] */ | ||||
| }; | }; | ||||
| struct v4l2_frmsize_stepwise { | struct v4l2_frmsize_stepwise { | ||||
| u_int32_t min_width; /* Minimum frame width [pixel] */ | u_int32_t min_width; /* Minimum frame width [pixel] */ | ||||
| u_int32_t max_width; /* Maximum frame width [pixel] */ | u_int32_t max_width; /* Maximum frame width [pixel] */ | ||||
| ▲ Show 20 Lines • Show All 134 Lines • ▼ Show 20 Lines | |||||
| /* | /* | ||||
| * Buffer capabilities | * Buffer capabilities | ||||
| */ | */ | ||||
| #define V4L2_BUF_CAP_SUPPORTS_MMAP (1 << 0) | #define V4L2_BUF_CAP_SUPPORTS_MMAP (1 << 0) | ||||
| /* | /* | ||||
| * Input types | * Input types | ||||
| */ | */ | ||||
| #define V4L2_INPUT_TYPE_TUNER 1 | |||||
| #define V4L2_INPUT_TYPE_CAMERA 2 | #define V4L2_INPUT_TYPE_CAMERA 2 | ||||
| /* | /* | ||||
| * Analog TV standards | * Analog TV standards | ||||
| */ | */ | ||||
| #define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000) | #define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000) | ||||
| #define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000) | #define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000) | ||||
| #define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000) | #define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000) | ||||
| Show All 17 Lines | |||||
| #define V4L2_CID_CONTRAST (V4L2_CID_BASE + 1) | #define V4L2_CID_CONTRAST (V4L2_CID_BASE + 1) | ||||
| #define V4L2_CID_SATURATION (V4L2_CID_BASE + 2) | #define V4L2_CID_SATURATION (V4L2_CID_BASE + 2) | ||||
| #define V4L2_CID_HUE (V4L2_CID_BASE + 3) | #define V4L2_CID_HUE (V4L2_CID_BASE + 3) | ||||
| #define V4L2_CID_AUTO_WHITE_BALANCE (V4L2_CID_BASE + 12) | #define V4L2_CID_AUTO_WHITE_BALANCE (V4L2_CID_BASE + 12) | ||||
| #define V4L2_CID_RED_BALANCE (V4L2_CID_BASE + 14) | #define V4L2_CID_RED_BALANCE (V4L2_CID_BASE + 14) | ||||
| #define V4L2_CID_BLUE_BALANCE (V4L2_CID_BASE + 15) | #define V4L2_CID_BLUE_BALANCE (V4L2_CID_BASE + 15) | ||||
| #define V4L2_CID_GAMMA (V4L2_CID_BASE + 16) | #define V4L2_CID_GAMMA (V4L2_CID_BASE + 16) | ||||
| #define V4L2_CID_GAIN (V4L2_CID_BASE + 19) | #define V4L2_CID_GAIN (V4L2_CID_BASE + 19) | ||||
| #define V4L2_CID_HFLIP (V4L2_CID_BASE + 20) | |||||
| #define V4L2_CID_VFLIP (V4L2_CID_BASE + 21) | |||||
| #define V4L2_CID_POWER_LINE_FREQUENCY (V4L2_CID_BASE + 24) | #define V4L2_CID_POWER_LINE_FREQUENCY (V4L2_CID_BASE + 24) | ||||
| #define V4L2_CID_HUE_AUTO (V4L2_CID_BASE + 25) | #define V4L2_CID_HUE_AUTO (V4L2_CID_BASE + 25) | ||||
| #define V4L2_CID_WHITE_BALANCE_TEMPERATURE (V4L2_CID_BASE + 26) | #define V4L2_CID_WHITE_BALANCE_TEMPERATURE (V4L2_CID_BASE + 26) | ||||
| #define V4L2_CID_SHARPNESS (V4L2_CID_BASE + 27) | #define V4L2_CID_SHARPNESS (V4L2_CID_BASE + 27) | ||||
| #define V4L2_CID_BACKLIGHT_COMPENSATION (V4L2_CID_BASE + 28) | #define V4L2_CID_BACKLIGHT_COMPENSATION (V4L2_CID_BASE + 28) | ||||
| #define V4L2_CID_LASTP1 (V4L2_CID_BASE + 44) | |||||
| #define V4L2_CID_CAMERA_CLASS_BASE 0x009a0000 | #define V4L2_CID_CAMERA_CLASS_BASE 0x009a0000 | ||||
| #define V4L2_CID_EXPOSURE_AUTO (V4L2_CID_CAMERA_CLASS_BASE + 1) | #define V4L2_CID_EXPOSURE_AUTO (V4L2_CID_CAMERA_CLASS_BASE + 1) | ||||
| #define V4L2_CID_EXPOSURE_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE + 2) | #define V4L2_CID_EXPOSURE_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE + 2) | ||||
| #define V4L2_CID_EXPOSURE_AUTO_PRIORITY (V4L2_CID_CAMERA_CLASS_BASE + 3) | #define V4L2_CID_EXPOSURE_AUTO_PRIORITY (V4L2_CID_CAMERA_CLASS_BASE + 3) | ||||
| #define V4L2_CID_FOCUS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE + 4) | #define V4L2_CID_FOCUS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE + 4) | ||||
| #define V4L2_CID_FOCUS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE + 5) | #define V4L2_CID_FOCUS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE + 5) | ||||
| #define V4L2_CID_PAN_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE + 8) | #define V4L2_CID_PAN_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE + 8) | ||||
| #define V4L2_CID_TILT_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE + 9) | #define V4L2_CID_TILT_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE + 9) | ||||
| #define V4L2_CID_FOCUS_AUTO (V4L2_CID_CAMERA_CLASS_BASE + 12) | #define V4L2_CID_FOCUS_AUTO (V4L2_CID_CAMERA_CLASS_BASE + 12) | ||||
| #define V4L2_CID_ZOOM_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE + 13) | #define V4L2_CID_ZOOM_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE + 13) | ||||
| #define V4L2_CID_ZOOM_CONTINUOUS (V4L2_CID_CAMERA_CLASS_BASE + 15) | #define V4L2_CID_ZOOM_CONTINUOUS (V4L2_CID_CAMERA_CLASS_BASE + 15) | ||||
| #define V4L2_CID_PRIVACY (V4L2_CID_CAMERA_CLASS_BASE + 16) | #define V4L2_CID_PRIVACY (V4L2_CID_CAMERA_CLASS_BASE + 16) | ||||
| /* | |||||
| * IDs reserved for driver specific controls | |||||
| */ | |||||
| #define V4L2_CID_PRIVATE_BASE 0x08000000 | |||||
| /* | |||||
| * Control flags | |||||
| */ | |||||
| #define V4L2_CTRL_FLAG_DISABLED 0x0001 | |||||
| #define V4L2_CTRL_FLAG_GRABBED 0x0002 | |||||
| #define V4L2_CTRL_FLAG_READ_ONLY 0x0004 | |||||
| #define V4L2_CTRL_FLAG_UPDATE 0x0008 | |||||
| #define V4L2_CTRL_FLAG_INACTIVE 0x0010 | |||||
| #define V4L2_CTRL_FLAG_SLIDER 0x0020 | |||||
| #define V4L2_CTRL_FLAG_WRITE_ONLY 0x0040 | |||||
| #define V4L2_CTRL_FLAG_VOLATILE 0x0080 | |||||
| /* | /* | ||||
| * V4L2 ioctl definitions | * V4L2 ioctl definitions | ||||
| */ | */ | ||||
| #define VIDIOC_QUERYCAP _IOR('V', 0, struct v4l2_capability) | #define VIDIOC_QUERYCAP _IOR('V', 0, struct v4l2_capability) | ||||
| #define VIDIOC_ENUM_FMT _IOWR('V', 2, struct v4l2_fmtdesc) | #define VIDIOC_ENUM_FMT _IOWR('V', 2, struct v4l2_fmtdesc) | ||||
| #define VIDIOC_G_FMT _IOWR('V', 4, struct v4l2_format) | #define VIDIOC_G_FMT _IOWR('V', 4, struct v4l2_format) | ||||
| #define VIDIOC_S_FMT _IOWR('V', 5, struct v4l2_format) | #define VIDIOC_S_FMT _IOWR('V', 5, struct v4l2_format) | ||||
| #define VIDIOC_REQBUFS _IOWR('V', 8, struct v4l2_requestbuffers) | #define VIDIOC_REQBUFS _IOWR('V', 8, struct v4l2_requestbuffers) | ||||
| #define VIDIOC_QUERYBUF _IOWR('V', 9, struct v4l2_buffer) | #define VIDIOC_QUERYBUF _IOWR('V', 9, struct v4l2_buffer) | ||||
| #define VIDIOC_QBUF _IOWR('V', 15, struct v4l2_buffer) | #define VIDIOC_QBUF _IOWR('V', 15, struct v4l2_buffer) | ||||
| #define VIDIOC_DQBUF _IOWR('V', 17, struct v4l2_buffer) | #define VIDIOC_DQBUF _IOWR('V', 17, struct v4l2_buffer) | ||||
| #define VIDIOC_STREAMON _IOW('V', 18, int) | #define VIDIOC_STREAMON _IOW('V', 18, int) | ||||
| #define VIDIOC_STREAMOFF _IOW('V', 19, int) | #define VIDIOC_STREAMOFF _IOW('V', 19, int) | ||||
| #define VIDIOC_G_PARM _IOWR('V', 21, struct v4l2_streamparm) | #define VIDIOC_G_PARM _IOWR('V', 21, struct v4l2_streamparm) | ||||
| #define VIDIOC_S_PARM _IOWR('V', 22, struct v4l2_streamparm) | #define VIDIOC_S_PARM _IOWR('V', 22, struct v4l2_streamparm) | ||||
| #define VIDIOC_G_STD _IOR('V', 23, v4l2_std_id) | #define VIDIOC_G_STD _IOR('V', 23, v4l2_std_id) | ||||
| #define VIDIOC_S_STD _IOW('V', 24, v4l2_std_id) | #define VIDIOC_S_STD _IOW('V', 24, v4l2_std_id) | ||||
| #define VIDIOC_ENUMSTD _IOWR('V', 25, struct v4l2_standard) | #define VIDIOC_ENUMSTD _IOWR('V', 25, struct v4l2_standard) | ||||
| #define VIDIOC_ENUMINPUT _IOWR('V', 26, struct v4l2_input) | #define VIDIOC_ENUMINPUT _IOWR('V', 26, struct v4l2_input) | ||||
| #define VIDIOC_G_CTRL _IOWR('V', 27, struct v4l2_control) | #define VIDIOC_G_CTRL _IOWR('V', 27, struct v4l2_control) | ||||
| #define VIDIOC_S_CTRL _IOWR('V', 28, struct v4l2_control) | #define VIDIOC_S_CTRL _IOWR('V', 28, struct v4l2_control) | ||||
| #define VIDIOC_QUERYCTRL _IOWR('V', 36, struct v4l2_queryctrl) | #define VIDIOC_QUERYCTRL _IOWR('V', 36, struct v4l2_queryctrl) | ||||
| #define VIDIOC_QUERYMENU _IOWR('V', 37, struct v4l2_querymenu) | |||||
| #define VIDIOC_G_INPUT _IOR('V', 38, int) | #define VIDIOC_G_INPUT _IOR('V', 38, int) | ||||
| #define VIDIOC_S_INPUT _IOWR('V', 39, int) | #define VIDIOC_S_INPUT _IOWR('V', 39, int) | ||||
| #define VIDIOC_CROPCAP _IOWR('V', 58, struct v4l2_cropcap) | |||||
| #define VIDIOC_G_CROP _IOWR('V', 59, struct v4l2_crop) | |||||
| #define VIDIOC_S_CROP _IOW('V', 60, struct v4l2_crop) | |||||
| #define VIDIOC_G_PRIORITY _IOR('V', 67, u_int32_t) | #define VIDIOC_G_PRIORITY _IOR('V', 67, u_int32_t) | ||||
| #define VIDIOC_S_PRIORITY _IOW('V', 68, u_int32_t) | #define VIDIOC_S_PRIORITY _IOW('V', 68, u_int32_t) | ||||
| #define VIDIOC_TRY_FMT _IOWR('V', 64, struct v4l2_format) | #define VIDIOC_TRY_FMT _IOWR('V', 64, struct v4l2_format) | ||||
| #define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct v4l2_frmsizeenum) | #define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct v4l2_frmsizeenum) | ||||
| #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct v4l2_frmivalenum) | #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct v4l2_frmivalenum) | ||||
| _Static_assert(sizeof(struct v4l2_pix_format) == 48, "v4l2_pix_format layout"); | _Static_assert(sizeof(struct v4l2_pix_format) == 48, "v4l2_pix_format layout"); | ||||
| _Static_assert(sizeof(struct v4l2_capability) == 104, "v4l2_capability layout"); | _Static_assert(sizeof(struct v4l2_capability) == 104, "v4l2_capability layout"); | ||||
| _Static_assert(sizeof(struct v4l2_requestbuffers) == 20, | _Static_assert(sizeof(struct v4l2_requestbuffers) == 20, | ||||
| "v4l2_requestbuffers layout"); | "v4l2_requestbuffers layout"); | ||||
| _Static_assert(sizeof(struct v4l2_querymenu) == 44, "v4l2_querymenu layout"); | |||||
| _Static_assert(sizeof(struct v4l2_cropcap) == 44, "v4l2_cropcap layout"); | |||||
| _Static_assert(sizeof(struct v4l2_crop) == 20, "v4l2_crop layout"); | |||||
| #ifdef __LP64__ | #ifdef __LP64__ | ||||
| _Static_assert(__offsetof(struct v4l2_format, fmt) == 8, "v4l2_format layout"); | _Static_assert(__offsetof(struct v4l2_format, fmt) == 8, "v4l2_format layout"); | ||||
| _Static_assert(sizeof(struct v4l2_format) == 208, "v4l2_format layout"); | _Static_assert(sizeof(struct v4l2_format) == 208, "v4l2_format layout"); | ||||
| _Static_assert(sizeof(struct v4l2_buffer) == 88, "v4l2_buffer layout"); | _Static_assert(sizeof(struct v4l2_buffer) == 88, "v4l2_buffer layout"); | ||||
| #elif defined(__i386__) | #elif defined(__i386__) | ||||
| /* i386 is the only 32-bit port with a 32-bit time_t. */ | /* i386 is the only 32-bit port with a 32-bit time_t. */ | ||||
| _Static_assert(__offsetof(struct v4l2_format, fmt) == 4, "v4l2_format layout"); | _Static_assert(__offsetof(struct v4l2_format, fmt) == 4, "v4l2_format layout"); | ||||
| _Static_assert(sizeof(struct v4l2_format) == 204, "v4l2_format layout"); | _Static_assert(sizeof(struct v4l2_format) == 204, "v4l2_format layout"); | ||||
| Show All 9 Lines | |||||