Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177570794
D58793.1794768384.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
5 KB
Referenced Files
None
Subscribers
None
D58793.1794768384.diff
View Options
diff --git a/sys/sys/videoio.h b/sys/sys/videoio.h
--- a/sys/sys/videoio.h
+++ b/sys/sys/videoio.h
@@ -43,6 +43,8 @@
#include <sys/ioccom.h>
#include <sys/time.h>
+typedef u_int64_t v4l2_std_id;
+
/*
* Four-character-code (FOURCC)
*/
@@ -193,12 +195,46 @@
u_int32_t xfer_func; /* enum v4l2_xfer_func */
};
+/*
+ * Multi-planar capture (VIDIOC_*_MPLANE)
+ */
+#define VIDEO_MAX_PLANES 8
+
+struct v4l2_plane_pix_format {
+ u_int32_t sizeimage;
+ u_int32_t bytesperline;
+ u_int16_t reserved[6];
+} __packed;
+
+struct v4l2_pix_format_mplane {
+ u_int32_t width;
+ u_int32_t height;
+ u_int32_t pixelformat;
+ u_int32_t field;
+ u_int32_t colorspace;
+ struct v4l2_plane_pix_format plane_fmt[VIDEO_MAX_PLANES];
+ u_int8_t num_planes;
+ u_int8_t flags;
+ union {
+ u_int8_t ycbcr_enc;
+ u_int8_t hsv_enc;
+ };
+ u_int8_t quantization;
+ u_int8_t xfer_func;
+ u_int8_t reserved[7];
+} __packed;
+
+#define V4L2_TYPE_IS_MULTIPLANAR(type) \
+ ((type) == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE || \
+ (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
+
struct v4l2_format {
u_int32_t type;
union {
- struct v4l2_pix_format pix;
- void *_align;
- u_int8_t raw_data[200];
+ struct v4l2_pix_format pix;
+ struct v4l2_pix_format_mplane pix_mp;
+ void *_align;
+ u_int8_t raw_data[200];
} fmt;
};
@@ -237,6 +273,7 @@
union {
u_int32_t offset;
unsigned long userptr;
+ struct v4l2_plane *planes;
int32_t fd;
} m;
u_int32_t length;
@@ -286,6 +323,27 @@
u_int32_t reserved[3];
};
+struct v4l2_standard {
+ u_int32_t index;
+ v4l2_std_id id;
+ u_int8_t name[24];
+ struct v4l2_fract frameperiod;
+ u_int32_t framelines;
+ u_int32_t reserved[4];
+};
+
+struct v4l2_plane {
+ u_int32_t bytesused;
+ u_int32_t length;
+ union {
+ u_int32_t mem_offset;
+ unsigned long userptr;
+ int32_t fd;
+ } m;
+ u_int32_t data_offset;
+ u_int32_t reserved[11];
+};
+
struct v4l2_control {
u_int32_t id;
int32_t value;
@@ -365,11 +423,21 @@
#define V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0')
#define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2')
#define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2')
+#define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9')
+#define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9')
+#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P')
/* Compressed formats */
#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G')
+#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G')
#define V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4')
#define V4L2_PIX_FMT_HEVC v4l2_fourcc('H', 'E', 'V', 'C')
+#define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4')
+#define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A')
+
+/* YUV411 planar and vendor webcam formats */
+#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P')
+#define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0')
/* Grey formats */
#define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y')
@@ -379,9 +447,17 @@
/* RGB formats */
#define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3')
+#define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R', 'G', 'B', 'O')
+#define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q')
#define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R', 'G', 'B', 'P')
+#define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R')
#define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B', 'G', 'R', '3')
+#define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4')
+#define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R', 'G', 'B', '4')
#define V4L2_PIX_FMT_XBGR32 v4l2_fourcc('X', 'R', '2', '4')
+#define V4L2_PIX_FMT_ABGR32 v4l2_fourcc('A', 'R', '2', '4')
+#define V4L2_PIX_FMT_ARGB32 v4l2_fourcc('B', 'A', '2', '4')
+#define V4L2_PIX_FMT_XRGB32 v4l2_fourcc('B', 'X', '2', '4')
/* Bayer formats */
#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1')
@@ -401,6 +477,7 @@
* Capability flags
*/
#define V4L2_CAP_VIDEO_CAPTURE 0x00000001
+#define V4L2_CAP_VIDEO_CAPTURE_MPLANE 0x00001000
#define V4L2_CAP_STREAMING 0x04000000
#define V4L2_CAP_EXT_PIX_FORMAT 0x00200000
#define V4L2_CAP_READWRITE 0x01000000
@@ -424,6 +501,7 @@
* Format flags
*/
#define V4L2_FMT_FLAG_COMPRESSED 0x0001
+#define V4L2_FMT_FLAG_EMULATED 0x0002
/*
* Buffer capabilities
@@ -435,11 +513,28 @@
*/
#define V4L2_INPUT_TYPE_CAMERA 2
+/*
+ * Analog TV standards
+ */
+#define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000)
+#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000)
+#define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000)
+#define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000)
+#define V4L2_STD_NTSC (V4L2_STD_NTSC_M | V4L2_STD_NTSC_M_JP | \
+ V4L2_STD_NTSC_443 | V4L2_STD_NTSC_M_KR)
+
/*
* Control IDs
*/
#define V4L2_CTRL_CLASS_USER 0x00980000
+#define V4L2_CTRL_CLASS_MPEG 0x00990000
#define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900)
+
+/*
+ * MPEG/codec control class
+ */
+#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
+#define V4L2_CID_MPEG_VIDEO_B_FRAMES (V4L2_CID_MPEG_BASE+14)
#define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE + 0)
#define V4L2_CID_CONTRAST (V4L2_CID_BASE + 1)
#define V4L2_CID_SATURATION (V4L2_CID_BASE + 2)
@@ -483,6 +578,9 @@
#define VIDIOC_STREAMOFF _IOW('V', 19, int)
#define VIDIOC_G_PARM _IOWR('V', 21, 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_S_STD _IOW('V', 24, v4l2_std_id)
+#define VIDIOC_ENUMSTD _IOWR('V', 25, struct v4l2_standard)
#define VIDIOC_ENUMINPUT _IOWR('V', 26, struct v4l2_input)
#define VIDIOC_G_CTRL _IOWR('V', 27, struct v4l2_control)
#define VIDIOC_S_CTRL _IOWR('V', 28, struct v4l2_control)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 15, 6:46 PM (10 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41747011
Default Alt Text
D58793.1794768384.diff (5 KB)
Attached To
Mode
D58793: video: add V4L2 compat symbols for ffmpeg/opencv
Attached
Detach File
Event Timeline