stream_output: handle Flushing via sout_MuxFlush()
authorSteve Lhomme <robux4@videolabs.io>
Fri, 18 Dec 2015 10:24:48 +0000 (11:24 +0100)
committerThomas Guillem <thomas@gllm.fr>
Tue, 22 Dec 2015 13:39:44 +0000 (14:39 +0100)
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
include/vlc_sout.h
modules/stream_out/standard.c
src/libvlccore.sym
src/stream_output/stream_output.c

index 0569e28..9523999 100644 (file)
@@ -175,6 +175,7 @@ VLC_API void sout_MuxDeleteStream( sout_mux_t *, sout_input_t * );
 VLC_API void sout_MuxDelete( sout_mux_t * );
 VLC_API int sout_MuxSendBuffer( sout_mux_t *, sout_input_t  *, block_t * );
 VLC_API int sout_MuxGetStream(sout_mux_t *, unsigned, mtime_t *);
+VLC_API void sout_MuxFlush( sout_mux_t *, sout_input_t * );
 
 static inline int sout_MuxControl( sout_mux_t *p_mux, int i_query, ... )
 {
index c86adf9..e8805ba 100644 (file)
@@ -143,6 +143,12 @@ static int Send( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
 {
     return sout_MuxSendBuffer( p_stream->p_sys->p_mux, (sout_input_t*)id, p_buffer );
 }
+
+static void Flush( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
+{
+    sout_MuxFlush( p_stream->p_sys->p_mux, (sout_input_t*)id );
+}
+
 static void create_SDP(sout_stream_t *p_stream, sout_access_out_t *p_access)
 {
     sout_stream_sys_t   *p_sys = p_stream->p_sys;
@@ -405,6 +411,7 @@ static int Open( vlc_object_t *p_this )
     p_stream->pf_add    = Add;
     p_stream->pf_del    = Del;
     p_stream->pf_send   = Send;
+    p_stream->pf_flush  = Flush;
     if( !sout_AccessOutCanControlPace( p_access ) )
         p_stream->pace_nocontrol = true;
 
index 432ff07..43b1ba0 100644 (file)
@@ -384,6 +384,7 @@ sout_MuxDeleteStream
 sout_MuxGetStream
 sout_MuxNew
 sout_MuxSendBuffer
+sout_MuxFlush
 sout_StreamChainDelete
 sout_StreamChainNew
 spu_Create
index c20f3f1..bc3c502 100644 (file)
@@ -562,6 +562,11 @@ int sout_MuxSendBuffer( sout_mux_t *p_mux, sout_input_t *p_input,
     return p_mux->pf_mux( p_mux );
 }
 
+void sout_MuxFlush( sout_mux_t *p_mux, sout_input_t *p_input )
+{
+    VLC_UNUSED(p_mux);
+    block_FifoEmpty( p_input->p_fifo );
+}
 
 /*****************************************************************************
  * sout_MuxGetStream: find stream to be muxed