diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2007-04-27 11:31:09 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-04-27 14:43:28 -0400 |
commit | 2435be11ae1afb64ac7dfb25e10b6e3037ab0522 (patch) | |
tree | 14bd2585f0e2b909d4ae47556e972d876b2edabb | |
parent | 3434eb7e14d9587ee56f3462bcfa5726b62dadb9 (diff) |
V4L/DVB (5307): Add support for the cx23415 MPEG decoding features.
The cx23415 adds some extra features that this DVB decoding API did
not support. This API has been expanded to support the required
features. Both source and binary backwards compatibility is kept
intact by these changes. So existing applications are not affected.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Ralph Metzler <rjkm@metzlerbros.de>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/dvb/ttpci/av7110_av.c | 24 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/av7110_hw.h | 10 | ||||
-rw-r--r-- | include/linux/dvb/audio.h | 5 | ||||
-rw-r--r-- | include/linux/dvb/version.h | 2 | ||||
-rw-r--r-- | include/linux/dvb/video.h | 49 |
5 files changed, 71 insertions, 19 deletions
diff --git a/drivers/media/dvb/ttpci/av7110_av.c b/drivers/media/dvb/ttpci/av7110_av.c index e719af807685..654c9e919e04 100644 --- a/drivers/media/dvb/ttpci/av7110_av.c +++ b/drivers/media/dvb/ttpci/av7110_av.c | |||
@@ -1009,7 +1009,7 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file, | |||
1009 | if (av7110->videostate.stream_source == VIDEO_SOURCE_MEMORY) | 1009 | if (av7110->videostate.stream_source == VIDEO_SOURCE_MEMORY) |
1010 | ret = av7110_av_stop(av7110, RP_VIDEO); | 1010 | ret = av7110_av_stop(av7110, RP_VIDEO); |
1011 | else | 1011 | else |
1012 | ret = vidcom(av7110, VIDEO_CMD_STOP, | 1012 | ret = vidcom(av7110, AV_VIDEO_CMD_STOP, |
1013 | av7110->videostate.video_blank ? 0 : 1); | 1013 | av7110->videostate.video_blank ? 0 : 1); |
1014 | if (!ret) | 1014 | if (!ret) |
1015 | av7110->trickmode = TRICK_NONE; | 1015 | av7110->trickmode = TRICK_NONE; |
@@ -1019,7 +1019,7 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file, | |||
1019 | av7110->trickmode = TRICK_NONE; | 1019 | av7110->trickmode = TRICK_NONE; |
1020 | if (av7110->videostate.play_state == VIDEO_FREEZED) { | 1020 | if (av7110->videostate.play_state == VIDEO_FREEZED) { |
1021 | av7110->videostate.play_state = VIDEO_PLAYING; | 1021 | av7110->videostate.play_state = VIDEO_PLAYING; |
1022 | ret = vidcom(av7110, VIDEO_CMD_PLAY, 0); | 1022 | ret = vidcom(av7110, AV_VIDEO_CMD_PLAY, 0); |
1023 | if (ret) | 1023 | if (ret) |
1024 | break; | 1024 | break; |
1025 | } | 1025 | } |
@@ -1034,7 +1034,7 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file, | |||
1034 | ret = av7110_av_start_play(av7110, RP_VIDEO); | 1034 | ret = av7110_av_start_play(av7110, RP_VIDEO); |
1035 | } | 1035 | } |
1036 | if (!ret) | 1036 | if (!ret) |
1037 | ret = vidcom(av7110, VIDEO_CMD_PLAY, 0); | 1037 | ret = vidcom(av7110, AV_VIDEO_CMD_PLAY, 0); |
1038 | if (!ret) | 1038 | if (!ret) |
1039 | av7110->videostate.play_state = VIDEO_PLAYING; | 1039 | av7110->videostate.play_state = VIDEO_PLAYING; |
1040 | break; | 1040 | break; |
@@ -1044,7 +1044,7 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file, | |||
1044 | if (av7110->playing & RP_VIDEO) | 1044 | if (av7110->playing & RP_VIDEO) |
1045 | ret = av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Pause, 0); | 1045 | ret = av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Pause, 0); |
1046 | else | 1046 | else |
1047 | ret = vidcom(av7110, VIDEO_CMD_FREEZE, 1); | 1047 | ret = vidcom(av7110, AV_VIDEO_CMD_FREEZE, 1); |
1048 | if (!ret) | 1048 | if (!ret) |
1049 | av7110->trickmode = TRICK_FREEZE; | 1049 | av7110->trickmode = TRICK_FREEZE; |
1050 | break; | 1050 | break; |
@@ -1053,7 +1053,7 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file, | |||
1053 | if (av7110->playing & RP_VIDEO) | 1053 | if (av7110->playing & RP_VIDEO) |
1054 | ret = av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Continue, 0); | 1054 | ret = av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Continue, 0); |
1055 | if (!ret) | 1055 | if (!ret) |
1056 | ret = vidcom(av7110, VIDEO_CMD_PLAY, 0); | 1056 | ret = vidcom(av7110, AV_VIDEO_CMD_PLAY, 0); |
1057 | if (!ret) { | 1057 | if (!ret) { |
1058 | av7110->videostate.play_state = VIDEO_PLAYING; | 1058 | av7110->videostate.play_state = VIDEO_PLAYING; |
1059 | av7110->trickmode = TRICK_NONE; | 1059 | av7110->trickmode = TRICK_NONE; |
@@ -1136,7 +1136,7 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file, | |||
1136 | ret = av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, | 1136 | ret = av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, |
1137 | __Scan_I, 2, AV_PES, 0); | 1137 | __Scan_I, 2, AV_PES, 0); |
1138 | else | 1138 | else |
1139 | ret = vidcom(av7110, VIDEO_CMD_FFWD, arg); | 1139 | ret = vidcom(av7110, AV_VIDEO_CMD_FFWD, arg); |
1140 | if (!ret) { | 1140 | if (!ret) { |
1141 | av7110->trickmode = TRICK_FAST; | 1141 | av7110->trickmode = TRICK_FAST; |
1142 | av7110->videostate.play_state = VIDEO_PLAYING; | 1142 | av7110->videostate.play_state = VIDEO_PLAYING; |
@@ -1147,13 +1147,13 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file, | |||
1147 | if (av7110->playing&RP_VIDEO) { | 1147 | if (av7110->playing&RP_VIDEO) { |
1148 | ret = av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Slow, 2, 0, 0); | 1148 | ret = av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Slow, 2, 0, 0); |
1149 | if (!ret) | 1149 | if (!ret) |
1150 | ret = vidcom(av7110, VIDEO_CMD_SLOW, arg); | 1150 | ret = vidcom(av7110, AV_VIDEO_CMD_SLOW, arg); |
1151 | } else { | 1151 | } else { |
1152 | ret = vidcom(av7110, VIDEO_CMD_PLAY, 0); | 1152 | ret = vidcom(av7110, AV_VIDEO_CMD_PLAY, 0); |
1153 | if (!ret) | 1153 | if (!ret) |
1154 | ret = vidcom(av7110, VIDEO_CMD_STOP, 0); | 1154 | ret = vidcom(av7110, AV_VIDEO_CMD_STOP, 0); |
1155 | if (!ret) | 1155 | if (!ret) |
1156 | ret = vidcom(av7110, VIDEO_CMD_SLOW, arg); | 1156 | ret = vidcom(av7110, AV_VIDEO_CMD_SLOW, arg); |
1157 | } | 1157 | } |
1158 | if (!ret) { | 1158 | if (!ret) { |
1159 | av7110->trickmode = TRICK_SLOW; | 1159 | av7110->trickmode = TRICK_SLOW; |
@@ -1182,10 +1182,10 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file, | |||
1182 | ret = av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, | 1182 | ret = av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, |
1183 | __Slow, 2, 0, 0); | 1183 | __Slow, 2, 0, 0); |
1184 | if (!ret) | 1184 | if (!ret) |
1185 | ret = vidcom(av7110, VIDEO_CMD_SLOW, arg); | 1185 | ret = vidcom(av7110, AV_VIDEO_CMD_SLOW, arg); |
1186 | } | 1186 | } |
1187 | if (av7110->trickmode == TRICK_FREEZE) | 1187 | if (av7110->trickmode == TRICK_FREEZE) |
1188 | ret = vidcom(av7110, VIDEO_CMD_STOP, 1); | 1188 | ret = vidcom(av7110, AV_VIDEO_CMD_STOP, 1); |
1189 | } | 1189 | } |
1190 | break; | 1190 | break; |
1191 | 1191 | ||
diff --git a/drivers/media/dvb/ttpci/av7110_hw.h b/drivers/media/dvb/ttpci/av7110_hw.h index 4e173c67fbb2..673d9b3f064c 100644 --- a/drivers/media/dvb/ttpci/av7110_hw.h +++ b/drivers/media/dvb/ttpci/av7110_hw.h | |||
@@ -216,11 +216,11 @@ enum av7110_command_type { | |||
216 | #define VID_CENTRE_CUT_PREF 0x05 /* PanScan with zero vector */ | 216 | #define VID_CENTRE_CUT_PREF 0x05 /* PanScan with zero vector */ |
217 | 217 | ||
218 | /* MPEG video decoder commands */ | 218 | /* MPEG video decoder commands */ |
219 | #define VIDEO_CMD_STOP 0x000e | 219 | #define AV_VIDEO_CMD_STOP 0x000e |
220 | #define VIDEO_CMD_PLAY 0x000d | 220 | #define AV_VIDEO_CMD_PLAY 0x000d |
221 | #define VIDEO_CMD_FREEZE 0x0102 | 221 | #define AV_VIDEO_CMD_FREEZE 0x0102 |
222 | #define VIDEO_CMD_FFWD 0x0016 | 222 | #define AV_VIDEO_CMD_FFWD 0x0016 |
223 | #define VIDEO_CMD_SLOW 0x0022 | 223 | #define AV_VIDEO_CMD_SLOW 0x0022 |
224 | 224 | ||
225 | /* MPEG audio decoder commands */ | 225 | /* MPEG audio decoder commands */ |
226 | #define AUDIO_CMD_MUTE 0x0001 | 226 | #define AUDIO_CMD_MUTE 0x0001 |
diff --git a/include/linux/dvb/audio.h b/include/linux/dvb/audio.h index 0874a67c6b92..89412e18f571 100644 --- a/include/linux/dvb/audio.h +++ b/include/linux/dvb/audio.h | |||
@@ -47,7 +47,9 @@ typedef enum { | |||
47 | typedef enum { | 47 | typedef enum { |
48 | AUDIO_STEREO, | 48 | AUDIO_STEREO, |
49 | AUDIO_MONO_LEFT, | 49 | AUDIO_MONO_LEFT, |
50 | AUDIO_MONO_RIGHT | 50 | AUDIO_MONO_RIGHT, |
51 | AUDIO_MONO, | ||
52 | AUDIO_STEREO_SWAPPED | ||
51 | } audio_channel_select_t; | 53 | } audio_channel_select_t; |
52 | 54 | ||
53 | 55 | ||
@@ -133,5 +135,6 @@ typedef uint16_t audio_attributes_t; | |||
133 | * extracted by the PES parser. | 135 | * extracted by the PES parser. |
134 | */ | 136 | */ |
135 | #define AUDIO_GET_PTS _IOR('o', 19, __u64) | 137 | #define AUDIO_GET_PTS _IOR('o', 19, __u64) |
138 | #define AUDIO_BILINGUAL_CHANNEL_SELECT _IO('o', 20) | ||
136 | 139 | ||
137 | #endif /* _DVBAUDIO_H_ */ | 140 | #endif /* _DVBAUDIO_H_ */ |
diff --git a/include/linux/dvb/version.h b/include/linux/dvb/version.h index 6183c9c4849e..126e0c26cb09 100644 --- a/include/linux/dvb/version.h +++ b/include/linux/dvb/version.h | |||
@@ -24,6 +24,6 @@ | |||
24 | #define _DVBVERSION_H_ | 24 | #define _DVBVERSION_H_ |
25 | 25 | ||
26 | #define DVB_API_VERSION 3 | 26 | #define DVB_API_VERSION 3 |
27 | #define DVB_API_VERSION_MINOR 1 | 27 | #define DVB_API_VERSION_MINOR 2 |
28 | 28 | ||
29 | #endif /*_DVBVERSION_H_*/ | 29 | #endif /*_DVBVERSION_H_*/ |
diff --git a/include/linux/dvb/video.h b/include/linux/dvb/video.h index faebfda397ff..a96da40c50f5 100644 --- a/include/linux/dvb/video.h +++ b/include/linux/dvb/video.h | |||
@@ -80,10 +80,53 @@ typedef enum { | |||
80 | } video_play_state_t; | 80 | } video_play_state_t; |
81 | 81 | ||
82 | 82 | ||
83 | /* Decoder commands */ | ||
84 | #define VIDEO_CMD_PLAY (0) | ||
85 | #define VIDEO_CMD_STOP (1) | ||
86 | #define VIDEO_CMD_FREEZE (2) | ||
87 | #define VIDEO_CMD_CONTINUE (3) | ||
88 | |||
89 | /* Flags for VIDEO_CMD_FREEZE */ | ||
90 | #define VIDEO_CMD_FREEZE_TO_BLACK (1 << 0) | ||
91 | |||
92 | /* Flags for VIDEO_CMD_STOP */ | ||
93 | #define VIDEO_CMD_STOP_TO_BLACK (1 << 0) | ||
94 | #define VIDEO_CMD_STOP_IMMEDIATELY (1 << 1) | ||
95 | |||
96 | /* Play input formats: */ | ||
97 | /* The decoder has no special format requirements */ | ||
98 | #define VIDEO_PLAY_FMT_NONE (0) | ||
99 | /* The decoder requires full GOPs */ | ||
100 | #define VIDEO_PLAY_FMT_GOP (1) | ||
101 | |||
102 | /* The structure must be zeroed before use by the application | ||
103 | This ensures it can be extended safely in the future. */ | ||
104 | struct video_command { | ||
105 | __u32 cmd; | ||
106 | __u32 flags; | ||
107 | union { | ||
108 | struct { | ||
109 | __u64 pts; | ||
110 | } stop; | ||
111 | |||
112 | struct { | ||
113 | __u32 speed; | ||
114 | __u32 format; | ||
115 | } play; | ||
116 | |||
117 | struct { | ||
118 | __u32 data[16]; | ||
119 | } raw; | ||
120 | }; | ||
121 | }; | ||
122 | |||
123 | |||
83 | struct video_event { | 124 | struct video_event { |
84 | int32_t type; | 125 | int32_t type; |
85 | #define VIDEO_EVENT_SIZE_CHANGED 1 | 126 | #define VIDEO_EVENT_SIZE_CHANGED 1 |
86 | #define VIDEO_EVENT_FRAME_RATE_CHANGED 2 | 127 | #define VIDEO_EVENT_FRAME_RATE_CHANGED 2 |
128 | #define VIDEO_EVENT_DECODER_STOPPED 3 | ||
129 | #define VIDEO_EVENT_VSYNC 4 | ||
87 | time_t timestamp; | 130 | time_t timestamp; |
88 | union { | 131 | union { |
89 | video_size_t size; | 132 | video_size_t size; |
@@ -213,4 +256,10 @@ typedef uint16_t video_attributes_t; | |||
213 | */ | 256 | */ |
214 | #define VIDEO_GET_PTS _IOR('o', 57, __u64) | 257 | #define VIDEO_GET_PTS _IOR('o', 57, __u64) |
215 | 258 | ||
259 | /* Read the number of displayed frames since the decoder was started */ | ||
260 | #define VIDEO_GET_FRAME_COUNT _IOR('o', 58, __u64) | ||
261 | |||
262 | #define VIDEO_COMMAND _IOWR('o', 59, struct video_command) | ||
263 | #define VIDEO_TRY_COMMAND _IOWR('o', 60, struct video_command) | ||
264 | |||
216 | #endif /*_DVBVIDEO_H_*/ | 265 | #endif /*_DVBVIDEO_H_*/ |