Commit 8adbb2d7 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

libvlc: Don't refer to media_preparsing as we don't have media_parsing.

parsing is simpler.
parent 8211292f
...@@ -49,7 +49,7 @@ enum libvlc_event_e { ...@@ -49,7 +49,7 @@ enum libvlc_event_e {
libvlc_MediaMetaChanged=0, libvlc_MediaMetaChanged=0,
libvlc_MediaSubItemAdded, libvlc_MediaSubItemAdded,
libvlc_MediaDurationChanged, libvlc_MediaDurationChanged,
libvlc_MediaPreparsedChanged, libvlc_MediaParsedChanged,
libvlc_MediaFreed, libvlc_MediaFreed,
libvlc_MediaStateChanged, libvlc_MediaStateChanged,
...@@ -127,7 +127,7 @@ typedef struct libvlc_event_t ...@@ -127,7 +127,7 @@ typedef struct libvlc_event_t
struct struct
{ {
int new_status; int new_status;
} media_preparsed_changed; } media_parsed_changed;
struct struct
{ {
libvlc_media_t * md; libvlc_media_t * md;
......
...@@ -398,12 +398,12 @@ libvlc_media_parse(libvlc_media_t *media); ...@@ -398,12 +398,12 @@ libvlc_media_parse(libvlc_media_t *media);
* This fetches (local) meta data and tracks information. * This fetches (local) meta data and tracks information.
* The method is the asynchronous of libvlc_media_parse_async(). * The method is the asynchronous of libvlc_media_parse_async().
* *
* To track when this is over you can listen to libvlc_MediaPreparsedChanged * To track when this is over you can listen to libvlc_MediaParsedChanged
* event. However if the media was already preparsed you will not receive this * event. However if the media was already parsed you will not receive this
* event. * event.
* *
* \see libvlc_media_parse * \see libvlc_media_parse
* \see libvlc_MediaPreparsedChanged * \see libvlc_MediaParsedChanged
* \see libvlc_media_get_meta * \see libvlc_media_get_meta
* \see libvlc_media_get_tracks_info * \see libvlc_media_get_tracks_info
* *
...@@ -413,13 +413,15 @@ VLC_PUBLIC_API void ...@@ -413,13 +413,15 @@ VLC_PUBLIC_API void
libvlc_media_parse_async(libvlc_media_t *media); libvlc_media_parse_async(libvlc_media_t *media);
/** /**
* Get preparsed status for media descriptor object. * Get Parsed status for media descriptor object.
*
* \see libvlc_MediaParsedChanged
* *
* \param p_md media descriptor object * \param p_md media descriptor object
* \return true if media object has been preparsed otherwise it returns false * \return true if media object has been parsed otherwise it returns false
*/ */
VLC_PUBLIC_API int VLC_PUBLIC_API int
libvlc_media_is_preparsed( libvlc_media_t * p_md ); libvlc_media_is_parsed( libvlc_media_t * p_md );
/** /**
* Sets media descriptor's user_data. user_data is specialized data * Sets media descriptor's user_data. user_data is specialized data
......
...@@ -212,10 +212,10 @@ void libvlc_event_send( libvlc_event_manager_t * p_em, ...@@ -212,10 +212,10 @@ void libvlc_event_send( libvlc_event_manager_t * p_em,
else else
{ {
/* The listener wants to block the emitter during event callback */ /* The listener wants to block the emitter during event callback */
listener_cached->pf_callback( p_event, listener_cached->p_user_data ); listener_cached->pf_callback( p_event, listener_cached->p_user_data );
listener_cached++; listener_cached++;
if( listeners_group->b_sublistener_removed ) if( listeners_group->b_sublistener_removed )
{ {
/* If a callback was removed, this gets called */ /* If a callback was removed, this gets called */
...@@ -228,7 +228,7 @@ void libvlc_event_send( libvlc_event_manager_t * p_em, ...@@ -228,7 +228,7 @@ void libvlc_event_send( libvlc_event_manager_t * p_em,
listener_cached++; listener_cached++;
continue; continue;
} }
} }
} }
} }
vlc_mutex_unlock( &p_em->event_sending_lock ); vlc_mutex_unlock( &p_em->event_sending_lock );
...@@ -252,7 +252,7 @@ static const event_name_t event_list[] = { ...@@ -252,7 +252,7 @@ static const event_name_t event_list[] = {
DEF(MediaMetaChanged) DEF(MediaMetaChanged)
DEF(MediaSubItemAdded) DEF(MediaSubItemAdded)
DEF(MediaDurationChanged) DEF(MediaDurationChanged)
DEF(MediaPreparsedChanged) DEF(MediaParsedChanged)
DEF(MediaFreed) DEF(MediaFreed)
DEF(MediaStateChanged) DEF(MediaStateChanged)
...@@ -333,16 +333,16 @@ int event_attach( libvlc_event_manager_t * p_event_manager, ...@@ -333,16 +333,16 @@ int event_attach( libvlc_event_manager_t * p_event_manager,
libvlc_event_listeners_group_t * listeners_group; libvlc_event_listeners_group_t * listeners_group;
libvlc_event_listener_t * listener; libvlc_event_listener_t * listener;
int i; int i;
listener = malloc(sizeof(libvlc_event_listener_t)); listener = malloc(sizeof(libvlc_event_listener_t));
if( unlikely(listener == NULL) ) if( unlikely(listener == NULL) )
return ENOMEM; return ENOMEM;
listener->event_type = event_type; listener->event_type = event_type;
listener->p_user_data = p_user_data; listener->p_user_data = p_user_data;
listener->pf_callback = pf_callback; listener->pf_callback = pf_callback;
listener->is_asynchronous = is_asynchronous; listener->is_asynchronous = is_asynchronous;
vlc_mutex_lock( &p_event_manager->object_lock ); vlc_mutex_lock( &p_event_manager->object_lock );
for( i = 0; i < vlc_array_count(&p_event_manager->listeners_groups); i++ ) for( i = 0; i < vlc_array_count(&p_event_manager->listeners_groups); i++ )
{ {
...@@ -355,7 +355,7 @@ int event_attach( libvlc_event_manager_t * p_event_manager, ...@@ -355,7 +355,7 @@ int event_attach( libvlc_event_manager_t * p_event_manager,
} }
} }
vlc_mutex_unlock( &p_event_manager->object_lock ); vlc_mutex_unlock( &p_event_manager->object_lock );
free(listener); free(listener);
fprintf( stderr, "This object event manager doesn't know about '%s' events", fprintf( stderr, "This object event manager doesn't know about '%s' events",
libvlc_event_type_name(event_type) ); libvlc_event_type_name(event_type) );
...@@ -405,7 +405,7 @@ void libvlc_event_detach( libvlc_event_manager_t *p_event_manager, ...@@ -405,7 +405,7 @@ void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
libvlc_event_listener_t * listener; libvlc_event_listener_t * listener;
int i, j; int i, j;
bool found = false; bool found = false;
vlc_mutex_lock( &p_event_manager->event_sending_lock ); vlc_mutex_lock( &p_event_manager->event_sending_lock );
vlc_mutex_lock( &p_event_manager->object_lock ); vlc_mutex_lock( &p_event_manager->object_lock );
for( i = 0; i < vlc_array_count(&p_event_manager->listeners_groups); i++) for( i = 0; i < vlc_array_count(&p_event_manager->listeners_groups); i++)
......
...@@ -172,8 +172,8 @@ static void input_item_preparsed_changed(const vlc_event_t *p_event, ...@@ -172,8 +172,8 @@ static void input_item_preparsed_changed(const vlc_event_t *p_event,
/* Construct the event */ /* Construct the event */
event.type = libvlc_MediaPreparsedChanged; event.type = libvlc_MediaParsedChanged;
event.u.media_preparsed_changed.new_status = event.u.media_parsed_changed.new_status =
p_event->u.input_item_preparsed_changed.new_status; p_event->u.input_item_preparsed_changed.new_status;
/* Send the event */ /* Send the event */
...@@ -284,18 +284,14 @@ libvlc_media_t * libvlc_media_new_from_input_item( ...@@ -284,18 +284,14 @@ libvlc_media_t * libvlc_media_new_from_input_item(
free(p_md); free(p_md);
return NULL; return NULL;
} }
libvlc_event_manager_register_event_type( p_md->p_event_manager,
libvlc_MediaMetaChanged ); libvlc_event_manager_t *em = p_md->p_event_manager;
libvlc_event_manager_register_event_type( p_md->p_event_manager, libvlc_event_manager_register_event_type(em, libvlc_MediaMetaChanged);
libvlc_MediaSubItemAdded ); libvlc_event_manager_register_event_type(em, libvlc_MediaSubItemAdded);
libvlc_event_manager_register_event_type( p_md->p_event_manager, libvlc_event_manager_register_event_type(em, libvlc_MediaFreed);
libvlc_MediaFreed ); libvlc_event_manager_register_event_type(em, libvlc_MediaDurationChanged);
libvlc_event_manager_register_event_type( p_md->p_event_manager, libvlc_event_manager_register_event_type(em, libvlc_MediaStateChanged);
libvlc_MediaDurationChanged ); libvlc_event_manager_register_event_type(em, libvlc_MediaParsedChanged);
libvlc_event_manager_register_event_type( p_md->p_event_manager,
libvlc_MediaStateChanged );
libvlc_event_manager_register_event_type( p_md->p_event_manager,
libvlc_MediaPreparsedChanged );
vlc_gc_incref( p_md->p_input_item ); vlc_gc_incref( p_md->p_input_item );
...@@ -641,10 +637,10 @@ libvlc_media_parse_async(libvlc_media_t *media) ...@@ -641,10 +637,10 @@ libvlc_media_parse_async(libvlc_media_t *media)
} }
/************************************************************************** /**************************************************************************
* Get preparsed status for media object. * Get parsed status for media object.
**************************************************************************/ **************************************************************************/
int int
libvlc_media_is_preparsed( libvlc_media_t * p_md ) libvlc_media_is_parsed( libvlc_media_t * p_md )
{ {
assert( p_md ); assert( p_md );
......
...@@ -47,7 +47,7 @@ static void test_media_preparsed(const char** argv, int argc) ...@@ -47,7 +47,7 @@ static void test_media_preparsed(const char** argv, int argc)
// Check to see if we are properly receiving the event. // Check to see if we are properly receiving the event.
libvlc_event_manager_t *em = libvlc_media_event_manager (media); libvlc_event_manager_t *em = libvlc_media_event_manager (media);
libvlc_event_attach (em, libvlc_MediaPreparsedChanged, preparsed_changed, (void*)&received); libvlc_event_attach (em, libvlc_MediaParsedChanged, preparsed_changed, (void*)&received);
// Parse the media. This is synchronous. // Parse the media. This is synchronous.
libvlc_media_parse(media); libvlc_media_parse(media);
...@@ -57,7 +57,7 @@ static void test_media_preparsed(const char** argv, int argc) ...@@ -57,7 +57,7 @@ static void test_media_preparsed(const char** argv, int argc)
// We are good, now check Elementary Stream info. // We are good, now check Elementary Stream info.
libvlc_media_track_info_t *tracks; libvlc_media_track_info_t *tracks;
int num = libvlc_media_get_es(media, &tracks); int num = libvlc_media_get_tracks_info(media, &tracks);
assert(num > 0); assert(num > 0);
free(tracks); free(tracks);
......
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