From eda2c093b517f799b9f6a79ffc371d8b2f7d2431 Mon Sep 17 00:00:00 2001 From: Alaric Senat Date: Wed, 5 Jul 2023 16:51:19 +0200 Subject: [PATCH] sout: switch to `vlc_frame_t` for the API Frames are suppposed to pass into the stream output instead of blocks as we'll likely want to use ancillaries. --- include/vlc_sout.h | 5 +++-- src/stream_output/stream_output.c | 11 ++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/vlc_sout.h b/include/vlc_sout.h index e27140898a..502c5ab57d 100644 --- a/include/vlc_sout.h +++ b/include/vlc_sout.h @@ -174,10 +174,11 @@ enum sout_stream_query_e { SOUT_STREAM_IS_SYNCHRONOUS, /* arg1=bool *, can fail (assume false) */ }; +typedef struct vlc_frame_t vlc_frame_t; struct sout_stream_operations { void *(*add)(sout_stream_t *, const es_format_t *); void (*del)(sout_stream_t *, void *); - int (*send)(sout_stream_t *, void *, block_t *); + int (*send)(sout_stream_t *, void *, vlc_frame_t *); int (*control)( sout_stream_t *, int, va_list ); void (*flush)( sout_stream_t *, void *); void (*set_pcr)(sout_stream_t *, vlc_tick_t); @@ -201,10 +202,10 @@ VLC_API sout_stream_t *sout_StreamChainNew(vlc_object_t *parent, VLC_API void *sout_StreamIdAdd(sout_stream_t *s, const es_format_t *fmt); VLC_API void sout_StreamIdDel(sout_stream_t *s, void *id); -VLC_API int sout_StreamIdSend( sout_stream_t *s, void *id, block_t *b); VLC_API void sout_StreamFlush(sout_stream_t *s, void *id); VLC_API void sout_StreamSetPCR(sout_stream_t *s, vlc_tick_t pcr); VLC_API int sout_StreamControlVa(sout_stream_t *s, int i_query, va_list args); +VLC_API int sout_StreamIdSend(sout_stream_t *, void *id, vlc_frame_t *); VLC_API vlc_clock_main_t *sout_ClockMainCreate(sout_stream_t *) VLC_USED; VLC_API void sout_ClockMainDelete(vlc_clock_main_t *); diff --git a/src/stream_output/stream_output.c b/src/stream_output/stream_output.c index 2d7476e689..4b763f26aa 100644 --- a/src/stream_output/stream_output.c +++ b/src/stream_output/stream_output.c @@ -46,6 +46,7 @@ #include #include +#include #include #include @@ -198,14 +199,14 @@ void sout_InputFlush( sout_stream_t *p_sout, *****************************************************************************/ int sout_InputSendBuffer( sout_stream_t *p_sout, sout_packetizer_input_t *p_input, - block_t *p_buffer ) + vlc_frame_t *frame ) { if( p_input->b_flushed ) { - p_buffer->i_flags |= BLOCK_FLAG_DISCONTINUITY; + frame->i_flags |= VLC_FRAME_FLAG_DISCONTINUITY; p_input->b_flushed = false; } - return sout_StreamIdSend( p_sout, p_input->id, p_buffer ); + return sout_StreamIdSend( p_sout, p_input->id, frame ); } #undef sout_AccessOutNew @@ -711,12 +712,12 @@ void sout_StreamIdDel(sout_stream_t *s, void *id) sout_StreamUnlock(s); } -int sout_StreamIdSend(sout_stream_t *s, void *id, block_t *b) +int sout_StreamIdSend(sout_stream_t *s, void *id, vlc_frame_t *f) { int val; sout_StreamLock(s); - val = s->ops->send(s, id, b); + val = s->ops->send(s, id, f); sout_StreamUnlock(s); return val; }