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
00045
00046
00047 struct services_discovery_t
00048 {
00049 VLC_COMMON_MEMBERS
00050 module_t * p_module;
00051
00052
00053
00054 vlc_event_manager_t event_manager;
00055
00056 char *psz_name;
00057 config_chain_t *p_cfg;
00058
00059
00060
00061
00062 int ( *pf_control ) ( services_discovery_t *, int, va_list );
00063
00064 services_discovery_sys_t *p_sys;
00065 };
00066
00067
00068
00069
00070
00071 enum services_discovery_category_e
00072 {
00073 SD_CAT_DEVICES = 1,
00074 SD_CAT_LAN,
00075 SD_CAT_INTERNET,
00076 SD_CAT_MYCOMPUTER
00077 };
00078
00079
00080
00081
00082 enum services_discovery_command_e
00083 {
00084 SD_CMD_SEARCH = 1,
00085 SD_CMD_DESCRIPTOR
00086 };
00087
00088
00089
00090
00091 enum services_discovery_capability_e
00092 {
00093 SD_CAP_SEARCH = 1
00094 };
00095
00096
00097
00098
00099
00100 typedef struct
00101 {
00102 char *psz_short_desc;
00103 char *psz_icon_url;
00104 char *psz_url;
00105 int i_capabilities;
00106 } services_discovery_descriptor_t;
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120 static inline int vlc_sd_control( services_discovery_t *p_sd, int i_control, va_list args )
00121 {
00122 if( p_sd->pf_control )
00123 return p_sd->pf_control( p_sd, i_control, args );
00124 else
00125 return VLC_EGENERIC;
00126 }
00127
00128
00129
00130 VLC_API char ** vlc_sd_GetNames( vlc_object_t *, char ***, int ** ) VLC_USED;
00131 #define vlc_sd_GetNames(obj, pln, pcat ) \
00132 vlc_sd_GetNames(VLC_OBJECT(obj), pln, pcat)
00133
00134
00135 VLC_API services_discovery_t * vlc_sd_Create( vlc_object_t *, const char * ) VLC_USED;
00136 VLC_API bool vlc_sd_Start( services_discovery_t * );
00137 VLC_API void vlc_sd_Stop( services_discovery_t * );
00138 VLC_API void vlc_sd_Destroy( services_discovery_t * );
00139
00140
00141
00142
00143 static inline void vlc_sd_StopAndDestroy( services_discovery_t * p_this )
00144 {
00145 vlc_sd_Stop( p_this );
00146 vlc_sd_Destroy( p_this );
00147 }
00148
00149
00150 VLC_API char * services_discovery_GetLocalizedName( services_discovery_t * p_this ) VLC_USED;
00151
00152
00153 VLC_API vlc_event_manager_t * services_discovery_EventManager( services_discovery_t * p_this ) VLC_USED;
00154
00155
00156
00157
00158 VLC_API void services_discovery_AddItem( services_discovery_t * p_this, input_item_t * p_item, const char * psz_category );
00159 VLC_API void services_discovery_RemoveItem( services_discovery_t * p_this, input_item_t * p_item );
00160 VLC_API void services_discovery_RemoveAll( services_discovery_t * p_sd );
00161
00162
00163
00164
00165 VLC_API int vlc_sd_probe_Add(vlc_probe_t *, const char *, const char *, int category);
00166
00167 #define VLC_SD_PROBE_SUBMODULE \
00168 add_submodule() \
00169 set_capability( "services probe", 100 ) \
00170 set_callbacks( vlc_sd_probe_Open, NULL )
00171
00172 #define VLC_SD_PROBE_HELPER(name, longname, cat) \
00173 static int vlc_sd_probe_Open (vlc_object_t *obj) \
00174 { \
00175 return vlc_sd_probe_Add ((struct vlc_probe_t *)obj, \
00176 name "{longname=\"" longname "\"}", \
00177 longname, cat); \
00178 }
00179
00180
00181 # ifdef __cplusplus
00182 }
00183 # endif
00184
00185 #endif