📄 videodev2.h
字号:
V4L2_FRMSIZE_TYPE_STEPWISE = 3,};struct v4l2_frmsize_discrete { __u32 width; /* Frame width [pixel] */ __u32 height; /* Frame height [pixel] */};struct v4l2_frmsize_stepwise { __u32 min_width; /* Minimum frame width [pixel] */ __u32 max_width; /* Maximum frame width [pixel] */ __u32 step_width; /* Frame width step size [pixel] */ __u32 min_height; /* Minimum frame height [pixel] */ __u32 max_height; /* Maximum frame height [pixel] */ __u32 step_height; /* Frame height step size [pixel] */};struct v4l2_frmsizeenum { __u32 index; /* Frame size number */ __u32 pixel_format; /* Pixel format */ __u32 type; /* Frame size type the device supports. */ union { /* Frame size */ struct v4l2_frmsize_discrete discrete; struct v4l2_frmsize_stepwise stepwise; }; __u32 reserved[2]; /* Reserved space for future use */};/* * F R A M E R A T E E N U M E R A T I O N */enum v4l2_frmivaltypes { V4L2_FRMIVAL_TYPE_DISCRETE = 1, V4L2_FRMIVAL_TYPE_CONTINUOUS = 2, V4L2_FRMIVAL_TYPE_STEPWISE = 3,};struct v4l2_frmival_stepwise { struct v4l2_fract min; /* Minimum frame interval [s] */ struct v4l2_fract max; /* Maximum frame interval [s] */ struct v4l2_fract step; /* Frame interval step size [s] */};struct v4l2_frmivalenum { __u32 index; /* Frame format index */ __u32 pixel_format; /* Pixel format */ __u32 width; /* Frame width */ __u32 height; /* Frame height */ __u32 type; /* Frame interval type the device supports. */ union { /* Frame interval */ struct v4l2_fract discrete; struct v4l2_frmival_stepwise stepwise; }; __u32 reserved[2]; /* Reserved space for future use */};#endif/* * T I M E C O D E */struct v4l2_timecode { __u32 type; __u32 flags; __u8 frames; __u8 seconds; __u8 minutes; __u8 hours; __u8 userbits[4];};/* Type */#define V4L2_TC_TYPE_24FPS 1#define V4L2_TC_TYPE_25FPS 2#define V4L2_TC_TYPE_30FPS 3#define V4L2_TC_TYPE_50FPS 4#define V4L2_TC_TYPE_60FPS 5/* Flags */#define V4L2_TC_FLAG_DROPFRAME 0x0001 /* "drop-frame" mode */#define V4L2_TC_FLAG_COLORFRAME 0x0002#define V4L2_TC_USERBITS_field 0x000C#define V4L2_TC_USERBITS_USERDEFINED 0x0000#define V4L2_TC_USERBITS_8BITCHARS 0x0008/* The above is based on SMPTE timecodes */struct v4l2_jpegcompression { int quality; int APPn; /* Number of APP segment to be written, * must be 0..15 */ int APP_len; /* Length of data in JPEG APPn segment */ char APP_data[60]; /* Data in the JPEG APPn segment. */ int COM_len; /* Length of data in JPEG COM segment */ char COM_data[60]; /* Data in JPEG COM segment */ __u32 jpeg_markers; /* Which markers should go into the JPEG * output. Unless you exactly know what * you do, leave them untouched. * Inluding less markers will make the * resulting code smaller, but there will * be fewer aplications which can read it. * The presence of the APP and COM marker * is influenced by APP_len and COM_len * ONLY, not by this property! */#define V4L2_JPEG_MARKER_DHT (1<<3) /* Define Huffman Tables */#define V4L2_JPEG_MARKER_DQT (1<<4) /* Define Quantization Tables */#define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */#define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */#define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will * allways use APP0 */};/* * M E M O R Y - M A P P I N G B U F F E R S */struct v4l2_requestbuffers { __u32 count; enum v4l2_buf_type type; enum v4l2_memory memory; __u32 reserved[2];};struct v4l2_buffer { __u32 index; enum v4l2_buf_type type; __u32 bytesused; __u32 flags; enum v4l2_field field; struct timeval timestamp; struct v4l2_timecode timecode; __u32 sequence; /* memory location */ enum v4l2_memory memory; union { __u32 offset; unsigned long userptr; } m; __u32 length; __u32 input; __u32 reserved;};/* Flags for 'flags' field */#define V4L2_BUF_FLAG_MAPPED 0x0001 /* Buffer is mapped (flag) */#define V4L2_BUF_FLAG_QUEUED 0x0002 /* Buffer is queued for processing */#define V4L2_BUF_FLAG_DONE 0x0004 /* Buffer is ready */#define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */#define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */#define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */#define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid *//* * O V E R L A Y P R E V I E W */struct v4l2_framebuffer { __u32 capability; __u32 flags;/* FIXME: in theory we should pass something like PCI device + memory * region + offset instead of some physical address */ void *base; struct v4l2_pix_format fmt;};/* Flags for the 'capability' field. Read only */#define V4L2_FBUF_CAP_EXTERNOVERLAY 0x0001#define V4L2_FBUF_CAP_CHROMAKEY 0x0002#define V4L2_FBUF_CAP_LIST_CLIPPING 0x0004#define V4L2_FBUF_CAP_BITMAP_CLIPPING 0x0008#define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010#define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020#define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040/* Flags for the 'flags' field. */#define V4L2_FBUF_FLAG_PRIMARY 0x0001#define V4L2_FBUF_FLAG_OVERLAY 0x0002#define V4L2_FBUF_FLAG_CHROMAKEY 0x0004#define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008#define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010#define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020struct v4l2_clip { struct v4l2_rect c; struct v4l2_clip __user *next;};struct v4l2_window { struct v4l2_rect w; enum v4l2_field field; __u32 chromakey; struct v4l2_clip __user *clips; __u32 clipcount; void __user *bitmap; __u8 global_alpha;};/* * C A P T U R E P A R A M E T E R S */struct v4l2_captureparm { __u32 capability; /* Supported modes */ __u32 capturemode; /* Current mode */ struct v4l2_fract timeperframe; /* Time per frame in .1us units */ __u32 extendedmode; /* Driver-specific extensions */ __u32 readbuffers; /* # of buffers for read */ __u32 reserved[4];};/* Flags for 'capability' and 'capturemode' fields */#define V4L2_MODE_HIGHQUALITY 0x0001 /* High quality imaging mode */#define V4L2_CAP_TIMEPERFRAME 0x1000 /* timeperframe field is supported */struct v4l2_outputparm { __u32 capability; /* Supported modes */ __u32 outputmode; /* Current mode */ struct v4l2_fract timeperframe; /* Time per frame in seconds */ __u32 extendedmode; /* Driver-specific extensions */ __u32 writebuffers; /* # of buffers for write */ __u32 reserved[4];};/* * I N P U T I M A G E C R O P P I N G */struct v4l2_cropcap { enum v4l2_buf_type type; struct v4l2_rect bounds; struct v4l2_rect defrect; struct v4l2_fract pixelaspect;};struct v4l2_crop { enum v4l2_buf_type type; struct v4l2_rect c;};/* * A N A L O G V I D E O S T A N D A R D */typedef __u64 v4l2_std_id;/* one bit for each */#define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001)#define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002)#define V4L2_STD_PAL_G ((v4l2_std_id)0x00000004)#define V4L2_STD_PAL_H ((v4l2_std_id)0x00000008)#define V4L2_STD_PAL_I ((v4l2_std_id)0x00000010)#define V4L2_STD_PAL_D ((v4l2_std_id)0x00000020)#define V4L2_STD_PAL_D1 ((v4l2_std_id)0x00000040)#define V4L2_STD_PAL_K ((v4l2_std_id)0x00000080)#define V4L2_STD_PAL_M ((v4l2_std_id)0x00000100)#define V4L2_STD_PAL_N ((v4l2_std_id)0x00000200)#define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400)#define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800)#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_SECAM_B ((v4l2_std_id)0x00010000)#define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)#define V4L2_STD_SECAM_G ((v4l2_std_id)0x00040000)#define V4L2_STD_SECAM_H ((v4l2_std_id)0x00080000)#define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000)#define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000)#define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000)#define V4L2_STD_SECAM_LC ((v4l2_std_id)0x00800000)/* ATSC/HDTV */#define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000)#define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000)/* FIXME: Although std_id is 64 bits, there is an issue on PPC32 architecture that makes switch(__u64) to break. So, there's a hack on v4l2-common.c rounding this value to 32 bits. As, currently, the max value is for V4L2_STD_ATSC_16_VSB (30 bits wide), it should work fine. However, if needed to add more than two standards, v4l2-common.c should be fixed. *//* some merged standards */#define V4L2_STD_MN (V4L2_STD_PAL_M|V4L2_STD_PAL_N|V4L2_STD_PAL_Nc|V4L2_STD_NTSC)#define V4L2_STD_B (V4L2_STD_PAL_B|V4L2_STD_PAL_B1|V4L2_STD_SECAM_B)#define V4L2_STD_GH (V4L2_STD_PAL_G|V4L2_STD_PAL_H|V4L2_STD_SECAM_G|V4L2_STD_SECAM_H)#define V4L2_STD_DK (V4L2_STD_PAL_DK|V4L2_STD_SECAM_DK)/* some common needed stuff */#define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\ V4L2_STD_PAL_B1 |\ V4L2_STD_PAL_G)#define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |\ V4L2_STD_PAL_D1 |\ V4L2_STD_PAL_K)#define V4L2_STD_PAL (V4L2_STD_PAL_BG |\ V4L2_STD_PAL_DK |\ V4L2_STD_PAL_H |\ V4L2_STD_PAL_I)#define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\ V4L2_STD_NTSC_M_JP |\ V4L2_STD_NTSC_M_KR)#define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |\ V4L2_STD_SECAM_K |\ V4L2_STD_SECAM_K1)#define V4L2_STD_SECAM (V4L2_STD_SECAM_B |\ V4L2_STD_SECAM_G |\ V4L2_STD_SECAM_H |\ V4L2_STD_SECAM_DK |\ V4L2_STD_SECAM_L |\ V4L2_STD_SECAM_LC)#define V4L2_STD_525_60 (V4L2_STD_PAL_M |\ V4L2_STD_PAL_60 |\ V4L2_STD_NTSC |\ V4L2_STD_NTSC_443)#define V4L2_STD_625_50 (V4L2_STD_PAL |\ V4L2_STD_PAL_N |\ V4L2_STD_PAL_Nc |\ V4L2_STD_SECAM)#define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |\ V4L2_STD_ATSC_16_VSB)#define V4L2_STD_UNKNOWN 0#define V4L2_STD_ALL (V4L2_STD_525_60 |\ V4L2_STD_625_50)struct v4l2_standard { __u32 index; v4l2_std_id id; __u8 name[24]; struct v4l2_fract frameperiod; /* Frames, not fields */ __u32 framelines; __u32 reserved[4];};/* * V I D E O I N P U T S */struct v4l2_input { __u32 index; /* Which input */ __u8 name[32]; /* Label */ __u32 type; /* Type of input */ __u32 audioset; /* Associated audios (bitfield) */ __u32 tuner; /* Associated tuner */ v4l2_std_id std; __u32 status; __u32 reserved[4];};/* Values for the 'type' field */#define V4L2_INPUT_TYPE_TUNER 1#define V4L2_INPUT_TYPE_CAMERA 2/* field 'status' - general */#define V4L2_IN_ST_NO_POWER 0x00000001 /* Attached device is off */#define V4L2_IN_ST_NO_SIGNAL 0x00000002#define V4L2_IN_ST_NO_COLOR 0x00000004/* field 'status' - analog */#define V4L2_IN_ST_NO_H_LOCK 0x00000100 /* No horizontal sync lock */#define V4L2_IN_ST_COLOR_KILL 0x00000200 /* Color killer is active */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -