[vlc-devel] [RFC PATCH 5/9] input: change InputDemuxNew arguments

Thomas Guillem thomas at gllm.fr
Thu Feb 13 11:41:58 CET 2020


Small reminder with worst case scenario, the bluray chaining 4 es_out:

demux -> bluray_es_out -> ts_filter_es_out -> timeshift_es_out -> display_es_out
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  this is the demux module specific part.

What  this patch is doing is inserting an other es_out between the demux and the timeshift for every slaves:

demux -> (demux_specific_es_out) -> es_out_slave -> timeshift_es_out -> display_es_out.
(demux_specific_es_out is optional)

The es_out_slave is created with an es_out_ctx_t. This is a refcounted opaque struct containing the necessary information to identify a source (for now it's just a string, but it's very easy to change it). Is is created from input/input.c.

This es_out_ctx_t will be passed to parent es_outs via the add() and control() callbacks.

Since timeshift can be threaded and the es_out_slave can be destroyed at anytime, es_out_ctx_t is refcounted.

The goal is to get this es_out_ctx_t landing on the final es_out and use it when we need to create/search a program or an ES track.

What is confusing in this patch is:
in->p_slave_es_out = input_EsOutContextNew( priv->p_es_out, ctx );

input_EsOutContextNew() create an es_out_t (es_out_slave in my example) holding a es_out_ctx_t.

This in->p_slave_es_out will be passed to the demux directly.

I hope that it is more understanble now. Anyway, I need to add more comment and/or make this patch more readable.


On Wed, Feb 12, 2020, at 17:53, Rémi Denis-Courmont wrote:
> Le keskiviikkona 12. helmikuuta 2020, 16.43.23 EET Thomas Guillem a écrit :
> > In order to be able to specify a es_out_t per input_source_t.
> 
> While I fully agree that this is required - and not only to disambiguate ES 
> identifiers - I am very confused about the roles of es_out and es_out_ctx at 
> this point in the patch series ??
> 
> > ---
> >  src/input/input.c | 9 +++++----
> >  1 file changed, 5 insertions(+), 4 deletions(-)
> > 
> > diff --git a/src/input/input.c b/src/input/input.c
> > index 7ba4f0d9f97..9aee8b09d8e 100644
> > --- a/src/input/input.c
> > +++ b/src/input/input.c
> > @@ -2425,7 +2425,7 @@ InputStreamHandleAnchor( input_thread_t *p_input,
> > input_source_t *source, return VLC_SUCCESS;
> >  }
> > 
> > -static demux_t *InputDemuxNew( input_thread_t *p_input,
> > +static demux_t *InputDemuxNew( input_thread_t *p_input, es_out_t *p_es_out,
> > input_source_t *p_source, const char *url, const char *psz_demux, const
> > char *psz_anchor ) {
> > @@ -2433,7 +2433,7 @@ static demux_t *InputDemuxNew( input_thread_t
> > *p_input, vlc_object_t *obj = VLC_OBJECT(p_input);
> > 
> >      /* create the underlying access stream */
> > -    stream_t *p_stream = stream_AccessNew( obj, p_input, priv->p_es_out,
> > +    stream_t *p_stream = stream_AccessNew( obj, p_input, p_es_out,
> >                                             priv->b_preparsing, url );
> >      if( p_stream == NULL )
> >          return NULL;
> > @@ -2467,7 +2467,7 @@ static demux_t *InputDemuxNew( input_thread_t
> > *p_input,
> > 
> >      /* create a regular demux with the access stream created */
> >      demux_t *demux = demux_NewAdvanced( obj, p_input, psz_demux, url,
> > p_stream, -                                        priv->p_es_out,
> > priv->b_preparsing ); +                                        p_es_out,
> > priv->b_preparsing ); if( demux != NULL )
> >          return demux;
> > 
> > @@ -2574,7 +2574,8 @@ static input_source_t *InputSourceNew( input_thread_t
> > *p_input, char *url;
> >      if( likely(asprintf( &url, "%s://%s", psz_access, psz_path ) >= 0) )
> >      {
> > -        in->p_demux = InputDemuxNew( p_input, in, url, psz_demux,
> > psz_anchor ); +        in->p_demux = InputDemuxNew( p_input,
> > priv->p_es_out, in, url, +                                     psz_demux,
> > psz_anchor );
> >          free( url );
> >      }
> >      else
> 
> 
> -- 
> Реми Дёни-Курмон
> http://www.remlab.net/
> 
> 
> 
>


More information about the vlc-devel mailing list