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;
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;
}
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;
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;
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;
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;
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;
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;
} 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;
*/
#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_*/