diff options
| author | Hans Verkuil <hverkuil@xs4all.nl> | 2010-03-14 08:57:30 -0400 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-19 11:58:45 -0400 |
| commit | 32cd527f59f8aa8549067a2c5f989b736f7da79a (patch) | |
| tree | 2552bd0efffc5bd21011e1f139c1b7a5c9a27390 /include/media | |
| parent | b26d6e21788864039bfb24840a668f2cb0848930 (diff) | |
V4L/DVB: v4l: move vbi-specific video ops to a new vbi ops struct
Only a relatively small number of video receivers and transmitters actually
support VBI. So start moving the vbi specific ops to an ops struct of their
own.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'include/media')
| -rw-r--r-- | include/media/v4l2-subdev.h | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 09758789be02..433cd2b06267 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h | |||
| @@ -184,28 +184,6 @@ struct v4l2_subdev_audio_ops { | |||
| 184 | }; | 184 | }; |
| 185 | 185 | ||
| 186 | /* | 186 | /* |
| 187 | decode_vbi_line: video decoders that support sliced VBI need to implement | ||
| 188 | this ioctl. Field p of the v4l2_sliced_vbi_line struct is set to the | ||
| 189 | start of the VBI data that was generated by the decoder. The driver | ||
| 190 | then parses the sliced VBI data and sets the other fields in the | ||
| 191 | struct accordingly. The pointer p is updated to point to the start of | ||
| 192 | the payload which can be copied verbatim into the data field of the | ||
| 193 | v4l2_sliced_vbi_data struct. If no valid VBI data was found, then the | ||
| 194 | type field is set to 0 on return. | ||
| 195 | |||
| 196 | s_vbi_data: used to generate VBI signals on a video signal. | ||
| 197 | v4l2_sliced_vbi_data is filled with the data packets that should be | ||
| 198 | output. Note that if you set the line field to 0, then that VBI signal | ||
| 199 | is disabled. If no valid VBI data was found, then the type field is | ||
| 200 | set to 0 on return. | ||
| 201 | |||
| 202 | g_vbi_data: used to obtain the sliced VBI packet from a readback register. | ||
| 203 | Not all video decoders support this. If no data is available because | ||
| 204 | the readback register contains invalid or erroneous data -EIO is | ||
| 205 | returned. Note that you must fill in the 'id' member and the 'field' | ||
| 206 | member (to determine whether CC data from the first or second field | ||
| 207 | should be obtained). | ||
| 208 | |||
| 209 | s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by | 187 | s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by |
| 210 | video input devices. | 188 | video input devices. |
| 211 | 189 | ||
| @@ -243,10 +221,6 @@ struct v4l2_subdev_audio_ops { | |||
| 243 | struct v4l2_subdev_video_ops { | 221 | struct v4l2_subdev_video_ops { |
| 244 | int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); | 222 | int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); |
| 245 | int (*s_crystal_freq)(struct v4l2_subdev *sd, u32 freq, u32 flags); | 223 | int (*s_crystal_freq)(struct v4l2_subdev *sd, u32 freq, u32 flags); |
| 246 | int (*decode_vbi_line)(struct v4l2_subdev *sd, struct v4l2_decode_vbi_line *vbi_line); | ||
| 247 | int (*s_vbi_data)(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_data *vbi_data); | ||
| 248 | int (*g_vbi_data)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_data *vbi_data); | ||
| 249 | int (*g_sliced_vbi_cap)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_cap *cap); | ||
| 250 | int (*s_std_output)(struct v4l2_subdev *sd, v4l2_std_id std); | 224 | int (*s_std_output)(struct v4l2_subdev *sd, v4l2_std_id std); |
| 251 | int (*querystd)(struct v4l2_subdev *sd, v4l2_std_id *std); | 225 | int (*querystd)(struct v4l2_subdev *sd, v4l2_std_id *std); |
| 252 | int (*g_input_status)(struct v4l2_subdev *sd, u32 *status); | 226 | int (*g_input_status)(struct v4l2_subdev *sd, u32 *status); |
| @@ -280,6 +254,36 @@ struct v4l2_subdev_video_ops { | |||
| 280 | struct v4l2_mbus_framefmt *fmt); | 254 | struct v4l2_mbus_framefmt *fmt); |
| 281 | }; | 255 | }; |
| 282 | 256 | ||
| 257 | /* | ||
| 258 | decode_vbi_line: video decoders that support sliced VBI need to implement | ||
| 259 | this ioctl. Field p of the v4l2_sliced_vbi_line struct is set to the | ||
| 260 | start of the VBI data that was generated by the decoder. The driver | ||
| 261 | then parses the sliced VBI data and sets the other fields in the | ||
| 262 | struct accordingly. The pointer p is updated to point to the start of | ||
| 263 | the payload which can be copied verbatim into the data field of the | ||
| 264 | v4l2_sliced_vbi_data struct. If no valid VBI data was found, then the | ||
| 265 | type field is set to 0 on return. | ||
| 266 | |||
| 267 | s_vbi_data: used to generate VBI signals on a video signal. | ||
| 268 | v4l2_sliced_vbi_data is filled with the data packets that should be | ||
| 269 | output. Note that if you set the line field to 0, then that VBI signal | ||
| 270 | is disabled. If no valid VBI data was found, then the type field is | ||
| 271 | set to 0 on return. | ||
| 272 | |||
| 273 | g_vbi_data: used to obtain the sliced VBI packet from a readback register. | ||
| 274 | Not all video decoders support this. If no data is available because | ||
| 275 | the readback register contains invalid or erroneous data -EIO is | ||
| 276 | returned. Note that you must fill in the 'id' member and the 'field' | ||
| 277 | member (to determine whether CC data from the first or second field | ||
| 278 | should be obtained). | ||
| 279 | */ | ||
| 280 | struct v4l2_subdev_vbi_ops { | ||
| 281 | int (*decode_vbi_line)(struct v4l2_subdev *sd, struct v4l2_decode_vbi_line *vbi_line); | ||
| 282 | int (*s_vbi_data)(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_data *vbi_data); | ||
| 283 | int (*g_vbi_data)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_data *vbi_data); | ||
| 284 | int (*g_sliced_vbi_cap)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_cap *cap); | ||
| 285 | }; | ||
| 286 | |||
| 283 | /** | 287 | /** |
| 284 | * struct v4l2_subdev_sensor_ops - v4l2-subdev sensor operations | 288 | * struct v4l2_subdev_sensor_ops - v4l2-subdev sensor operations |
| 285 | * @g_skip_top_lines: number of lines at the top of the image to be skipped. | 289 | * @g_skip_top_lines: number of lines at the top of the image to be skipped. |
| @@ -379,6 +383,7 @@ struct v4l2_subdev_ops { | |||
| 379 | const struct v4l2_subdev_tuner_ops *tuner; | 383 | const struct v4l2_subdev_tuner_ops *tuner; |
| 380 | const struct v4l2_subdev_audio_ops *audio; | 384 | const struct v4l2_subdev_audio_ops *audio; |
| 381 | const struct v4l2_subdev_video_ops *video; | 385 | const struct v4l2_subdev_video_ops *video; |
| 386 | const struct v4l2_subdev_vbi_ops *vbi; | ||
| 382 | const struct v4l2_subdev_ir_ops *ir; | 387 | const struct v4l2_subdev_ir_ops *ir; |
| 383 | const struct v4l2_subdev_sensor_ops *sensor; | 388 | const struct v4l2_subdev_sensor_ops *sensor; |
| 384 | }; | 389 | }; |
