[vlc-devel] [PATCH 3/8] sout: sout_input: add SOUT_INPUT_SET_SPU_HIGHLIGHT
Rémi Denis-Courmont
remi at remlab.net
Thu Aug 30 15:41:56 CEST 2018
Can't we use the same controls for sout_input and sout_stream, and pass them
through directly (+ lock)? Otherwise it seems like a lot of useless
boilerplate.
Le mercredi 29 août 2018, 19:27:52 EEST Francois Cartegnie a écrit :
> ---
> src/stream_output/stream_output.c | 10 ++++++++++
> src/stream_output/stream_output.h | 2 +-
> 2 files changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/src/stream_output/stream_output.c
> b/src/stream_output/stream_output.c index 70a2b1ff6c..07508e1a0d 100644
> --- a/src/stream_output/stream_output.c
> +++ b/src/stream_output/stream_output.c
> @@ -217,6 +217,16 @@ bool sout_InputIsEmpty( sout_packetizer_input_t
> *p_input )
>
> static int sout_InputControlVa( sout_packetizer_input_t *p_input, int
> i_query, va_list args ) {
> + sout_instance_t *p_sout = p_input->p_sout;
> + if( i_query == SOUT_INPUT_SET_SPU_HIGHLIGHT )
> + {
> + vlc_mutex_lock( &p_sout->lock );
> + int i_ret = sout_StreamControl( p_sout->p_stream,
> + SOUT_STREAM_ID_SPU_HIGHLIGHT,
> + p_input->id, va_arg(args, void *)
> ); + vlc_mutex_unlock( &p_sout->lock );
> + return i_ret;
> + }
> return VLC_EGENERIC;
> }
>
> diff --git a/src/stream_output/stream_output.h
> b/src/stream_output/stream_output.h index 43a2e7dd54..fabb15dd75 100644
> --- a/src/stream_output/stream_output.h
> +++ b/src/stream_output/stream_output.h
> @@ -52,7 +52,7 @@ bool sout_InputIsEmpty(sout_packetizer_input_t *);
>
> enum sout_input_query_e
> {
> - SOUT_INPUT_NONE,
> + SOUT_INPUT_SET_SPU_HIGHLIGHT, /* arg1=const vlc_spu_highlight_t *, can
> fail */ };
> int sout_InputControl( sout_packetizer_input_t *, int i_query, ... );
> void sout_InputFlush( sout_packetizer_input_t * );
--
Rémi Denis-Courmont
More information about the vlc-devel
mailing list