[vlc-devel] [PATCH 1/9] vlc_stream: Allow fetching the underlying item type

Hugo Beauzée-Luyssen hugo at beauzee.fr
Thu Sep 17 11:29:37 CEST 2020


On Wed, Sep 16, 2020, at 5:34 PM, Rémi Denis-Courmont wrote:
> Le keskiviikkona 16. syyskuuta 2020, 16.54.09 EEST Hugo Beauzée-Luyssen a 
> écrit :
> > ---
> >  include/vlc_demux.h  | 6 ++++++
> >  include/vlc_stream.h | 1 +
> >  src/input/input.c    | 8 ++++++++
> >  3 files changed, 15 insertions(+)
> > 
> > diff --git a/include/vlc_demux.h b/include/vlc_demux.h
> > index 5d67813fc0..af7f766c1d 100644
> > --- a/include/vlc_demux.h
> > +++ b/include/vlc_demux.h
> > @@ -119,6 +119,12 @@ enum demux_query_e
> >       * arg1=double *quality, arg2=double *strength */
> >      DEMUX_GET_SIGNAL = 0x107,
> > 
> > +    /** Retrieves the demuxed content type
> > +     * Can fail if the control is not implemented
> > +     *
> > +     * arg1= enum input_item_type_e* */
> > +    DEMUX_GET_TYPE = 0x109,
> > +
> >      /** Sets the paused or playing/resumed state.
> >       *
> >       * Streams are initially in playing state. The control always specifies
> > a diff --git a/include/vlc_stream.h b/include/vlc_stream.h
> > index bc6c0d30b7..85055a8a35 100644
> > --- a/include/vlc_stream.h
> > +++ b/include/vlc_stream.h
> > @@ -168,6 +168,7 @@ enum stream_query_e
> >      STREAM_GET_CONTENT_TYPE,    /**< arg1= char **         res=can fail */
> >      STREAM_GET_SIGNAL,      /**< arg1=double *pf_quality, arg2=double
> > *pf_strength   res=can fail */ STREAM_GET_TAGS,        /**< arg1=const
> > block_t ** res=can fail */ +    STREAM_GET_TYPE,        /**<
> > arg1=input_item_type_e*    res=can fail */
> > 
> >      STREAM_SET_PAUSE_STATE = 0x200, /**< arg1= bool        res=can fail */
> >      STREAM_SET_TITLE,       /**< arg1= int          res=can fail */
> > diff --git a/src/input/input.c b/src/input/input.c
> > index 28de738f8a..c31b1d3060 100644
> > --- a/src/input/input.c
> > +++ b/src/input/input.c
> > @@ -2791,6 +2791,14 @@ static int InputSourceInit( input_source_t *in,
> > input_thread_t *p_input, if( demux_Control( in->p_demux, DEMUX_GET_FPS,
> > &in->f_fps ) ) in->f_fps = 0.f;
> > 
> > +    enum input_item_type_e type;
> 
> I'm not sure if an enum is safe w.r.t. ABI and aliasing, as opposed to int.
> 

Indeed, good point! New version sent.
Thanks,

-- 
  Hugo Beauzée-Luyssen
  hugo at beauzee.fr


More information about the vlc-devel mailing list