[vlc-devel] [PATCH 3/4] stream_output: handle Flushing via sout_MuxFlush()
Steve Lhomme
robux4 at videolabs.io
Fri Dec 18 12:51:40 CET 2015
---
include/vlc_sout.h | 1 +
modules/stream_out/standard.c | 7 +++++++
src/libvlccore.sym | 1 +
src/stream_output/stream_output.c | 6 ++++++
4 files changed, 15 insertions(+)
diff --git a/include/vlc_sout.h b/include/vlc_sout.h
index 1d013b3..0e497b0 100644
--- a/include/vlc_sout.h
+++ b/include/vlc_sout.h
@@ -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 int sout_MuxFlush( sout_mux_t *, sout_input_t * );
static inline int sout_MuxControl( sout_mux_t *p_mux, int i_query, ... )
{
diff --git a/modules/stream_out/standard.c b/modules/stream_out/standard.c
index c86adf9..81a2e5f 100644
--- a/modules/stream_out/standard.c
+++ b/modules/stream_out/standard.c
@@ -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 int Flush( sout_stream_t *p_stream, sout_stream_id_sys_t *id )
+{
+ return 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;
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index d7971d8..3772ece 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -381,6 +381,7 @@ sout_MuxDeleteStream
sout_MuxGetStream
sout_MuxNew
sout_MuxSendBuffer
+sout_MuxFlush
sout_StreamChainDelete
sout_StreamChainNew
spu_Create
diff --git a/src/stream_output/stream_output.c b/src/stream_output/stream_output.c
index 336ace1..63d6034 100644
--- a/src/stream_output/stream_output.c
+++ b/src/stream_output/stream_output.c
@@ -562,6 +562,12 @@ int sout_MuxSendBuffer( sout_mux_t *p_mux, sout_input_t *p_input,
return p_mux->pf_mux( p_mux );
}
+int sout_MuxFlush( sout_mux_t *p_mux, sout_input_t *p_input )
+{
+ VLC_UNUSED(p_mux);
+ block_FifoEmpty( p_input->p_fifo );
+ return VLC_SUCCESS;
+}
/*****************************************************************************
* sout_MuxGetStream: find stream to be muxed
--
2.6.3
More information about the vlc-devel
mailing list