[vlc-devel] [RFC 1/2] player info

Romain Vimont rom1v at videolabs.io
Mon Jul 1 10:03:12 CEST 2019


On Mon, Jul 01, 2019 at 08:55:36AM +0200, Steve Lhomme wrote:
> On 2019-06-26 11:15, Romain Vimont wrote:
> >   /*****************************************************************************
> >    * Event for resource.c
> >    *****************************************************************************/
> > diff --git a/src/input/input.c b/src/input/input.c
> > index 6ab5233653..cc0c32276e 100644
> > --- a/src/input/input.c
> > +++ b/src/input/input.c
> > @@ -1278,6 +1278,11 @@ static int Init( input_thread_t * p_input )
> >           goto error;
> >       priv->master = master;
> > +    struct vlc_input_event_info info;
> > +    info.type = VLC_INPUT_EVENT_INFO_INPUT_SOURCE_ADDED;
> > +    info.source = master;
> > +    input_SendEventInfo(p_input, &info);
> > +
> >       InitTitle( p_input, false );
> >       /* Load master infos */
> > @@ -1780,7 +1785,14 @@ static void ControlInsertDemuxFilter( input_thread_t* p_input, const char* psz_d
> >       input_source_t *p_inputSource = input_priv(p_input)->master;
> >       demux_t *p_filtered_demux = demux_FilterChainNew( p_inputSource->p_demux, psz_demux_chain );
> >       if ( p_filtered_demux != NULL )
> > +    {
> >           p_inputSource->p_demux = p_filtered_demux;
> > +
> > +        struct vlc_input_event_info info;
> > +        info.type = VLC_INPUT_EVENT_INFO_INPUT_SOURCE_DEMUX_UPDATED;
> > +        info.source = p_inputSource;
> 
> p_inputSource is guaranteed to be valid when the event is processed ? (same
> question for the other events).

Yes, the event is handled by the player synchronously (input_SendEvent()
just executes the callback, it does not post the event to an event
queue).

> 
> > +        input_SendEventInfo(p_input, &info);
> > +    }
> >       else if ( psz_demux_chain != NULL )
> >           msg_Dbg(p_input, "Failed to create demux filter %s", psz_demux_chain);
> >   }
> > @@ -3249,6 +3261,11 @@ static int input_SlaveSourceAdd( input_thread_t *p_input,
> >       es_out_Control( priv->p_es_out_display, ES_OUT_SET_ES_BY_ID,
> >                       priv->i_last_es_id, false );
> > +    struct vlc_input_event_info info;
> > +    info.type = VLC_INPUT_EVENT_INFO_INPUT_SOURCE_ADDED;
> > +    info.source = p_source;
> > +    input_SendEventInfo(p_input, &info);
> > +
> >       return VLC_SUCCESS;
> >   }
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list