Commit b6880d76 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

playlist/services_discovery.c: Send service discover started and ended events,...

playlist/services_discovery.c: Send service discover started and ended events, to keep track of running sd.
parent 14365bf3
......@@ -119,7 +119,9 @@ typedef enum vlc_event_type_t {
/* Service Discovery event */
vlc_ServicesDiscoveryItemAdded,
vlc_ServicesDiscoveryItemRemoved
vlc_ServicesDiscoveryItemRemoved,
vlc_ServicesDiscoveryStarted,
vlc_ServicesDiscoveryEnded
} vlc_event_type_t;
/* Event definition */
......@@ -157,6 +159,14 @@ typedef struct vlc_event_t
{
input_item_t * p_item;
} services_discovery_item_removed;
struct vlc_services_discovery_started
{
void * unused;
} services_discovery_started;
struct vlc_services_discovery_ended
{
void * unused;
} services_discovery_ended;
} u;
} vlc_event_t;
......
......@@ -62,6 +62,10 @@ services_discovery_Create ( vlc_object_t * p_super, const char * psz_module_name
vlc_ServicesDiscoveryItemAdded );
vlc_event_manager_register_event_type( &p_sd->event_manager,
vlc_ServicesDiscoveryItemRemoved );
vlc_event_manager_register_event_type( &p_sd->event_manager,
vlc_ServicesDiscoveryStarted );
vlc_event_manager_register_event_type( &p_sd->event_manager,
vlc_ServicesDiscoveryEnded );
p_sd->p_module = module_Need( p_sd, "services_discovery", psz_module_name, VLC_TRUE );
......@@ -180,7 +184,15 @@ services_discovery_RemoveItem ( services_discovery_t * p_sd, input_item_t * p_it
***********************************************************************/
static void RunSD( services_discovery_t *p_sd )
{
vlc_event_t event;
event.type = vlc_ServicesDiscoveryStarted;
vlc_event_send( &p_sd->event_manager, &event );
p_sd->pf_run( p_sd );
event.type = vlc_ServicesDiscoveryEnded;
vlc_event_send( &p_sd->event_manager, &event );
return;
}
......
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