aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/videodev2.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/videodev2.h')
-rw-r--r--include/linux/videodev2.h208
1 files changed, 148 insertions, 60 deletions
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 89a055761bed..1cded681eb6d 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -15,16 +15,99 @@
15 */ 15 */
16#ifdef __KERNEL__ 16#ifdef __KERNEL__
17#include <linux/time.h> /* need struct timeval */ 17#include <linux/time.h> /* need struct timeval */
18#include <linux/poll.h>
19#include <linux/device.h>
18#endif 20#endif
19#include <linux/compiler.h> /* need __user */ 21#include <linux/compiler.h> /* need __user */
20 22
23
24#define OBSOLETE_OWNER 1 /* It will be removed for 2.6.15 */
25#define HAVE_V4L2 1
26
27/*
28 * Common stuff for both V4L1 and V4L2
29 * Moved from videodev.h
30 */
31
32#define VIDEO_MAX_FRAME 32
33
34#define VID_TYPE_CAPTURE 1 /* Can capture */
35#define VID_TYPE_TUNER 2 /* Can tune */
36#define VID_TYPE_TELETEXT 4 /* Does teletext */
37#define VID_TYPE_OVERLAY 8 /* Overlay onto frame buffer */
38#define VID_TYPE_CHROMAKEY 16 /* Overlay by chromakey */
39#define VID_TYPE_CLIPPING 32 /* Can clip */
40#define VID_TYPE_FRAMERAM 64 /* Uses the frame buffer memory */
41#define VID_TYPE_SCALES 128 /* Scalable */
42#define VID_TYPE_MONOCHROME 256 /* Monochrome only */
43#define VID_TYPE_SUBCAPTURE 512 /* Can capture subareas of the image */
44#define VID_TYPE_MPEG_DECODER 1024 /* Can decode MPEG streams */
45#define VID_TYPE_MPEG_ENCODER 2048 /* Can encode MPEG streams */
46#define VID_TYPE_MJPEG_DECODER 4096 /* Can decode MJPEG streams */
47#define VID_TYPE_MJPEG_ENCODER 8192 /* Can encode MJPEG streams */
48
49#ifdef __KERNEL__
50
51#define VFL_TYPE_GRABBER 0
52#define VFL_TYPE_VBI 1
53#define VFL_TYPE_RADIO 2
54#define VFL_TYPE_VTX 3
55
56struct video_device
57{
58 /* device info */
59 struct device *dev;
60 char name[32];
61 int type; /* v4l1 */
62 int type2; /* v4l2 */
63 int hardware;
64 int minor;
65
66 /* device ops + callbacks */
67 struct file_operations *fops;
68 void (*release)(struct video_device *vfd);
69
70
71#if OBSOLETE_OWNER /* to be removed in 2.6.15 */
72 /* obsolete -- fops->owner is used instead */
73 struct module *owner;
74 /* dev->driver_data will be used instead some day.
75 * Use the video_{get|set}_drvdata() helper functions,
76 * so the switch over will be transparent for you.
77 * Or use {pci|usb}_{get|set}_drvdata() directly. */
78 void *priv;
79#endif
80
81 /* for videodev.c intenal usage -- please don't touch */
82 int users; /* video_exclusive_{open|close} ... */
83 struct semaphore lock; /* ... helper function uses these */
84 char devfs_name[64]; /* devfs */
85 struct class_device class_dev; /* sysfs */
86};
87
88#define VIDEO_MAJOR 81
89
90extern int video_register_device(struct video_device *, int type, int nr);
91extern void video_unregister_device(struct video_device *);
92extern int video_usercopy(struct inode *inode, struct file *file,
93 unsigned int cmd, unsigned long arg,
94 int (*func)(struct inode *inode, struct file *file,
95 unsigned int cmd, void *arg));
96
97/* helper functions to alloc / release struct video_device, the
98 later can be used for video_device->release() */
99struct video_device *video_device_alloc(void);
100void video_device_release(struct video_device *vfd);
101
102#endif
103
21/* 104/*
22 * M I S C E L L A N E O U S 105 * M I S C E L L A N E O U S
23 */ 106 */
24 107
25/* Four-character-code (FOURCC) */ 108/* Four-character-code (FOURCC) */
26#define v4l2_fourcc(a,b,c,d)\ 109#define v4l2_fourcc(a,b,c,d)\
27 (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24)) 110 (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))
28 111
29/* 112/*
30 * E N U M S 113 * E N U M S
@@ -154,20 +237,20 @@ struct v4l2_capability
154}; 237};
155 238
156/* Values for 'capabilities' field */ 239/* Values for 'capabilities' field */
157#define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */ 240#define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */
158#define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */ 241#define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */
159#define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */ 242#define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */
160#define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */ 243#define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */
161#define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */ 244#define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */
162#if 1 245#if 1
163#define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */ 246#define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */
164#define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */ 247#define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */
165#endif 248#endif
166#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ 249#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */
167 250
168#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ 251#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */
169#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ 252#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */
170#define V4L2_CAP_RADIO 0x00040000 /* is a radio device */ 253#define V4L2_CAP_RADIO 0x00040000 /* is a radio device */
171 254
172#define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */ 255#define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */
173#define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ 256#define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */
@@ -179,13 +262,13 @@ struct v4l2_capability
179 262
180struct v4l2_pix_format 263struct v4l2_pix_format
181{ 264{
182 __u32 width; 265 __u32 width;
183 __u32 height; 266 __u32 height;
184 __u32 pixelformat; 267 __u32 pixelformat;
185 enum v4l2_field field; 268 enum v4l2_field field;
186 __u32 bytesperline; /* for padding, zero if unused */ 269 __u32 bytesperline; /* for padding, zero if unused */
187 __u32 sizeimage; 270 __u32 sizeimage;
188 enum v4l2_colorspace colorspace; 271 enum v4l2_colorspace colorspace;
189 __u32 priv; /* private data, depends on pixelformat */ 272 __u32 priv; /* private data, depends on pixelformat */
190}; 273};
191 274
@@ -238,12 +321,12 @@ struct v4l2_pix_format
238 */ 321 */
239struct v4l2_fmtdesc 322struct v4l2_fmtdesc
240{ 323{
241 __u32 index; /* Format number */ 324 __u32 index; /* Format number */
242 enum v4l2_buf_type type; /* buffer type */ 325 enum v4l2_buf_type type; /* buffer type */
243 __u32 flags; 326 __u32 flags;
244 __u8 description[32]; /* Description string */ 327 __u8 description[32]; /* Description string */
245 __u32 pixelformat; /* Format fourcc */ 328 __u32 pixelformat; /* Format fourcc */
246 __u32 reserved[4]; 329 __u32 reserved[4];
247}; 330};
248 331
249#define V4L2_FMT_FLAG_COMPRESSED 0x0001 332#define V4L2_FMT_FLAG_COMPRESSED 0x0001
@@ -393,7 +476,7 @@ struct v4l2_jpegcompression
393#define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */ 476#define V4L2_JPEG_MARKER_DRI (1<<5) /* Define Restart Interval */
394#define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */ 477#define V4L2_JPEG_MARKER_COM (1<<6) /* Comment segment */
395#define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will 478#define V4L2_JPEG_MARKER_APP (1<<7) /* App segment, driver will
396 * allways use APP0 */ 479 * allways use APP0 */
397}; 480};
398 481
399 482
@@ -402,10 +485,10 @@ struct v4l2_jpegcompression
402 */ 485 */
403struct v4l2_requestbuffers 486struct v4l2_requestbuffers
404{ 487{
405 __u32 count; 488 __u32 count;
406 enum v4l2_buf_type type; 489 enum v4l2_buf_type type;
407 enum v4l2_memory memory; 490 enum v4l2_memory memory;
408 __u32 reserved[2]; 491 __u32 reserved[2];
409}; 492};
410 493
411struct v4l2_buffer 494struct v4l2_buffer
@@ -511,9 +594,9 @@ struct v4l2_outputparm
511 594
512struct v4l2_cropcap { 595struct v4l2_cropcap {
513 enum v4l2_buf_type type; 596 enum v4l2_buf_type type;
514 struct v4l2_rect bounds; 597 struct v4l2_rect bounds;
515 struct v4l2_rect defrect; 598 struct v4l2_rect defrect;
516 struct v4l2_fract pixelaspect; 599 struct v4l2_fract pixelaspect;
517}; 600};
518 601
519struct v4l2_crop { 602struct v4l2_crop {
@@ -544,6 +627,7 @@ typedef __u64 v4l2_std_id;
544 627
545#define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000) 628#define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000)
546#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000) 629#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000)
630#define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000)
547 631
548#define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000) 632#define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000)
549#define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000) 633#define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
@@ -552,6 +636,7 @@ typedef __u64 v4l2_std_id;
552#define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000) 636#define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000)
553#define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000) 637#define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000)
554#define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000) 638#define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000)
639#define V4L2_STD_SECAM_LC ((v4l2_std_id)0x00800000)
555 640
556/* ATSC/HDTV */ 641/* ATSC/HDTV */
557#define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000) 642#define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000)
@@ -581,13 +666,14 @@ typedef __u64 v4l2_std_id;
581 666
582#define V4L2_STD_525_60 (V4L2_STD_PAL_M |\ 667#define V4L2_STD_525_60 (V4L2_STD_PAL_M |\
583 V4L2_STD_PAL_60 |\ 668 V4L2_STD_PAL_60 |\
584 V4L2_STD_NTSC) 669 V4L2_STD_NTSC |\
670 V4L2_STD_NTSC_443)
585#define V4L2_STD_625_50 (V4L2_STD_PAL |\ 671#define V4L2_STD_625_50 (V4L2_STD_PAL |\
586 V4L2_STD_PAL_N |\ 672 V4L2_STD_PAL_N |\
587 V4L2_STD_PAL_Nc |\ 673 V4L2_STD_PAL_Nc |\
588 V4L2_STD_SECAM) 674 V4L2_STD_SECAM)
589#define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |\ 675#define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |\
590 V4L2_STD_ATSC_16_VSB) 676 V4L2_STD_ATSC_16_VSB)
591 677
592#define V4L2_STD_UNKNOWN 0 678#define V4L2_STD_UNKNOWN 0
593#define V4L2_STD_ALL (V4L2_STD_525_60 |\ 679#define V4L2_STD_ALL (V4L2_STD_525_60 |\
@@ -595,7 +681,7 @@ typedef __u64 v4l2_std_id;
595 681
596struct v4l2_standard 682struct v4l2_standard
597{ 683{
598 __u32 index; 684 __u32 index;
599 v4l2_std_id id; 685 v4l2_std_id id;
600 __u8 name[24]; 686 __u8 name[24];
601 struct v4l2_fract frameperiod; /* Frames, not fields */ 687 struct v4l2_fract frameperiod; /* Frames, not fields */
@@ -610,9 +696,9 @@ struct v4l2_standard
610struct v4l2_input 696struct v4l2_input
611{ 697{
612 __u32 index; /* Which input */ 698 __u32 index; /* Which input */
613 __u8 name[32]; /* Label */ 699 __u8 name[32]; /* Label */
614 __u32 type; /* Type of input */ 700 __u32 type; /* Type of input */
615 __u32 audioset; /* Associated audios (bitfield) */ 701 __u32 audioset; /* Associated audios (bitfield) */
616 __u32 tuner; /* Associated tuner */ 702 __u32 tuner; /* Associated tuner */
617 v4l2_std_id std; 703 v4l2_std_id std;
618 __u32 status; 704 __u32 status;
@@ -647,9 +733,9 @@ struct v4l2_input
647struct v4l2_output 733struct v4l2_output
648{ 734{
649 __u32 index; /* Which output */ 735 __u32 index; /* Which output */
650 __u8 name[32]; /* Label */ 736 __u8 name[32]; /* Label */
651 __u32 type; /* Type of output */ 737 __u32 type; /* Type of output */
652 __u32 audioset; /* Associated audios (bitfield) */ 738 __u32 audioset; /* Associated audios (bitfield) */
653 __u32 modulator; /* Associated modulator */ 739 __u32 modulator; /* Associated modulator */
654 v4l2_std_id std; 740 v4l2_std_id std;
655 __u32 reserved[4]; 741 __u32 reserved[4];
@@ -671,12 +757,12 @@ struct v4l2_control
671/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ 757/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
672struct v4l2_queryctrl 758struct v4l2_queryctrl
673{ 759{
674 __u32 id; 760 __u32 id;
675 enum v4l2_ctrl_type type; 761 enum v4l2_ctrl_type type;
676 __u8 name[32]; /* Whatever */ 762 __u8 name[32]; /* Whatever */
677 __s32 minimum; /* Note signedness */ 763 __s32 minimum; /* Note signedness */
678 __s32 maximum; 764 __s32 maximum;
679 __s32 step; 765 __s32 step;
680 __s32 default_value; 766 __s32 default_value;
681 __u32 flags; 767 __u32 flags;
682 __u32 reserved[2]; 768 __u32 reserved[2];
@@ -779,10 +865,10 @@ struct v4l2_modulator
779 865
780struct v4l2_frequency 866struct v4l2_frequency
781{ 867{
782 __u32 tuner; 868 __u32 tuner;
783 enum v4l2_tuner_type type; 869 enum v4l2_tuner_type type;
784 __u32 frequency; 870 __u32 frequency;
785 __u32 reserved[8]; 871 __u32 reserved[8];
786}; 872};
787 873
788/* 874/*
@@ -802,6 +888,7 @@ struct v4l2_audio
802 888
803/* Flags for the 'mode' field */ 889/* Flags for the 'mode' field */
804#define V4L2_AUDMODE_AVL 0x00001 890#define V4L2_AUDMODE_AVL 0x00001
891#define V4L2_AUDMODE_32BITS 0x00002
805 892
806struct v4l2_audioout 893struct v4l2_audioout
807{ 894{
@@ -846,14 +933,14 @@ struct v4l2_vbi_format
846 933
847struct v4l2_sliced_vbi_format 934struct v4l2_sliced_vbi_format
848{ 935{
849 __u16 service_set; 936 __u16 service_set;
850 /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field 937 /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
851 service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field 938 service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
852 (equals frame lines 313-336 for 625 line video 939 (equals frame lines 313-336 for 625 line video
853 standards, 263-286 for 525 line standards) */ 940 standards, 263-286 for 525 line standards) */
854 __u16 service_lines[2][24]; 941 __u16 service_lines[2][24];
855 __u32 io_size; 942 __u32 io_size;
856 __u32 reserved[2]; /* must be zero */ 943 __u32 reserved[2]; /* must be zero */
857}; 944};
858 945
859#define V4L2_SLICED_TELETEXT_B (0x0001) 946#define V4L2_SLICED_TELETEXT_B (0x0001)
@@ -866,22 +953,22 @@ struct v4l2_sliced_vbi_format
866 953
867struct v4l2_sliced_vbi_cap 954struct v4l2_sliced_vbi_cap
868{ 955{
869 __u16 service_set; 956 __u16 service_set;
870 /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field 957 /* service_lines[0][...] specifies lines 0-23 (1-23 used) of the first field
871 service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field 958 service_lines[1][...] specifies lines 0-23 (1-23 used) of the second field
872 (equals frame lines 313-336 for 625 line video 959 (equals frame lines 313-336 for 625 line video
873 standards, 263-286 for 525 line standards) */ 960 standards, 263-286 for 525 line standards) */
874 __u16 service_lines[2][24]; 961 __u16 service_lines[2][24];
875 __u32 reserved[4]; /* must be 0 */ 962 __u32 reserved[4]; /* must be 0 */
876}; 963};
877 964
878struct v4l2_sliced_vbi_data 965struct v4l2_sliced_vbi_data
879{ 966{
880 __u32 id; 967 __u32 id;
881 __u32 field; /* 0: first field, 1: second field */ 968 __u32 field; /* 0: first field, 1: second field */
882 __u32 line; /* 1-23 */ 969 __u32 line; /* 1-23 */
883 __u32 reserved; /* must be 0 */ 970 __u32 reserved; /* must be 0 */
884 __u8 data[48]; 971 __u8 data[48];
885}; 972};
886#endif 973#endif
887 974
@@ -896,9 +983,9 @@ struct v4l2_format
896 enum v4l2_buf_type type; 983 enum v4l2_buf_type type;
897 union 984 union
898 { 985 {
899 struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE 986 struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE
900 struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY 987 struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY
901 struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE 988 struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE
902#if 1 989#if 1
903 struct v4l2_sliced_vbi_format sliced; // V4L2_BUF_TYPE_SLICED_VBI_CAPTURE 990 struct v4l2_sliced_vbi_format sliced; // V4L2_BUF_TYPE_SLICED_VBI_CAPTURE
904#endif 991#endif
@@ -981,6 +1068,7 @@ struct v4l2_streamparm
981#if 1 1068#if 1
982#define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap) 1069#define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap)
983#endif 1070#endif
1071#define VIDIOC_LOG_STATUS _IO ('V', 70)
984 1072
985/* for compatibility, will go away some day */ 1073/* for compatibility, will go away some day */
986#define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int) 1074#define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int)