<div dir="ltr"><div class="gmail_quote"><div>Hi <span name="Rafaël Carré" class="">Rafaël</span>.<br><br></div>2013/9/2 Rafaël Carré <span dir="ltr"><<a href="mailto:funman@videolan.org" target="_blank">funman@videolan.org</a>></span><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello Sergey,<br>
<br>
This looks good, I guess Jakob probably missed libvlc when he added this<br>
event.<br>
<br>
I am curious, how can this be used ? I guess you're going to use it in<br>
activex/npapi plugins.<br></blockquote><div><br>Yes, I want to is it in web plugin for http redirect handling: <a href="https://code.google.com/p/fbvlc/issues/detail?id=35">https://code.google.com/p/fbvlc/issues/detail?id=35</a><br>
<br>Btw, if this patch will be accepted, it will be good if it will backported to vlc 2.1 (if it possible).<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<br>
Le 01/09/2013 16:00, Sergey Radionov a écrit :<br>
<div><div class="h5">> ---<br>
>  include/vlc/libvlc_events.h |  5 +++++<br>
>  lib/event.c                 |  1 +<br>
>  lib/media.c                 | 26 ++++++++++++++++++++++++++<br>
>  3 files changed, 32 insertions(+)<br>
><br>
> diff --git a/include/vlc/libvlc_events.h b/include/vlc/libvlc_events.h<br>
> index 2cfedbf..ae1a94b 100644<br>
> --- a/include/vlc/libvlc_events.h<br>
> +++ b/include/vlc/libvlc_events.h<br>
> @@ -52,6 +52,7 @@ enum libvlc_event_e {<br>
>      libvlc_MediaParsedChanged,<br>
>      libvlc_MediaFreed,<br>
>      libvlc_MediaStateChanged,<br>
> +    libvlc_MediaSubItemTreeAdded,<br>
><br>
>      libvlc_MediaPlayerMediaChanged=0x100,<br>
>      libvlc_MediaPlayerNothingSpecial,<br>
> @@ -137,6 +138,10 @@ typedef struct libvlc_event_t<br>
>          {<br>
>              libvlc_state_t new_state;<br>
>          } media_state_changed;<br>
> +        struct<br>
> +        {<br>
> +            libvlc_media_t * item;<br>
> +        } media_subitemtree_added;<br>
><br>
>          /* media instance */<br>
>          struct<br>
> diff --git a/lib/event.c b/lib/event.c<br>
> index c71a48a..87f7d12 100644<br>
> --- a/lib/event.c<br>
> +++ b/lib/event.c<br>
> @@ -259,6 +259,7 @@ static const event_name_t event_list[] = {<br>
>      DEF(MediaParsedChanged)<br>
>      DEF(MediaFreed)<br>
>      DEF(MediaStateChanged)<br>
> +    DEF(MediaSubItemTreeAdded)<br>
><br>
>      DEF(MediaPlayerMediaChanged)<br>
>      DEF(MediaPlayerNothingSpecial)<br>
> diff --git a/lib/media.c b/lib/media.c<br>
> index 593f5c6..7acfb69 100644<br>
> --- a/lib/media.c<br>
> +++ b/lib/media.c<br>
> @@ -120,6 +120,23 @@ static void input_item_subitem_added( const vlc_event_t *p_event,<br>
>  }<br>
><br>
>  /**************************************************************************<br>
> + * input_item_subitemtree_added (Private) (vlc event Callback)<br>
> + **************************************************************************/<br>
> +static void input_item_subitemtree_added( const vlc_event_t * p_event,<br>
> +                                          void * user_data )<br>
> +{<br>
> +    libvlc_media_t * p_md = user_data;<br>
> +    libvlc_event_t event;<br>
> +<br>
> +    /* Construct the event */<br>
> +    event.type = libvlc_MediaSubItemTreeAdded;<br>
> +    event.u.media_subitemtree_added.item = p_md;<br>
> +<br>
> +    /* Send the event */<br>
> +    libvlc_event_send( p_md->p_event_manager, &event );<br>
> +}<br>
> +<br>
> +/**************************************************************************<br>
>   * input_item_meta_changed (Private) (vlc event Callback)<br>
>   **************************************************************************/<br>
>  static void input_item_meta_changed( const vlc_event_t *p_event,<br>
> @@ -201,6 +218,10 @@ static void install_input_item_observer( libvlc_media_t *p_md )<br>
>                        vlc_InputItemPreparsedChanged,<br>
>                        input_item_preparsed_changed,<br>
>                        p_md );<br>
> +    vlc_event_attach( &p_md->p_input_item->event_manager,<br>
> +                      vlc_InputItemSubItemTreeAdded,<br>
> +                      input_item_subitemtree_added,<br>
> +                      p_md );<br>
>  }<br>
><br>
>  /**************************************************************************<br>
> @@ -224,6 +245,10 @@ static void uninstall_input_item_observer( libvlc_media_t *p_md )<br>
>                        vlc_InputItemPreparsedChanged,<br>
>                        input_item_preparsed_changed,<br>
>                        p_md );<br>
> +    vlc_event_detach( &p_md->p_input_item->event_manager,<br>
> +                      vlc_InputItemSubItemTreeAdded,<br>
> +                      input_item_subitemtree_added,<br>
> +                      p_md );<br>
>  }<br>
><br>
>  /**************************************************************************<br>
> @@ -277,6 +302,7 @@ libvlc_media_t * libvlc_media_new_from_input_item(<br>
>      libvlc_event_manager_register_event_type(em, libvlc_MediaDurationChanged);<br>
>      libvlc_event_manager_register_event_type(em, libvlc_MediaStateChanged);<br>
>      libvlc_event_manager_register_event_type(em, libvlc_MediaParsedChanged);<br>
> +    libvlc_event_manager_register_event_type(em, libvlc_MediaSubItemTreeAdded);<br>
><br>
>      vlc_gc_incref( p_md->p_input_item );<br>
><br>
><br>
<br>
</div></div>_______________________________________________<br>
vlc-devel mailing list<br>
To unsubscribe or modify your subscription options:<br>
<a href="https://mailman.videolan.org/listinfo/vlc-devel" target="_blank">https://mailman.videolan.org/listinfo/vlc-devel</a><br>
</blockquote></div><div class="gmail_extra"><br></div></div>