V4L/DVB (5307): Add support for the cx23415 MPEG decoding features.
authorHans Verkuil <hverkuil@xs4all.nl>
Fri, 27 Apr 2007 15:31:09 +0000 (12:31 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 27 Apr 2007 18:43:28 +0000 (15:43 -0300)
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>
drivers/media/dvb/ttpci/av7110_av.c
drivers/media/dvb/ttpci/av7110_hw.h
include/linux/dvb/audio.h
include/linux/dvb/version.h
include/linux/dvb/video.h

index e719af807685f50324a46d260ed12284c5531d7f..654c9e919e045469bf3dabda34db62e45cb5ac3d 100644 (file)
@@ -1009,7 +1009,7 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file,
                if (av7110->videostate.stream_source == VIDEO_SOURCE_MEMORY)
                        ret = av7110_av_stop(av7110, RP_VIDEO);
                else
-                       ret = vidcom(av7110, VIDEO_CMD_STOP,
+                       ret = vidcom(av7110, AV_VIDEO_CMD_STOP,
                               av7110->videostate.video_blank ? 0 : 1);
                if (!ret)
                        av7110->trickmode = TRICK_NONE;
@@ -1019,7 +1019,7 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file,
                av7110->trickmode = TRICK_NONE;
                if (av7110->videostate.play_state == VIDEO_FREEZED) {
                        av7110->videostate.play_state = VIDEO_PLAYING;
-                       ret = vidcom(av7110, VIDEO_CMD_PLAY, 0);
+                       ret = vidcom(av7110, AV_VIDEO_CMD_PLAY, 0);
                        if (ret)
                                break;
                }
@@ -1034,7 +1034,7 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file,
                        ret = av7110_av_start_play(av7110, RP_VIDEO);
                }
                if (!ret)
-                       ret = vidcom(av7110, VIDEO_CMD_PLAY, 0);
+                       ret = vidcom(av7110, AV_VIDEO_CMD_PLAY, 0);
                if (!ret)
                        av7110->videostate.play_state = VIDEO_PLAYING;
                break;
@@ -1044,7 +1044,7 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file,
                if (av7110->playing & RP_VIDEO)
                        ret = av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Pause, 0);
                else
-                       ret = vidcom(av7110, VIDEO_CMD_FREEZE, 1);
+                       ret = vidcom(av7110, AV_VIDEO_CMD_FREEZE, 1);
                if (!ret)
                        av7110->trickmode = TRICK_FREEZE;
                break;
@@ -1053,7 +1053,7 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file,
                if (av7110->playing & RP_VIDEO)
                        ret = av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Continue, 0);
                if (!ret)
