VLC 4.0.0-dev
Loading...
Searching...
No Matches
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
29extern "C" {
30# endif
31
33
34/**
35 * Category of a media discoverer
36 * \see libvlc_media_discoverer_list_get()
37 */
39 /** devices, like portable music player */
41 /** LAN/WAN services, like Upnp, SMB, or SAP */
43 /** Podcasts */
45 /** Local directories, like Video, Music or Pictures directories */
48
49/**
50 * Media discoverer description
51 * \see libvlc_media_discoverer_list_get()
52 */
58
59/** \defgroup libvlc_media_discoverer LibVLC media discovery
60 * \ingroup libvlc
61 * LibVLC media discovery finds available media via various means.
62 * This corresponds to the service discovery functionality in VLC media player.
63 * Different plugins find potential medias locally (e.g. user media directory),
64 * from peripherals (e.g. video capture device), on the local network
65 * (e.g. SAP) or on the Internet (e.g. Internet radios).
66 * @{
67 * \file
68 * LibVLC media discovery external API
69 */
70
72
73/**
74 * Create a media discoverer object by name.
75 *
76 * After this object is created, you should attach to media_list events in
77 * order to be notified of new items discovered.
78 *
79 * You need to call libvlc_media_discoverer_start() in order to start the
80 * discovery.
81 *
82 * \see libvlc_media_discoverer_media_list
83 * \see libvlc_media_discoverer_start
84 *
85 * \param p_inst libvlc instance
86 * \param psz_name service name; use libvlc_media_discoverer_list_get() to get
87 * a list of the discoverer names available in this libVLC instance
88 * \return media discover object or NULL in case of error
89 * \version LibVLC 3.0.0 or later
90 */
93 const char * psz_name );
94
95/**
96 * Start media discovery.
97 *
98 * To stop it, call libvlc_media_discoverer_stop() or
99 * libvlc_media_discoverer_list_release() directly.
100 *
101 * \see libvlc_media_discoverer_stop
102 *
103 * \param p_mdis media discover object
104 * \return -1 in case of error, 0 otherwise
105 * \version LibVLC 3.0.0 or later
106 */
107LIBVLC_API int
109
110/**
111 * Stop media discovery.
112 *
113 * \see libvlc_media_discoverer_start
114 *
115 * \param p_mdis media discover object
116 * \version LibVLC 3.0.0 or later
117 */
118LIBVLC_API void
120
121/**
122 * Release media discover object. If the reference count reaches 0, then
123 * the object will be released.
124 *
125 * \param p_mdis media service discover object
126 */
127LIBVLC_API void
129
130/**
131 * Get media service discover media list.
132 *
133 * \param p_mdis media service discover object
134 * \return list of media items
135 */
138
139/**
140 * Query if media service discover object is running.
141 *
142 * \param p_mdis media service discover object
143 *
144 * \retval true running
145 * \retval false not running
146 */
147LIBVLC_API bool
149
150/**
151 * Get media discoverer services by category
152 *
153 * \version LibVLC 3.0.0 and later.
154 *
155 * \param p_inst libvlc instance
156 * \param i_cat category of services to fetch
157 * \param ppp_services address to store an allocated array of media discoverer
158 * services (must be freed with libvlc_media_discoverer_list_release() by
159 * the caller) [OUT]
160 *
161 * \return the number of media discoverer services (0 on error)
162 */
163LIBVLC_API size_t
167
168/**
169 * Release an array of media discoverer services
170 *
171 * \version LibVLC 3.0.0 and later.
172 *
173 * \see libvlc_media_discoverer_list_get()
174 *
175 * \param pp_services array to release
176 * \param i_count number of elements in the array
177 */
178LIBVLC_API void
180 size_t i_count );
181
182/**@} */
183
184# ifdef __cplusplus
185}
186# endif
187
188#endif /* <vlc/libvlc.h> */
struct libvlc_instance_t libvlc_instance_t
This structure is opaque.
Definition libvlc.h:76
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_stop(libvlc_media_discoverer_t *p_mdis)
Stop media discovery.
LIBVLC_API int libvlc_media_discoverer_start(libvlc_media_discoverer_t *p_mdis)
Start media discovery.
LIBVLC_API void libvlc_media_discoverer_release(libvlc_media_discoverer_t *p_mdis)
Release media discover object.
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 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.
LIBVLC_API libvlc_media_list_t * libvlc_media_discoverer_media_list(libvlc_media_discoverer_t *p_mdis)
Get media service discover media list.
struct libvlc_media_discoverer_t libvlc_media_discoverer_t
Definition libvlc_media_discoverer.h:71
#define LIBVLC_API
Definition libvlc.h:42
struct libvlc_media_list_t libvlc_media_list_t
Definition libvlc_events.h:48
libvlc_media_discoverer_category_t
Category of a media discoverer.
Definition libvlc_media_discoverer.h:38
@ libvlc_media_discoverer_localdirs
Local directories, like Video, Music or Pictures directories.
Definition libvlc_media_discoverer.h:46
@ libvlc_media_discoverer_lan
LAN/WAN services, like Upnp, SMB, or SAP.
Definition libvlc_media_discoverer.h:42
@ libvlc_media_discoverer_podcasts
Podcasts.
Definition libvlc_media_discoverer.h:44
@ libvlc_media_discoverer_devices
devices, like portable music player
Definition libvlc_media_discoverer.h:40
Media discoverer description.
Definition libvlc_media_discoverer.h:53
char * psz_name
Definition libvlc_media_discoverer.h:54
char * psz_longname
Definition libvlc_media_discoverer.h:55
libvlc_media_discoverer_category_t i_cat
Definition libvlc_media_discoverer.h:56
const char * psz_name
Definition text_style.c:33