VLC  4.0.0-dev
libvlc_media_discoverer.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * libvlc_media_discoverer.h: libvlc external API
3  *****************************************************************************
4  * Copyright (C) 1998-2009 VLC authors and VideoLAN
5  *
6  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
7  * Jean-Paul Saman <jpsaman@videolan.org>
8  * Pierre d'Herbemont <pdherbemont@videolan.org>
9  *
10  * This program is free software; you can redistribute it and/or modify it
11  * under the terms of the GNU Lesser General Public License as published by
12  * the Free Software Foundation; either version 2.1 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with this program; if not, write to the Free Software Foundation,
22  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24 
25 #ifndef VLC_LIBVLC_MEDIA_DISCOVERER_H
26 #define VLC_LIBVLC_MEDIA_DISCOVERER_H 1
27 
28 # ifdef __cplusplus
29 extern "C" {
30 # endif
31 
32 /**
33  * Category of a media discoverer
34  * \see libvlc_media_discoverer_list_get()
35  */
37  /** devices, like portable music player */
39  /** LAN/WAN services, like Upnp, SMB, or SAP */
41  /** Podcasts */
43  /** Local directories, like Video, Music or Pictures directories */
46 
47 /**
48  * Media discoverer description
49  * \see libvlc_media_discoverer_list_get()
50  */
52  char *psz_name;
53  char *psz_longname;
54  libvlc_media_discoverer_category_t i_cat;
56 
57 /** \defgroup libvlc_media_discoverer LibVLC media discovery
58  * \ingroup libvlc
59  * LibVLC media discovery finds available media via various means.
60  * This corresponds to the service discovery functionality in VLC media player.
61  * Different plugins find potential medias locally (e.g. user media directory),
62  * from peripherals (e.g. video capture device), on the local network
63  * (e.g. SAP) or on the Internet (e.g. Internet radios).
64  * @{
65  * \file
66  * LibVLC media discovery external API
67  */
68 
70 
71 /**
72  * Create a media discoverer object by name.
73  *
74  * After this object is created, you should attach to media_list events in
75  * order to be notified of new items discovered.
76  *
77  * You need to call libvlc_media_discoverer_start() in order to start the
78  * discovery.
79  *
80  * \see libvlc_media_discoverer_media_list
81  * \see libvlc_media_discoverer_event_manager
82  * \see libvlc_media_discoverer_start
83  *
84  * \param p_inst libvlc instance
85  * \param psz_name service name; use libvlc_media_discoverer_list_get() to get
86  * a list of the discoverer names available in this libVLC instance
87  * \return media discover object or NULL in case of error
88  * \version LibVLC 3.0.0 or later
89  */
92  const char * psz_name );
93 
94 /**
95  * Start media discovery.
96  *
97  * To stop it, call libvlc_media_discoverer_stop() or
98  * libvlc_media_discoverer_list_release() directly.
99  *
100  * \see libvlc_media_discoverer_stop
101  *
102  * \param p_mdis media discover object
103  * \return -1 in case of error, 0 otherwise
104  * \version LibVLC 3.0.0 or later
105  */
106 LIBVLC_API int
108 
109 /**
110  * Stop media discovery.
111  *
112  * \see libvlc_media_discoverer_start
113  *
114  * \param p_mdis media discover object
115  * \version LibVLC 3.0.0 or later
116  */
117 LIBVLC_API void
119 
120 /**
121  * Release media discover object. If the reference count reaches 0, then
122  * the object will be released.
123  *
124  * \param p_mdis media service discover object
125  */
126 LIBVLC_API void
128 
129 /**
130  * Get media service discover media list.
131  *
132  * \param p_mdis media service discover object
133  * \return list of media items
134  */
137 
138 /**
139  * Query if media service discover object is running.
140  *
141  * \param p_mdis media service discover object
142  *
143  * \retval true running
144  * \retval false not running
145  */
146 LIBVLC_API bool
148 
149 /**
150  * Get media discoverer services by category
151  *
152  * \version LibVLC 3.0.0 and later.
153  *
154  * \param p_inst libvlc instance
155  * \param i_cat category of services to fetch
156  * \param ppp_services address to store an allocated array of media discoverer
157  * services (must be freed with libvlc_media_discoverer_list_release() by
158  * the caller) [OUT]
159  *
160  * \return the number of media discoverer services (0 on error)
161  */
162 LIBVLC_API size_t
164  libvlc_media_discoverer_category_t i_cat,
165  libvlc_media_discoverer_description_t ***ppp_services );
166 
167 /**
168  * Release an array of media discoverer services
169  *
170  * \version LibVLC 3.0.0 and later.
171  *
172  * \see libvlc_media_discoverer_list_get()
173  *
174  * \param pp_services array to release
175  * \param i_count number of elements in the array
176  */
177 LIBVLC_API void
179  size_t i_count );
180 
181 /**@} */
182 
183 # ifdef __cplusplus
184 }
185 # endif
186 
187 #endif /* <vlc/libvlc.h> */
Podcasts.
Definition: libvlc_media_discoverer.h:42
Local directories, like Video, Music or Pictures directories.
Definition: libvlc_media_discoverer.h:44
LIBVLC_API int libvlc_media_discoverer_start(libvlc_media_discoverer_t *p_mdis)
Start media discovery.
libvlc_media_discoverer_category_t
Category of a media discoverer.
Definition: libvlc_media_discoverer.h:36
#define LIBVLC_API
Definition: libvlc.h:42
libvlc_media_discoverer_category_t i_cat
Definition: libvlc_media_discoverer.h:54
LIBVLC_API libvlc_media_list_t * libvlc_media_discoverer_media_list(libvlc_media_discoverer_t *p_mdis)
Get media service discover media list.
Media discoverer description.
Definition: libvlc_media_discoverer.h:51
LIBVLC_API void libvlc_media_discoverer_stop(libvlc_media_discoverer_t *p_mdis)
Stop media discovery.
char * psz_name
Definition: libvlc_media_discoverer.h:52
char * psz_longname
Definition: libvlc_media_discoverer.h:53
LIBVLC_API bool libvlc_media_discoverer_is_running(libvlc_media_discoverer_t *p_mdis)
Query if media service discover object is running.
LIBVLC_API libvlc_media_discoverer_t * libvlc_media_discoverer_new(libvlc_instance_t *p_inst, const char *psz_name)
Create a media discoverer object by name.
LIBVLC_API void libvlc_media_discoverer_list_release(libvlc_media_discoverer_description_t **pp_services, size_t i_count)
Release an array of media discoverer services.
LIBVLC_API void libvlc_media_discoverer_release(libvlc_media_discoverer_t *p_mdis)
Release media discover object.
struct libvlc_instance_t libvlc_instance_t
This structure is opaque.
Definition: libvlc.h:76
struct libvlc_media_list_t libvlc_media_list_t
Definition: libvlc_media_list.h:38
LAN/WAN services, like Upnp, SMB, or SAP.
Definition: libvlc_media_discoverer.h:40
LIBVLC_API size_t libvlc_media_discoverer_list_get(libvlc_instance_t *p_inst, libvlc_media_discoverer_category_t i_cat, libvlc_media_discoverer_description_t ***ppp_services)
Get media discoverer services by category.
devices, like portable music player
Definition: libvlc_media_discoverer.h:38
struct libvlc_media_discoverer_t libvlc_media_discoverer_t
Definition: libvlc_media_discoverer.h:69
struct libvlc_media_discoverer_description_t libvlc_media_discoverer_description_t
Media discoverer description.