vlc_services_discovery.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef VLC_SERVICES_DISCOVERY_H_
00025 #define VLC_SERVICES_DISCOVERY_H_
00026
00027 #include <vlc_input.h>
00028 #include <vlc_events.h>
00029 #include <vlc_probe.h>
00030
00031
00032
00033
00034
00035
00036 # ifdef __cplusplus
00037 extern "C" {
00038 # endif
00039
00040
00041
00042
00043
00044 struct services_discovery_t
00045 {
00046 VLC_COMMON_MEMBERS
00047 module_t * p_module;
00048
00049 vlc_event_manager_t event_manager;
00050
00051 char *psz_name;
00052 config_chain_t *p_cfg;
00053
00054 services_discovery_sys_t *p_sys;
00055 };
00056
00057 enum services_discovery_category_e
00058 {
00059 SD_CAT_DEVICES = 1,
00060 SD_CAT_LAN,
00061 SD_CAT_INTERNET,
00062 SD_CAT_MYCOMPUTER
00063 };
00064
00065
00066
00067
00068
00069
00070
00071 VLC_EXPORT( char **, vlc_sd_GetNames, ( vlc_object_t *, char ***, int ** ) LIBVLC_USED );
00072 #define vlc_sd_GetNames(obj, pln, pcat ) \
00073 vlc_sd_GetNames(VLC_OBJECT(obj), pln, pcat)
00074
00075
00076 VLC_EXPORT( services_discovery_t *, vlc_sd_Create, ( vlc_object_t *, const char * ) LIBVLC_USED );
00077 VLC_EXPORT( bool, vlc_sd_Start, ( services_discovery_t * ) );
00078 VLC_EXPORT( void, vlc_sd_Stop, ( services_discovery_t * ) );
00079 VLC_EXPORT( void, vlc_sd_Destroy, ( services_discovery_t * ) );
00080
00081 static inline void vlc_sd_StopAndDestroy( services_discovery_t * p_this )
00082 {
00083 vlc_sd_Stop( p_this );
00084 vlc_sd_Destroy( p_this );
00085 }
00086
00087
00088 VLC_EXPORT( char *, services_discovery_GetLocalizedName, ( services_discovery_t * p_this ) LIBVLC_USED );
00089
00090
00091 VLC_EXPORT( vlc_event_manager_t *, services_discovery_EventManager, ( services_discovery_t * p_this ) LIBVLC_USED );
00092
00093
00094
00095
00096 VLC_EXPORT( void, services_discovery_AddItem, ( services_discovery_t * p_this, input_item_t * p_item, const char * psz_category ) );
00097 VLC_EXPORT( void, services_discovery_RemoveItem, ( services_discovery_t * p_this, input_item_t * p_item ) );
00098
00099
00100
00101
00102 VLC_EXPORT(int, vlc_sd_probe_Add, (vlc_probe_t *, const char *, const char *, int category));
00103
00104 #define VLC_SD_PROBE_SUBMODULE \
00105 add_submodule() \
00106 set_capability( "services probe", 100 ) \
00107 set_callbacks( vlc_sd_probe_Open, NULL )
00108
00109 #define VLC_SD_PROBE_HELPER(name, longname, cat) \
00110 static int vlc_sd_probe_Open (vlc_object_t *obj) \
00111 { \
00112 return vlc_sd_probe_Add ((struct vlc_probe_t *)obj, \
00113 name "{longname=\"" longname "\"}", \
00114 longname, cat); \
00115 }
00116
00117
00118 # ifdef __cplusplus
00119 }
00120 # endif
00121
00122 #endif