Commit 4935cbe1 authored by Thomas Guillem's avatar Thomas Guillem Committed by Jean-Baptiste Kempf

input: add vlc_InputItemPreparseEnded event

This event is sent from playlist/preparsed thread to notify when an item is
preparsed. This event is sent when the preparse function terminate, ie. when
meta and sub items are parsed. It is also sent when the preparse function fails
to parse anything.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent ffdfe2ac
......@@ -123,6 +123,7 @@ typedef enum vlc_event_type_t {
vlc_InputItemNameChanged,
vlc_InputItemInfoChanged,
vlc_InputItemErrorWhenReadingChanged,
vlc_InputItemPreparseEnded,
/* Service Discovery event */
vlc_ServicesDiscoveryItemAdded,
......
......@@ -30,6 +30,7 @@
/**********************************************************************
* Item metadata
**********************************************************************/
void input_item_SignalPreparseEnded( input_item_t *p_i );
void input_item_SetPreparsed( input_item_t *p_i, bool b_preparsed );
void input_item_SetArtNotFound( input_item_t *p_i, bool b_not_found );
void input_item_SetArtFetched( input_item_t *p_i, bool b_art_fetched );
......
......@@ -57,6 +57,13 @@ void input_item_SetErrorWhenReading( input_item_t *p_i, bool b_error )
vlc_event_send( &p_i->event_manager, &event );
}
}
void input_item_SignalPreparseEnded( input_item_t *p_i )
{
vlc_event_t event;
event.type = vlc_InputItemPreparseEnded;
vlc_event_send( &p_i->event_manager, &event );
}
void input_item_SetPreparsed( input_item_t *p_i, bool b_preparsed )
{
bool b_send_event = false;
......@@ -874,6 +881,7 @@ input_item_NewWithType( const char *psz_uri, const char *psz_name,
vlc_event_manager_register_event_type( p_em, vlc_InputItemNameChanged );
vlc_event_manager_register_event_type( p_em, vlc_InputItemInfoChanged );
vlc_event_manager_register_event_type( p_em, vlc_InputItemErrorWhenReadingChanged );
vlc_event_manager_register_event_type( p_em, vlc_InputItemPreparseEnded );
if( type != ITEM_TYPE_UNKNOWN )
p_input->i_type = type;
......
......@@ -165,6 +165,7 @@ static void Preparse( vlc_object_t *obj, input_item_t *p_item,
if( !b_preparse )
{
input_item_SetPreparsed( p_item, true );
input_item_SignalPreparseEnded( p_item );
return;
}
......@@ -176,6 +177,7 @@ static void Preparse( vlc_object_t *obj, input_item_t *p_item,
var_SetAddress( obj, "item-change", p_item );
}
input_item_SignalPreparseEnded( p_item );
}
/**
......
......@@ -45,6 +45,8 @@ playlist_preparser_t *playlist_preparser_New( vlc_object_t * );
*
* The input item is retained until the preparsing is done or until the
* preparser object is deleted.
* Listen to vlc_InputItemPreparseEnded event to get notified when item is
* preparsed.
*/
void playlist_preparser_Push( playlist_preparser_t *, input_item_t *,
input_item_meta_request_option_t );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment