⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 videodev2.h

📁 Webcam Linux driver for Quickcam
💻 H
📖 第 1 页 / 共 3 页
字号:
#define VIDIOC_G_STD		_IOR  ('V', 23, struct v4l2_standard)#define VIDIOC_S_STD		_IOW  ('V', 24, struct v4l2_standard)#define VIDIOC_ENUMSTD		_IOWR ('V', 25, struct v4l2_enumstd)#define VIDIOC_ENUMINPUT	_IOWR ('V', 26, struct v4l2_input)#define VIDIOC_G_CTRL		_IOWR ('V', 27, struct v4l2_control)#define VIDIOC_S_CTRL		_IOW  ('V', 28, struct v4l2_control)#define VIDIOC_G_TUNER		_IOWR ('V', 29, struct v4l2_tuner)#define VIDIOC_S_TUNER		_IOW  ('V', 30, struct v4l2_tuner)#define VIDIOC_G_FREQ		_IOR  ('V', 31, int)#define VIDIOC_S_FREQ		_IOWR ('V', 32, int)#define VIDIOC_G_AUDIO		_IOWR ('V', 33, struct v4l2_audio)#define VIDIOC_S_AUDIO		_IOW  ('V', 34, struct v4l2_audio)#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_S_INPUT		_IOWR ('V', 39, int)#define VIDIOC_ENUMCVT		_IOWR ('V', 40, struct v4l2_cvtdesc)#define VIDIOC_G_OUTPUT		_IOR  ('V', 46, int)#define VIDIOC_S_OUTPUT		_IOWR ('V', 47, int)#define VIDIOC_ENUMOUTPUT	_IOWR ('V', 48, struct v4l2_output)#define VIDIOC_G_AUDOUT		_IOWR ('V', 49, struct v4l2_audioout)#define VIDIOC_S_AUDOUT		_IOW  ('V', 50, struct v4l2_audioout)#define VIDIOC_ENUMFX		_IOWR ('V', 51, struct v4l2_fxdesc)#define VIDIOC_G_EFFECT		_IOR  ('V', 52, int)#define VIDIOC_S_EFFECT		_IOWR ('V', 53, int)#define VIDIOC_G_MODULATOR	_IOWR ('V', 54, struct v4l2_modulator)#define VIDIOC_S_MODULATOR	_IOW  ('V', 55, struct v4l2_modulator)#define VIDIOC_ENUM_CAPFMT	VIDIOC_ENUM_PIXFMT#define VIDIOC_ENUM_OUTFMT	VIDIOC_ENUM_PIXFMT#define VIDIOC_ENUM_SRCFMT	VIDIOC_ENUM_PIXFMT#define VIDIOC_ENUMFMT		VIDIOC_ENUM_PIXFMT#define BASE_VIDIOC_PRIVATE	192		/* 192-255 are private */#ifdef __KERNEL__/* *	These things are used only by drivers. */extern int videodev_init(void);/* * *	V 4 L 2   D R I V E R   H E L P E R   A P I * *	Some commonly needed functions for drivers. */extern void v4l2_version(int *major, int *minor);extern int v4l2_major_number(void);/*  Memory management  */extern unsigned long v4l2_vmalloc_to_bus(void *virt);extern unsigned long v4l2_vmalloc_to_page(void *virt);/*  Simple queue management  */struct v4l2_q_node{	struct v4l2_q_node 	*forw, *back;};struct v4l2_queue{	struct v4l2_q_node	*forw, *back;	rwlock_t		qlock;};extern void  v4l2_q_init(struct v4l2_queue *q);extern void  v4l2_q_add_head(struct v4l2_queue *q, struct v4l2_q_node *node);extern void  v4l2_q_add_tail(struct v4l2_queue *q, struct v4l2_q_node *node);extern void *v4l2_q_del_head(struct v4l2_queue *q);extern void *v4l2_q_del_tail(struct v4l2_queue *q);extern void *v4l2_q_peek_head(struct v4l2_queue *q);extern void *v4l2_q_peek_tail(struct v4l2_queue *q);extern void *v4l2_q_yank_node(struct v4l2_queue *q, struct v4l2_q_node *node);/*  Math functions  */extern u32 v4l2_math_div6432(u64 a, u32 d, u32 *r);/*  Time functions  */extern unsigned long v4l2_timestamp_divide(stamp_t t,					   unsigned long p_100ns);extern unsigned long v4l2_timestamp_correct(stamp_t *t,					    unsigned long p_100ns);/*  Master Clock functions  */struct v4l2_clock{	void	(*gettime)(stamp_t *);};extern int  v4l2_masterclock_register(struct v4l2_clock *clock);extern void v4l2_masterclock_unregister(struct v4l2_clock *clock);extern void v4l2_masterclock_gettime(stamp_t *curr);/*  Video standard functions  */extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs);extern unsigned long v4l2_video_std_tpf(struct v4l2_standard *vs);extern int v4l2_video_std_confirm(struct v4l2_standard *vs);extern int v4l2_video_std_construct(struct v4l2_standard *vs,				    int id, __u32 transmission);#define V4L2_STD_PAL		1	/* PAL B, G, H, I (...) */#define V4L2_STD_PAL_M		5	/* (Brazil) */#define V4L2_STD_PAL_N		6	/* (Argentina, Paraguay, Uruguay) */#define V4L2_STD_PAL_60		10	/* PAL/NTSC hybrid */#define V4L2_STD_NTSC		11	/* NTSC M (USA, ...) */#define V4L2_STD_NTSC_N		12	/* (Barbados, Bolivia, Colombia, 					   S. Korea) */#define V4L2_STD_NTSC_44	15	/* PAL/NTSC hybrid */#define V4L2_STD_SECAM		21	/* SECAM B, D, G, K, K1 (...) *///#define V4L2_STD_SECAM_H	27	/* (Greece, Iran, Morocco) */ //#define V4L2_STD_SECAM_L	28	/* (France, Luxembourg, Monaco) *///#define V4L2_STD_SECAM_M	29	/* (Jamaica) *//* *	D E V I C E   D R I V E R   R E G I S T R A T I O N * */struct v4l2_device{	char	name[32];	int	type;	int	minor;	int	(*open)(struct v4l2_device *v,			int flags, void **idptr);	void	(*close)(void *id);	long	(*read)(void *id,			char *buf, unsigned long count, int noblock);	long	(*write)(void *id,			 const char *buf, unsigned long count, int noblock);	int	(*ioctl)(void *id,			 unsigned int cmd, void *arg);	int	(*mmap)(void *id,			struct vm_area_struct *vma);	int	(*poll)(void *id,			struct file *file, poll_table *table);	int	(*initialize)(struct v4l2_device *v);	void	*priv;	/*  may be used by the driver  */	int	busy;		/*  open count maintained by videodev.c  */	void	*v4l2_priv;		/*  for V4L2 use  */	int	v4l2_reserved[4];	/*  for V4L2 use  */};/*  Size of kernel ioctl arg buffer used in ioctl handler  */#define V4L2_MAX_IOCTL_SIZE		256extern int v4l2_register_device(struct v4l2_device *);extern void v4l2_unregister_device(struct v4l2_device *);/*  V4L2 structures  */extern struct v4l2_device *v4l2_device_from_file(struct file *file);extern void *v4l2_openid_from_file(struct file *file);#endif/*ifdef __KERNEL__ *//*----------------------------------------------------------------------       Old Video for Linux backward compatibility below this line.   ----------------------------------------------------------------------  All new applications should use the new API calls.  (These definitions taken from 2.2.1.) */#define VID_TYPE_CAPTURE	1	/* Can capture */#define VID_TYPE_TUNER		2	/* Can tune */#define VID_TYPE_TELETEXT	4	/* Does teletext */#define VID_TYPE_OVERLAY	8	/* Overlay onto frame buffer */#define VID_TYPE_CHROMAKEY	16	/* Overlay by chromakey */#define VID_TYPE_CLIPPING	32	/* Can clip */#define VID_TYPE_FRAMERAM	64	/* Uses the frame buffer memory */#define VID_TYPE_SCALES		128	/* Scalable */#define VID_TYPE_MONOCHROME	256	/* Monochrome only */#define VID_TYPE_SUBCAPTURE	512	/* Can capture subareas of the image */struct video_capability{	char name[32];	int type;	int channels;	/* Num channels */	int audios;	/* Num audio devices */	int maxwidth;	/* Supported width */	int maxheight;	/* And height */	int minwidth;	/* Supported width */	int minheight;	/* And height */};struct video_channel{	int channel;	char name[32];	int tuners;	__u32  flags;#define VIDEO_VC_TUNER		1	/* Channel has a tuner */#define VIDEO_VC_AUDIO		2	/* Channel has audio */	__u16  type;#define VIDEO_TYPE_TV		1#define VIDEO_TYPE_CAMERA	2		__u16 norm;			/* Norm set by channel */};struct video_tuner{	int tuner;	char name[32];	ulong rangelow, rangehigh;	/* Tuner range */	__u32 flags;#define VIDEO_TUNER_PAL		1#define VIDEO_TUNER_NTSC	2#define VIDEO_TUNER_SECAM	4#define VIDEO_TUNER_LOW		8	/* Uses KHz not MHz */#define VIDEO_TUNER_NORM	16	/* Tuner can set norm */#define VIDEO_TUNER_STEREO_ON	128	/* Tuner is seeing stereo */#define VIDEO_TUNER_RDS_ON      256     /* Tuner is seeing an RDS datastream */#define VIDEO_TUNER_MBS_ON      512     /* Tuner is seeing an MBS datastream */	__u16 mode;			/* PAL/NTSC/SECAM/OTHER */#define VIDEO_MODE_PAL		0#define VIDEO_MODE_NTSC		1#define VIDEO_MODE_SECAM	2#define VIDEO_MODE_AUTO		3	__u16 signal;			/* Signal strength 16bit scale */};struct video_picture{	__u16	brightness;	__u16	hue;	__u16	colour;	__u16	contrast;	__u16	whiteness;	/* Black and white only */	__u16	depth;		/* Capture depth */	__u16   palette;	/* Palette in use */#define VIDEO_PALETTE_GREY	1	/* Linear greyscale */#define VIDEO_PALETTE_HI240	2	/* High 240 cube (BT848) */#define VIDEO_PALETTE_RGB565	3	/* 565 16 bit RGB */#define VIDEO_PALETTE_RGB24	4	/* 24bit RGB */#define VIDEO_PALETTE_RGB32	5	/* 32bit RGB */	#define VIDEO_PALETTE_RGB555	6	/* 555 15bit RGB */#define VIDEO_PALETTE_YUV422	7	/* YUV422 capture */#define VIDEO_PALETTE_YUYV	8#define VIDEO_PALETTE_UYVY	9	/* The great thing about standards is ... */#define VIDEO_PALETTE_YUV420	10#define VIDEO_PALETTE_YUV411	11	/* YUV411 capture */#define VIDEO_PALETTE_RAW	12	/* RAW capture (BT848) */#define VIDEO_PALETTE_YUV422P	13	/* YUV 4:2:2 Planar */#define VIDEO_PALETTE_YUV411P	14	/* YUV 4:1:1 Planar */#define VIDEO_PALETTE_YUV420P	15	/* YUV 4:2:0 Planar */#define VIDEO_PALETTE_YUV410P	16	/* YUV 4:1:0 Planar */#define VIDEO_PALETTE_PLANAR	13	/* start of planar entries */#define VIDEO_PALETTE_COMPONENT 7	/* start of component entries */};struct video_audio{	int	audio;		/* Audio channel */	__u16	volume;		/* If settable */	__u16	bass, treble;	__u32	flags;#define VIDEO_AUDIO_MUTE	1#define VIDEO_AUDIO_MUTABLE	2#define VIDEO_AUDIO_VOLUME	4#define VIDEO_AUDIO_BASS	8#define VIDEO_AUDIO_TREBLE	16#define VIDEO_AUDIO_BALANCE	32	char    name[16];#define VIDEO_SOUND_MONO	1#define VIDEO_SOUND_STEREO	2#define VIDEO_SOUND_LANG1	4#define VIDEO_SOUND_LANG2	8	__u16   mode;	__u16	balance;	/* Stereo balance */	__u16	step;		/* Step actual volume uses */};struct video_clip{	__s32	x,y;	__s32	width, height;	struct	video_clip *next;	/* For user use/driver use only */};struct video_window{	__u32	x,y;			/* Position of window */	__u32	width,height;		/* Its size */	__u32	chromakey;	__u32	flags;	struct	video_clip *clips;	/* Set only */	int	clipcount;#define VIDEO_WINDOW_INTERLACE	1#define VIDEO_CLIP_BITMAP	-1/* bitmap is 1024x625, a '1' bit represents a clipped pixel */#define VIDEO_CLIPMAP_SIZE	(128 * 625)};struct video_capture{	__u32 	x,y;			/* Offsets into image */	__u32	width, height;		/* Area to capture */	__u16	decimation;		/* Decimation divder */	__u16	flags;			/* Flags for capture */#define VIDEO_CAPTURE_ODD		0	/* Temporal */#define VIDEO_CAPTURE_EVEN		1};struct video_buffer{	void	*base;	int	height,width;	int	depth;	int	bytesperline;};struct video_mmap{	unsigned	int frame;		/* Frame (0 - n) for double buffer */	int		height,width;	unsigned	int format;		/* should be VIDEO_PALETTE_* */};struct video_key{	__u8	key[8];	__u32	flags;};#define VIDEO_MAX_FRAME		32struct video_mbuf{	int	size;		/* Total memory to map */	int	frames;		/* Frames */	int	offsets[VIDEO_MAX_FRAME];};	#define 	VIDEO_NO_UNIT	(-1)	struct video_unit{	int 	video;		/* Video minor */	int	vbi;		/* VBI minor */	int	radio;		/* Radio minor */	int	audio;		/* Audio minor */	int	teletext;	/* Teletext minor */};#define VIDIOCGCAP		_IOR('v',1,struct video_capability)	/* Get capabilities */#define VIDIOCGCHAN		_IOWR('v',2,struct video_channel)	/* Get channel info (sources) */#define VIDIOCSCHAN		_IOW('v',3,struct video_channel)	/* Set channel 	*/#define VIDIOCGTUNER		_IOWR('v',4,struct video_tuner)		/* Get tuner abilities */#define VIDIOCSTUNER		_IOW('v',5,struct video_tuner)		/* Tune the tuner for the current channel */#define VIDIOCGPICT		_IOR('v',6,struct video_picture)	/* Get picture properties */#define VIDIOCSPICT		_IOW('v',7,struct video_picture)	/* Set picture properties */#define VIDIOCCAPTURE		_IOW('v',8,int)				/* Start, end capture */#define VIDIOCGWIN		_IOR('v',9, struct video_window)	/* Set the video overlay window */#define VIDIOCSWIN		_IOW('v',10, struct video_window)	/* Set the video overlay window - passes clip list for hardware smarts , chromakey etc */#define VIDIOCGFBUF		_IOR('v',11, struct video_buffer)	/* Get frame buffer */#define VIDIOCSFBUF		_IOW('v',12, struct video_buffer)	/* Set frame buffer - root only */#define VIDIOCKEY		_IOR('v',13, struct video_key)		/* Video key event - to dev 255 is to all - cuts capture on all DMA windows with this key (0xFFFFFFFF == all) */#define VIDIOCGFREQ		_IOR('v',14, unsigned long)		/* Set tuner */#define VIDIOCSFREQ		_IOW('v',15, unsigned long)		/* Set tuner */#define VIDIOCGAUDIO		_IOR('v',16, struct video_audio)	/* Get audio info */#define VIDIOCSAUDIO		_IOW('v',17, struct video_audio)	/* Audio source, mute etc */#define VIDIOCSYNC		_IOW('v',18, int)			/* Sync with mmap grabbing */#define VIDIOCMCAPTURE		_IOW('v',19, struct video_mmap)		/* Grab frames */#define VIDIOCGMBUF		_IOR('v', 20, struct video_mbuf)	/* Memory map buffer info */#define VIDIOCGUNIT		_IOR('v', 21, struct video_unit)	/* Get attached units */#define VIDIOCGCAPTURE		_IOR('v',22, struct video_capture)	/* Get frame buffer */#define VIDIOCSCAPTURE		_IOW('v',23, struct video_capture)	/* Set frame buffer - root only */#define BASE_VIDIOCPRIVATE	192		/* 192-255 are private */#endif/*ifndef __LINUX_VIDEODEV_H*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -