[vlc-devel] [PATCH] libvlc: libvlc_MediaSubItemTreeAdded event type added
Sergey Radionov
rsatom at gmail.com
Mon Sep 2 14:50:52 CEST 2013
Hi Rafaël.
2013/9/2 Rafaël Carré <funman at videolan.org>
> Hello Sergey,
>
> This looks good, I guess Jakob probably missed libvlc when he added this
> event.
>
> I am curious, how can this be used ? I guess you're going to use it in
> activex/npapi plugins.
>
Yes, I want to is it in web plugin for http redirect handling:
https://code.google.com/p/fbvlc/issues/detail?id=35
Btw, if this patch will be accepted, it will be good if it will backported
to vlc 2.1 (if it possible).
>
> Le 01/09/2013 16:00, Sergey Radionov a écrit :
> > ---
> > include/vlc/libvlc_events.h | 5 +++++
> > lib/event.c | 1 +
> > lib/media.c | 26 ++++++++++++++++++++++++++
> > 3 files changed, 32 insertions(+)
> >
> > diff --git a/include/vlc/libvlc_events.h b/include/vlc/libvlc_events.h
> > index 2cfedbf..ae1a94b 100644
> > --- a/include/vlc/libvlc_events.h
> > +++ b/include/vlc/libvlc_events.h
> > @@ -52,6 +52,7 @@ enum libvlc_event_e {
> > libvlc_MediaParsedChanged,
> > libvlc_MediaFreed,
> > libvlc_MediaStateChanged,
> > + libvlc_MediaSubItemTreeAdded,
> >
> > libvlc_MediaPlayerMediaChanged=0x100,
> > libvlc_MediaPlayerNothingSpecial,
> > @@ -137,6 +138,10 @@ typedef struct libvlc_event_t
> > {
> > libvlc_state_t new_state;
> > } media_state_changed;
> > + struct
> > + {
> > + libvlc_media_t * item;
> > + } media_subitemtree_added;
> >
> > /* media instance */
> > struct
> > diff --git a/lib/event.c b/lib/event.c
> > index c71a48a..87f7d12 100644
> > --- a/lib/event.c
> > +++ b/lib/event.c
> > @@ -259,6 +259,7 @@ static const event_name_t event_list[] = {
> > DEF(MediaParsedChanged)
> > DEF(MediaFreed)
> > DEF(MediaStateChanged)
> > + DEF(MediaSubItemTreeAdded)
> >
> > DEF(MediaPlayerMediaChanged)
> > DEF(MediaPlayerNothingSpecial)
> > diff --git a/lib/media.c b/lib/media.c
> > index 593f5c6..7acfb69 100644
> > --- a/lib/media.c
> > +++ b/lib/media.c
> > @@ -120,6 +120,23 @@ static void input_item_subitem_added( const
> vlc_event_t *p_event,
> > }
> >
> >
> /**************************************************************************
> > + * input_item_subitemtree_added (Private) (vlc event Callback)
> > +
> **************************************************************************/
> > +static void input_item_subitemtree_added( const vlc_event_t * p_event,
> > + void * user_data )
> > +{
> > + libvlc_media_t * p_md = user_data;
> > + libvlc_event_t event;
> > +
> > + /* Construct the event */
> > + event.type = libvlc_MediaSubItemTreeAdded;
> > + event.u.media_subitemtree_added.item = p_md;
> > +
> > + /* Send the event */
> > + libvlc_event_send( p_md->p_event_manager, &event );
> > +}
> > +
> >
> +/**************************************************************************
> > * input_item_meta_changed (Private) (vlc event Callback)
> >
> **************************************************************************/
> > static void input_item_meta_changed( const vlc_event_t *p_event,
> > @@ -201,6 +218,10 @@ static void install_input_item_observer(
> libvlc_media_t *p_md )
> > vlc_InputItemPreparsedChanged,
> > input_item_preparsed_changed,
> > p_md );
> > + vlc_event_attach( &p_md->p_input_item->event_manager,
> > + vlc_InputItemSubItemTreeAdded,
> > + input_item_subitemtree_added,
> > + p_md );
> > }
> >
> >
> /**************************************************************************
> > @@ -224,6 +245,10 @@ static void uninstall_input_item_observer(
> libvlc_media_t *p_md )
> > vlc_InputItemPreparsedChanged,
> > input_item_preparsed_changed,
> > p_md );
> > + vlc_event_detach( &p_md->p_input_item->event_manager,
> > + vlc_InputItemSubItemTreeAdded,
> > + input_item_subitemtree_added,
> > + p_md );
> > }
> >
> >
> /**************************************************************************
> > @@ -277,6 +302,7 @@ libvlc_media_t * libvlc_media_new_from_input_item(
> > libvlc_event_manager_register_event_type(em,
> libvlc_MediaDurationChanged);
> > libvlc_event_manager_register_event_type(em,
> libvlc_MediaStateChanged);
> > libvlc_event_manager_register_event_type(em,
> libvlc_MediaParsedChanged);
> > + libvlc_event_manager_register_event_type(em,
> libvlc_MediaSubItemTreeAdded);
> >
> > vlc_gc_incref( p_md->p_input_item );
> >
> >
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20130902/1031e625/attachment.html>
More information about the vlc-devel
mailing list