-                       ret = vidcom(av7110, VIDEO_CMD_PLAY, 0);
+                       ret = vidcom(av7110, AV_VIDEO_CMD_PLAY, 0);
                if (!ret) {
                        av7110->videostate.play_state = VIDEO_PLAYING;
                        av7110->trickmode = TRICK_NONE;
@@ -1136,7 +1136,7 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file,
                        ret = av7110_fw_cmd(av7110, COMTYPE_REC_PLAY,
                                            __Scan_I, 2, AV_PES, 0);
                else
-                       ret = vidcom(av7110, VIDEO_CMD_FFWD, arg);
+                       ret = vidcom(av7110, AV_VIDEO_CMD_FFWD, arg);
                if (!ret) {
                        av7110->trickmode = TRICK_FAST;
                        av7110->videostate.play_state = VIDEO_PLAYING;
@@ -1147,13 +1147,13 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file,
                if (av7110->playing&RP_VIDEO) {
                        ret = av7110_fw_cmd(av7110, COMTYPE_REC_PLAY, __Slow, 2, 0, 0);
                        if (!ret)
-                               ret = vidcom(av7110, VIDEO_CMD_SLOW, arg);
+                               ret = vidcom(av7110, AV_VIDEO_CMD_SLOW, arg);
                } else {
-                       ret = vidcom(av7110, VIDEO_CMD_PLAY, 0);
+                       ret = vidcom(av7110, AV_VIDEO_CMD_PLAY, 0);
                        if (!ret)
-                               ret = vidcom(av7110, VIDEO_CMD_STOP, 0);
+                               ret = vidcom(av7110, AV_VIDEO_CMD_STOP, 0);
                        if (!ret)
-                               ret = vidcom(av7110, VIDEO_CMD_SLOW, arg);
+                               ret = vidcom(av7110, AV_VIDEO_CMD_SLOW, arg);
                }
                if (!ret) {
                        av7110->trickmode = TRICK_SLOW;
@@ -1182,10 +1182,10 @@ static int dvb_video_ioctl(struct inode *inode, struct file *file,
                                ret = av7110_fw_cmd(av7110, COMTYPE_REC_PLAY,
                                                    __Slow, 2, 0, 0);
                                if (!ret)
-                                       ret = vidcom(av7110, VIDEO_CMD_SLOW, arg);
+                                       ret = vidcom(av7110, AV_VIDEO_CMD_SLOW, arg);
                        }
                        if (av7110->trickmode == TRICK_FREEZE)
-                               ret = vidcom(av7110, VIDEO_CMD_STOP, 1);
+                               ret = vidcom(av7110, AV_VIDEO_CMD_STOP, 1);
                }
                break;
 
index 4e173c67fbb25e43efaf4425a7ed95c2edfed249..673d9b3f064c86391f886fadbdff203480cb5cf9 100644 (file)
@@ -216,11 +216,11 @@ enum av7110_command_type {
 #define VID_CENTRE_CUT_PREF    0x05    /* PanScan with zero vector */
 
 /* MPEG video decoder commands */
-#define VIDEO_CMD_STOP         0x000e
-#define VIDEO_CMD_PLAY         0x000d
-#define VIDEO_CMD_FREEZE       0x0102
-#define VIDEO_CMD_FFWD         0x0016
-#define VIDEO_CMD_SLOW         0x0022
+#define AV_VIDEO_CMD_STOP      0x000e
+#define AV_VIDEO_CMD_PLAY      0x000d
+#define AV_VIDEO_CMD_FREEZE    0x0102
+#define AV_VIDEO_CMD_FFWD      0x0016
+#define AV_VIDEO_CMD_SLOW      0x0022
 
 /* MPEG audio decoder commands */
 #define AUDIO_CMD_MUTE         0x0001
index 0874a67c6b922de7e5ab9e81ac2fda4907a96135..89412e18f571ec20c0b980628798033e7aa7b648 100644 (file)
@@ -47,7 +47,9 @@ typedef enum {
 typedef enum {
        AUDIO_STEREO,
        AUDIO_MONO_LEFT,
-       AUDIO_MONO_RIGHT
+       AUDIO_MONO_RIGHT,
+       AUDIO_MONO,
+       AUDIO_STEREO_SWAPPED
 } audio_channel_select_t;
 
 
@@ -133,5 +135,6 @@ typedef uint16_t audio_attributes_t;
  * extracted by the PES parser.
  */
 #define AUDIO_GET_PTS              _IOR('o', 19, __u64)
+#define AUDIO_BILINGUAL_CHANNEL_SELECT _IO('o', 20)
 
 #endif /* _DVBAUDIO_H_ */
index 6183c9c4849e2de4e5bb779f29ce5f69e5c09adf..126e0c26cb091aa6a647dd0f8359662d143d3ed8 100644 (file)
@@ -24,6 +24,6 @@
 #define _DVBVERSION_H_
 
 #define DVB_API_VERSION 3
-#define DVB_API_VERSION_MINOR 1
+#define DVB_API_VERSION_MINOR 2
 
 #endif /*_DVBVERSION_H_*/
index faebfda397ff2086918050f9ea0cdeb14081f9dc..a96da40c50f51834f269f11fc9bebc64ef2585c1 100644 (file)
@@ -80,10 +80,53 @@ typedef enum {
 } video_play_state_t;
 
 
+/* Decoder commands */
+#define VIDEO_CMD_PLAY        (0)
+#define VIDEO_CMD_STOP        (1)
+#define VIDEO_CMD_FREEZE      (2)
+#define VIDEO_CMD_CONTINUE    (3)
+
+/* Flags for VIDEO_CMD_FREEZE */
+#define VIDEO_CMD_FREEZE_TO_BLACK      (1 << 0)
+
+/* Flags for VIDEO_CMD_STOP */
+#define VIDEO_CMD_STOP_TO_BLACK        (1 << 0)
+#define VIDEO_CMD_STOP_IMMEDIATELY             (1 << 1)
+
+/* Play input formats: */
+/* The decoder has no special format requirements */
+#define VIDEO_PLAY_FMT_NONE         (0)
+/* The decoder requires full GOPs */
+#define VIDEO_PLAY_FMT_GOP          (1)
+
+/* The structure must be zeroed before use by the application
+   This ensures it can be extended safely in the future. */
+struct video_command {
+       __u32 cmd;
+       __u32 flags;
+       union {
+               struct {
+                       __u64 pts;
+               } stop;
+
+               struct {
+                       __u32 speed;
+                       __u32 format;
+               } play;
+
+               struct {
+                       __u32 data[16];
+               } raw;
+       };
+};
+
+
 struct video_event {
        int32_t type;
 #define VIDEO_EVENT_SIZE_CHANGED       1
 #define VIDEO_EVENT_FRAME_RATE_CHANGED 2
+#define VIDEO_EVENT_DECODER_STOPPED    3
+#define VIDEO_EVENT_VSYNC              4
        time_t timestamp;
        union {
                video_size_t size;
@@ -213,4 +256,10 @@ typedef uint16_t video_attributes_t;
  */
 #define VIDEO_GET_PTS              _IOR('o', 57, __u64)
 
+/* Read the number of displayed frames since the decoder was started */
+#define VIDEO_GET_FRAME_COUNT             _IOR('o', 58, __u64)
+
+#define VIDEO_COMMAND             _IOWR('o', 59, struct video_command)
+#define VIDEO_TRY_COMMAND         _IOWR('o', 60, struct video_command)
+
 #endif /*_DVBVIDEO_H_*/