diff options
author | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2005-09-13 04:25:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-13 11:22:32 -0400 |
commit | 9db455064dfa1c2250e5eda7386c80bc77764e30 (patch) | |
tree | 07d27598296085a2c30a3317fb78a77130141dcc /include | |
parent | 939bb7ef901b2537aa5b4cd819f9c1b25c6a5710 (diff) |
[PATCH] v4l: experimental Sliced VBI API support
Adds all defines, ioctls and structs needed for the sliced VBI API
VBI = Vertical Blank Interval.
It is related with the way TV signals work. It sends a line, then, it has a
retrace time to allow the tube to move electrons to the beginning of the next
line. This was the main reason at the beginning of analog B&W TV.
There is a lot of bandwidth lost on VBI. So, lots of TV systems use it to
send other information such as Closed Captions and Teletext. Also,
broadcasters uses this as a channel to exchange information from the content
producer to their subsidiaries at each city.
There's already a raw VBI interface on V4L2 api, used for Closed Captions and
Teletext. The decoding is doing at userlevel space and it is mostly for
analog TV signals, non encoded.
Encoded signals (MPEG, for example), may need also to transmit other
information (like, for example, display aspect, i.e. 4x3, widescreen...).
Sliced VBI interface is a method to allow the video stream to transmit this
kind of information.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/videodev2.h | 109 |
1 files changed, 87 insertions, 22 deletions
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index f623a33b9abe..89a055761bed 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -60,12 +60,17 @@ enum v4l2_field { | |||
60 | (field) == V4L2_FIELD_SEQ_BT) | 60 | (field) == V4L2_FIELD_SEQ_BT) |
61 | 61 | ||
62 | enum v4l2_buf_type { | 62 | enum v4l2_buf_type { |
63 | V4L2_BUF_TYPE_VIDEO_CAPTURE = 1, | 63 | V4L2_BUF_TYPE_VIDEO_CAPTURE = 1, |
64 | V4L2_BUF_TYPE_VIDEO_OUTPUT = 2, | 64 | V4L2_BUF_TYPE_VIDEO_OUTPUT = 2, |
65 | V4L2_BUF_TYPE_VIDEO_OVERLAY = 3, | 65 | V4L2_BUF_TYPE_VIDEO_OVERLAY = 3, |
66 | V4L2_BUF_TYPE_VBI_CAPTURE = 4, | 66 | V4L2_BUF_TYPE_VBI_CAPTURE = 4, |
67 | V4L2_BUF_TYPE_VBI_OUTPUT = 5, | 67 | V4L2_BUF_TYPE_VBI_OUTPUT = 5, |
68 | V4L2_BUF_TYPE_PRIVATE = 0x80, | 68 | #if 1 |
69 | /* Experimental Sliced VBI */ | ||
70 | V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6, | ||
71 | V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7, | ||
72 | #endif | ||
73 | V4L2_BUF_TYPE_PRIVATE = 0x80, | ||
69 | }; | 74 | }; |
70 | 75 | ||
71 | enum v4l2_ctrl_type { | 76 | enum v4l2_ctrl_type { |
@@ -149,20 +154,24 @@ struct v4l2_capability | |||
149 | }; | 154 | }; |
150 | 155 | ||
151 | /* Values for 'capabilities' field */ | 156 | /* Values for 'capabilities' field */ |
152 | #define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */ | 157 | #define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */ |
153 | #define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */ | 158 | #define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */ |
154 | #define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */ | 159 | #define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */ |
155 | #define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a VBI capture device */ | 160 | #define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */ |
156 | #define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a VBI output device */ | 161 | #define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */ |
157 | #define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ | 162 | #if 1 |
163 | #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 */ | ||
165 | #endif | ||
166 | #define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ | ||
158 | 167 | ||
159 | #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ | 168 | #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ |
160 | #define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ | 169 | #define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ |
161 | #define V4L2_CAP_RADIO 0x00040000 /* is a radio device */ | 170 | #define V4L2_CAP_RADIO 0x00040000 /* is a radio device */ |
162 | 171 | ||
163 | #define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */ | 172 | #define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */ |
164 | #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ | 173 | #define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */ |
165 | #define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */ | 174 | #define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */ |
166 | 175 | ||
167 | /* | 176 | /* |
168 | * V I D E O I M A G E F O R M A T | 177 | * V I D E O I M A G E F O R M A T |
@@ -809,6 +818,8 @@ struct v4l2_audioout | |||
809 | * Data services API by Michael Schimek | 818 | * Data services API by Michael Schimek |
810 | */ | 819 | */ |
811 | 820 | ||
821 | /* Raw VBI */ | ||
822 | |||
812 | struct v4l2_vbi_format | 823 | struct v4l2_vbi_format |
813 | { | 824 | { |
814 | __u32 sampling_rate; /* in 1 Hz */ | 825 | __u32 sampling_rate; /* in 1 Hz */ |
@@ -825,6 +836,54 @@ struct v4l2_vbi_format | |||
825 | #define V4L2_VBI_UNSYNC (1<< 0) | 836 | #define V4L2_VBI_UNSYNC (1<< 0) |
826 | #define V4L2_VBI_INTERLACED (1<< 1) | 837 | #define V4L2_VBI_INTERLACED (1<< 1) |
827 | 838 | ||
839 | #if 1 | ||
840 | /* Sliced VBI | ||
841 | * | ||
842 | * This implements is a proposal V4L2 API to allow SLICED VBI | ||
843 | * required for some hardware encoders. It should change without | ||
844 | * notice in the definitive implementation. | ||
845 | */ | ||
846 | |||
847 | struct v4l2_sliced_vbi_format | ||
848 | { | ||
849 | __u16 service_set; | ||
850 | /* 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 | ||
852 | (equals frame lines 313-336 for 625 line video | ||
853 | standards, 263-286 for 525 line standards) */ | ||
854 | __u16 service_lines[2][24]; | ||
855 | __u32 io_size; | ||
856 | __u32 reserved[2]; /* must be zero */ | ||
857 | }; | ||
858 | |||
859 | #define V4L2_SLICED_TELETEXT_B (0x0001) | ||
860 | #define V4L2_SLICED_VPS (0x0400) | ||
861 | #define V4L2_SLICED_CAPTION_525 (0x1000) | ||
862 | #define V4L2_SLICED_WSS_625 (0x4000) | ||
863 | |||
864 | #define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525) | ||
865 | #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625) | ||
866 | |||
867 | struct v4l2_sliced_vbi_cap | ||
868 | { | ||
869 | __u16 service_set; | ||
870 | /* 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 | ||
872 | (equals frame lines 313-336 for 625 line video | ||
873 | standards, 263-286 for 525 line standards) */ | ||
874 | __u16 service_lines[2][24]; | ||
875 | __u32 reserved[4]; /* must be 0 */ | ||
876 | }; | ||
877 | |||
878 | struct v4l2_sliced_vbi_data | ||
879 | { | ||
880 | __u32 id; | ||
881 | __u32 field; /* 0: first field, 1: second field */ | ||
882 | __u32 line; /* 1-23 */ | ||
883 | __u32 reserved; /* must be 0 */ | ||
884 | __u8 data[48]; | ||
885 | }; | ||
886 | #endif | ||
828 | 887 | ||
829 | /* | 888 | /* |
830 | * A G G R E G A T E S T R U C T U R E S | 889 | * A G G R E G A T E S T R U C T U R E S |
@@ -837,10 +896,13 @@ struct v4l2_format | |||
837 | enum v4l2_buf_type type; | 896 | enum v4l2_buf_type type; |
838 | union | 897 | union |
839 | { | 898 | { |
840 | struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE | 899 | struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE |
841 | struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY | 900 | struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY |
842 | struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE | 901 | struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE |
843 | __u8 raw_data[200]; // user-defined | 902 | #if 1 |
903 | struct v4l2_sliced_vbi_format sliced; // V4L2_BUF_TYPE_SLICED_VBI_CAPTURE | ||
904 | #endif | ||
905 | __u8 raw_data[200]; // user-defined | ||
844 | } fmt; | 906 | } fmt; |
845 | }; | 907 | }; |
846 | 908 | ||
@@ -916,6 +978,9 @@ struct v4l2_streamparm | |||
916 | #define VIDIOC_ENUMAUDOUT _IOWR ('V', 66, struct v4l2_audioout) | 978 | #define VIDIOC_ENUMAUDOUT _IOWR ('V', 66, struct v4l2_audioout) |
917 | #define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority) | 979 | #define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority) |
918 | #define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority) | 980 | #define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority) |
981 | #if 1 | ||
982 | #define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap) | ||
983 | #endif | ||
919 | 984 | ||
920 | /* for compatibility, will go away some day */ | 985 | /* for compatibility, will go away some day */ |
921 | #define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int) | 986 | #define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int) |