vlc_services_discovery.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * vlc_services_discovery.h : Services Discover functions
00003  *****************************************************************************
00004  * Copyright (C) 1999-2004 the VideoLAN team
00005  * $Id$
00006  *
00007  * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00022  *****************************************************************************/
00023 
00024 #ifndef VLC_SERVICES_DISCOVERY_H_
00025 #define VLC_SERVICES_DISCOVERY_H_
00026 
00027 /**
00028  * \file
00029  * This file functions and structures for service discovery in vlc
00030  */
00031 
00032 # ifdef __cplusplus
00033 extern "C" {
00034 # endif
00035 
00036 /*
00037  * @{
00038  */
00039 
00040 #include <vlc_input.h>
00041 #include <vlc_events.h>
00042 
00043 struct services_discovery_t
00044 {
00045     VLC_COMMON_MEMBERS
00046     module_t *          p_module;
00047 
00048     vlc_event_manager_t event_manager;      /* Accessed through Setters for non class function */
00049 
00050     services_discovery_sys_t *p_sys;
00051 };
00052 
00053 /***********************************************************************
00054  * Service Discovery
00055  ***********************************************************************/
00056 
00057 /* Get the services discovery modules names to use in Create(), in a null
00058  * terminated string array. Array and string must be freed after use. */
00059 VLC_EXPORT( char **, vlc_sd_GetNames, ( char ***pppsz_longnames ) );
00060 
00061 /* Creation of a service_discovery object */
00062 VLC_EXPORT( services_discovery_t *, vlc_sd_Create, ( vlc_object_t * ) );
00063 VLC_EXPORT( bool, vlc_sd_Start, ( services_discovery_t *, const char * ) );
00064 VLC_EXPORT( void, vlc_sd_Stop, ( services_discovery_t * ) );
00065 
00066 static inline void vlc_sd_Destroy( services_discovery_t *p_sd )
00067 {
00068     vlc_object_release( VLC_OBJECT(p_sd) );
00069 }
00070 
00071 static inline void vlc_sd_StopAndDestroy( services_discovery_t * p_this )
00072 {
00073     vlc_sd_Stop( p_this );
00074     vlc_sd_Destroy( p_this );
00075 }
00076 
00077 /* Read info from discovery object */
00078 VLC_EXPORT( char *,                 services_discovery_GetLocalizedName, ( services_discovery_t * p_this ) );
00079 
00080 /* Receive event notification (preferred way to get new items) */
00081 VLC_EXPORT( vlc_event_manager_t *,  services_discovery_EventManager, ( services_discovery_t * p_this ) );
00082 
00083 /* Used by services_discovery to post update about their items */
00084     /* About the psz_category, it is a legacy way to add info to the item,
00085      * for more options, directly set the (meta) data on the input item */
00086 VLC_EXPORT( void,                   services_discovery_AddItem, ( services_discovery_t * p_this, input_item_t * p_item, const char * psz_category ) );
00087 VLC_EXPORT( void,                   services_discovery_RemoveItem, ( services_discovery_t * p_this, input_item_t * p_item ) );
00088 
00089 /** @} */
00090 # ifdef __cplusplus
00091 }
00092 # endif
00093 
00094 #endif

Generated on Sun Nov 22 08:05:13 2009 for VLC by  doxygen 1.5.6