Commit 3e22604e authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

More documentation for vlc_services_discovery.h

parent bf343c29
...@@ -37,16 +37,20 @@ ...@@ -37,16 +37,20 @@
extern "C" { extern "C" {
# endif # endif
/* /**
* @{ * @{
*/ */
/**
* Main service discovery structure to build a SD module
*/
struct services_discovery_t struct services_discovery_t
{ {
VLC_COMMON_MEMBERS VLC_COMMON_MEMBERS
module_t * p_module; /**< Loaded module */ module_t * p_module; /**< Loaded module */
/**< Event manager /**< Event manager
/* You should access it through setters, outside of the core */ * You should access it through setters, outside of the core */
vlc_event_manager_t event_manager; vlc_event_manager_t event_manager;
char *psz_name; /**< Main name of the SD */ char *psz_name; /**< Main name of the SD */
...@@ -62,6 +66,7 @@ struct services_discovery_t ...@@ -62,6 +66,7 @@ struct services_discovery_t
/** /**
* Service discovery categories * Service discovery categories
* \see vlc_sd_probe_Add
*/ */
enum services_discovery_category_e enum services_discovery_category_e
{ {
...@@ -90,6 +95,7 @@ enum services_discovery_capability_e ...@@ -90,6 +95,7 @@ enum services_discovery_capability_e
/** /**
* Service discovery descriptor * Service discovery descriptor
* \see services_discovery_command_e
*/ */
typedef struct typedef struct
{ {
...@@ -99,6 +105,7 @@ typedef struct ...@@ -99,6 +105,7 @@ typedef struct
int i_capabilities; /**< \see services_discovery_capability_e */ int i_capabilities; /**< \see services_discovery_capability_e */
} services_discovery_descriptor_t; } services_discovery_descriptor_t;
/*********************************************************************** /***********************************************************************
* Service Discovery * Service Discovery
***********************************************************************/ ***********************************************************************/
......
...@@ -103,8 +103,8 @@ static void services_discovery_Destructor ( vlc_object_t *p_obj ); ...@@ -103,8 +103,8 @@ static void services_discovery_Destructor ( vlc_object_t *p_obj );
* That's how the playlist get's Service Discovery information * That's how the playlist get's Service Discovery information
*/ */
/*********************************************************************** /*******************************************************************//**
* Create * Create a Service discovery
***********************************************************************/ ***********************************************************************/
services_discovery_t *vlc_sd_Create( vlc_object_t *p_super, services_discovery_t *vlc_sd_Create( vlc_object_t *p_super,
const char *cfg ) const char *cfg )
...@@ -130,8 +130,8 @@ services_discovery_t *vlc_sd_Create( vlc_object_t *p_super, ...@@ -130,8 +130,8 @@ services_discovery_t *vlc_sd_Create( vlc_object_t *p_super,
return p_sd; return p_sd;
} }
/*********************************************************************** /*******************************************************************//**
* Start * Start a Service Discovery
***********************************************************************/ ***********************************************************************/
bool vlc_sd_Start ( services_discovery_t * p_sd ) bool vlc_sd_Start ( services_discovery_t * p_sd )
{ {
...@@ -152,8 +152,8 @@ bool vlc_sd_Start ( services_discovery_t * p_sd ) ...@@ -152,8 +152,8 @@ bool vlc_sd_Start ( services_discovery_t * p_sd )
return true; return true;
} }
/*********************************************************************** /*******************************************************************//**
* Stop * Stop a Service Discovery
***********************************************************************/ ***********************************************************************/
void vlc_sd_Stop ( services_discovery_t * p_sd ) void vlc_sd_Stop ( services_discovery_t * p_sd )
{ {
...@@ -167,6 +167,9 @@ void vlc_sd_Stop ( services_discovery_t * p_sd ) ...@@ -167,6 +167,9 @@ void vlc_sd_Stop ( services_discovery_t * p_sd )
p_sd->p_module = NULL; p_sd->p_module = NULL;
} }
/*******************************************************************//**
* Destroy a Service Discovery
***********************************************************************/
void vlc_sd_Destroy( services_discovery_t *p_sd ) void vlc_sd_Destroy( services_discovery_t *p_sd )
{ {
config_ChainDestroy( p_sd->p_cfg ); config_ChainDestroy( p_sd->p_cfg );
...@@ -174,8 +177,8 @@ void vlc_sd_Destroy( services_discovery_t *p_sd ) ...@@ -174,8 +177,8 @@ void vlc_sd_Destroy( services_discovery_t *p_sd )
vlc_object_release( p_sd ); vlc_object_release( p_sd );
} }
/*********************************************************************** /*******************************************************************//**
* Destructor * Destructor of the Service Discovery
***********************************************************************/ ***********************************************************************/
static void services_discovery_Destructor ( vlc_object_t *p_obj ) static void services_discovery_Destructor ( vlc_object_t *p_obj )
{ {
...@@ -184,8 +187,10 @@ static void services_discovery_Destructor ( vlc_object_t *p_obj ) ...@@ -184,8 +187,10 @@ static void services_discovery_Destructor ( vlc_object_t *p_obj )
vlc_event_manager_fini( &p_sd->event_manager ); vlc_event_manager_fini( &p_sd->event_manager );
} }
/*********************************************************************** /*******************************************************************//**
* GetLocalizedName * Get the Localized Name
*
* This is useful for interfaces and libVLC
***********************************************************************/ ***********************************************************************/
char * char *
services_discovery_GetLocalizedName ( services_discovery_t * p_sd ) services_discovery_GetLocalizedName ( services_discovery_t * p_sd )
...@@ -193,8 +198,11 @@ services_discovery_GetLocalizedName ( services_discovery_t * p_sd ) ...@@ -193,8 +198,11 @@ services_discovery_GetLocalizedName ( services_discovery_t * p_sd )
return strdup( module_get_name( p_sd->p_module, true ) ); return strdup( module_get_name( p_sd->p_module, true ) );
} }
/*********************************************************************** /*******************************************************************//**
* EventManager * Getter for the EventManager
*
* You can receive event notification
* This is the preferred way to get new items
***********************************************************************/ ***********************************************************************/
vlc_event_manager_t * vlc_event_manager_t *
services_discovery_EventManager ( services_discovery_t * p_sd ) services_discovery_EventManager ( services_discovery_t * p_sd )
...@@ -202,8 +210,8 @@ services_discovery_EventManager ( services_discovery_t * p_sd ) ...@@ -202,8 +210,8 @@ services_discovery_EventManager ( services_discovery_t * p_sd )
return &p_sd->event_manager; return &p_sd->event_manager;
} }
/*********************************************************************** /*******************************************************************//**
* AddItem * Add an item to the Service Discovery listing
***********************************************************************/ ***********************************************************************/
void void
services_discovery_AddItem ( services_discovery_t * p_sd, input_item_t * p_item, services_discovery_AddItem ( services_discovery_t * p_sd, input_item_t * p_item,
...@@ -217,8 +225,8 @@ services_discovery_AddItem ( services_discovery_t * p_sd, input_item_t * p_item, ...@@ -217,8 +225,8 @@ services_discovery_AddItem ( services_discovery_t * p_sd, input_item_t * p_item,
vlc_event_send( &p_sd->event_manager, &event ); vlc_event_send( &p_sd->event_manager, &event );
} }
/*********************************************************************** /*******************************************************************//**
* RemoveItem * Remove an item from the Service Discovery listing
***********************************************************************/ ***********************************************************************/
void void
services_discovery_RemoveItem ( services_discovery_t * p_sd, input_item_t * p_item ) services_discovery_RemoveItem ( services_discovery_t * p_sd, input_item_t * p_item )
......
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