]> git.sesse.net Git - vlc/commitdiff
Introduce DEMUX_CAN_CONTROL_RATE and DEMUX_SET_RATE (for future rtsp trickplay)
authorLaurent Aimar <fenrir@videolan.org>
Tue, 11 Dec 2007 19:16:37 +0000 (19:16 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Tue, 11 Dec 2007 19:16:37 +0000 (19:16 +0000)
DEMUX_CAN_PAUSE and DEMUX_CAN_CONTROL_PACE can now fail.

include/vlc_demux.h
src/input/input.c

index b098fc36a8bd56b926d23621d8f99e71387f3aa7..45b3c8765cec115a6da23574b1bcbed52a545702 100644 (file)
@@ -124,10 +124,22 @@ enum demux_query_e
     DEMUX_GET_ATTACHMENTS,      /* arg1=input_attachment_t***, int* res=can fail */
 
     /* II. Specific access_demux queries */
-    DEMUX_CAN_PAUSE,            /* arg1= vlc_bool_t*    cannot fail */
-    DEMUX_CAN_CONTROL_PACE,     /* arg1= vlc_bool_t*    cannot fail */
+    DEMUX_CAN_PAUSE,            /* arg1= vlc_bool_t*    can fail (assume false)*/
+    DEMUX_SET_PAUSE_STATE,      /* arg1= vlc_bool_t     can fail */
+
     DEMUX_GET_PTS_DELAY,        /* arg1= int64_t*       cannot fail */
-    DEMUX_SET_PAUSE_STATE       /* arg1= vlc_bool_t     can fail */
+
+    /* DEMUX_CAN_CONTROL_PACE returns true (*pb_pace) if we can read the
+     * data at our pace */
+    DEMUX_CAN_CONTROL_PACE,     /* arg1= vlc_bool_t*pb_pace    can fail (assume false) */
+
+    /* DEMUX_CAN_CONTROL_RATE is called only if DEMUX_CAN_CONTROL_PACE has returned false.
+     * *pb_rate should be true when the rate can be changed (using DEMUX_SET_RATE)
+     * *pb_ts_rescale should be true when the timestamps (pts/dts/pcr) have to be rescaled */
+    DEMUX_CAN_CONTROL_RATE,     /* arg1= vlc_bool_t*pb_rate arg2= vlc_bool_t*pb_ts_rescale  can fail(assume false) */
+    /* DEMUX_SET_RATE is called only if DEMUX_CAN_CONTROL_RATE has returned true.
+     * It should return the value really used in *pi_rate */
+    DEMUX_SET_RATE,             /* arg1= int*pi_rate                                        can fail */
 };
 
 VLC_EXPORT( int,       demux2_vaControlHelper, ( stream_t *, int64_t i_start, int64_t i_end, int i_bitrate, int i_align, int i_query, va_list args ) );
index e81234c01f0a119db4aa52323d74a3e5436bef74..ba81e79c599d5d98d11101f93929b05df78d7760 100644 (file)
@@ -2219,10 +2219,12 @@ static int InputSourceInit( input_thread_t *p_input,
             in->i_title = 0;
             in->title   = NULL;
         }
-        demux2_Control( in->p_demux, DEMUX_CAN_CONTROL_PACE,
-                        &in->b_can_pace_control );
-        demux2_Control( in->p_demux, DEMUX_CAN_PAUSE,
-                        &in->b_can_pause );
+        if( demux2_Control( in->p_demux, DEMUX_CAN_CONTROL_PACE,
+                            &in->b_can_pace_control ) )
+            in->b_can_pace_control = VLC_FALSE;
+        if( demux2_Control( in->p_demux, DEMUX_CAN_PAUSE,
+                            &in->b_can_pause ) )
+            in->b_can_pause = VLC_FALSE;
 
         /* FIXME todo
         demux2_Control( in->p_demux, DEMUX_CAN_SEEK,