]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_media_discoverer.h
upnp: change item b_net and i_type
[vlc] / include / vlc / libvlc_media_discoverer.h
1 /*****************************************************************************
2  * libvlc_media_discoverer.h:  libvlc external API
3  *****************************************************************************
4  * Copyright (C) 1998-2009 VLC authors and VideoLAN
5  * $Id$
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  *          Jean-Paul Saman <jpsaman@videolan.org>
9  *          Pierre d'Herbemont <pdherbemont@videolan.org>
10  *
11  * This program is free software; you can redistribute it and/or modify it
12  * under the terms of the GNU Lesser General Public License as published by
13  * the Free Software Foundation; either version 2.1 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * along with this program; if not, write to the Free Software Foundation,
23  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24  *****************************************************************************/
25
26 /**
27  * \file
28  * This file defines libvlc_media_discoverer external API
29  */
30
31 #ifndef VLC_LIBVLC_MEDIA_DISCOVERER_H
32 #define VLC_LIBVLC_MEDIA_DISCOVERER_H 1
33
34 # ifdef __cplusplus
35 extern "C" {
36 # endif
37
38 /** \defgroup libvlc_media_discoverer LibVLC media discovery
39  * \ingroup libvlc
40  * LibVLC media discovery finds available media via various means.
41  * This corresponds to the service discovery functionality in VLC media player.
42  * Different plugins find potential medias locally (e.g. user media directory),
43  * from peripherals (e.g. video capture device), on the local network
44  * (e.g. SAP) or on the Internet (e.g. Internet radios).
45  * @{
46  */
47
48 typedef struct libvlc_media_discoverer_t libvlc_media_discoverer_t;
49
50 /**
51  * \deprecated Use libvlc_media_discoverer_new() and libvlc_media_discoverer_start().
52  */
53 LIBVLC_DEPRECATED LIBVLC_API libvlc_media_discoverer_t *
54 libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
55                                        const char * psz_name );
56
57 /**
58  * Create a media discoverer object by name.
59  *
60  * After this object is created, you should attach to events in order to be
61  * notified of the discoverer state.
62  * You should also attach to media_list events in order to be notified of new
63  * items discovered.
64  *
65  * You need to call libvlc_media_discoverer_start() in order to start the
66  * discovery.
67  *
68  * \see libvlc_media_discoverer_media_list
69  * \see libvlc_media_discoverer_event_manager
70  * \see libvlc_media_discoverer_start
71  *
72  * \param p_inst libvlc instance
73  * \param psz_name service name
74  * \return media discover object or NULL in case of error
75  * \version LibVLC 3.0.0 or later
76  */
77 LIBVLC_API libvlc_media_discoverer_t *
78 libvlc_media_discoverer_new( libvlc_instance_t * p_inst,
79                              const char * psz_name );
80
81 /**
82  * Start media discovery.
83  *
84  * To stop it, call libvlc_media_discoverer_stop() or
85  * libvlc_media_discoverer_release() directly.
86  *
87  * \see libvlc_media_discoverer_stop
88  *
89  * \param p_mdis media discover object
90  * \return -1 in case of error, 0 otherwise
91  * \version LibVLC 3.0.0 or later
92  */
93 LIBVLC_API int
94 libvlc_media_discoverer_start( libvlc_media_discoverer_t * p_mdis );
95
96 /**
97  * Stop media discovery.
98  *
99  * \see libvlc_media_discoverer_start
100  *
101  * \param p_mdis media discover object
102  * \version LibVLC 3.0.0 or later
103  */
104 LIBVLC_API void
105 libvlc_media_discoverer_stop( libvlc_media_discoverer_t * p_mdis );
106
107 /**
108  * Release media discover object. If the reference count reaches 0, then
109  * the object will be released.
110  *
111  * \param p_mdis media service discover object
112  */
113 LIBVLC_API void   libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
114
115 /**
116  * Get media service discover object its localized name.
117  *
118  * \param p_mdis media discover object
119  * \return localized name
120  */
121 LIBVLC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
122
123 /**
124  * Get media service discover media list.
125  *
126  * \param p_mdis media service discover object
127  * \return list of media items
128  */
129 LIBVLC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis );
130
131 /**
132  * Get event manager from media service discover object.
133  *
134  * \param p_mdis media service discover object
135  * \return event manager object.
136  */
137 LIBVLC_API libvlc_event_manager_t *
138         libvlc_media_discoverer_event_manager( libvlc_media_discoverer_t * p_mdis );
139
140 /**
141  * Query if media service discover object is running.
142  *
143  * \param p_mdis media service discover object
144  * \return true if running, false if not
145  *
146  * \libvlc_return_bool
147  */
148 LIBVLC_API int
149         libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis );
150
151 /**@} */
152
153 # ifdef __cplusplus
154 }
155 # endif
156
157 #endif /* <vlc/libvlc.h> */