1 /*****************************************************************************
2 * libvlc_vlm.h: libvlc_* new external API
3 *****************************************************************************
4 * Copyright (C) 1998-2008 the VideoLAN team
7 * Authors: Clément Stenac <zorglub@videolan.org>
8 * Jean-Paul Saman <jpsaman _at_ m2x _dot_ nl>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
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 General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
26 #define LIBVLC_VLM_H 1
30 * This file defines libvlc_vlm_* external API
37 /*****************************************************************************
39 *****************************************************************************/
40 /** \defgroup libvlc_vlm libvlc_vlm
48 * Release the vlm instance related to the given libvlc_instance_t
50 * \param p_instance the instance
52 VLC_PUBLIC_API void libvlc_vlm_release( libvlc_instance_t *p_instance );
55 * Add a broadcast, with one input.
57 * \param p_instance the instance
58 * \param psz_name the name of the new broadcast
59 * \param psz_input the input MRL
60 * \param psz_output the output MRL (the parameter to the "sout" variable)
61 * \param i_options number of additional options
62 * \param ppsz_options additional options
63 * \param b_enabled boolean for enabling the new broadcast
64 * \param b_loop Should this broadcast be played in loop ?
65 * \return 0 on success, -1 on error
67 VLC_PUBLIC_API int libvlc_vlm_add_broadcast( libvlc_instance_t *p_instance,
68 const char *psz_name, const char *psz_input,
69 const char *psz_output, int i_options,
70 const char * const* ppsz_options,
71 int b_enabled, int b_loop );
74 * Add a vod, with one input.
76 * \param p_instance the instance
77 * \param psz_name the name of the new vod media
78 * \param psz_input the input MRL
79 * \param i_options number of additional options
80 * \param ppsz_options additional options
81 * \param b_enabled boolean for enabling the new vod
82 * \param psz_mux the muxer of the vod media
83 * \return 0 on success, -1 on error
85 VLC_PUBLIC_API int libvlc_vlm_add_vod( libvlc_instance_t * p_instance,
86 const char *psz_name, const char *psz_input,
87 int i_options, const char * const* ppsz_options,
88 int b_enabled, const char *psz_mux );
91 * Delete a media (VOD or broadcast).
93 * \param p_instance the instance
94 * \param psz_name the media to delete
95 * \return 0 on success, -1 on error
97 VLC_PUBLIC_API int libvlc_vlm_del_media( libvlc_instance_t * p_instance,
98 const char *psz_name );
101 * Enable or disable a media (VOD or broadcast).
103 * \param p_instance the instance
104 * \param psz_name the media to work on
105 * \param b_enabled the new status
106 * \return 0 on success, -1 on error
108 VLC_PUBLIC_API int libvlc_vlm_set_enabled( libvlc_instance_t *p_instance,
109 const char *psz_name, int b_enabled );
112 * Set the output for a media.
114 * \param p_instance the instance
115 * \param psz_name the media to work on
116 * \param psz_output the output MRL (the parameter to the "sout" variable)
117 * \return 0 on success, -1 on error
119 VLC_PUBLIC_API int libvlc_vlm_set_output( libvlc_instance_t *p_instance,
120 const char *psz_name,
121 const char *psz_output );
124 * Set a media's input MRL. This will delete all existing inputs and
125 * add the specified one.
127 * \param p_instance the instance
128 * \param psz_name the media to work on
129 * \param psz_input the input MRL
130 * \return 0 on success, -1 on error
132 VLC_PUBLIC_API int libvlc_vlm_set_input( libvlc_instance_t *p_instance,
133 const char *psz_name,
134 const char *psz_input );
137 * Add a media's input MRL. This will add the specified one.
139 * \param p_instance the instance
140 * \param psz_name the media to work on
141 * \param psz_input the input MRL
142 * \return 0 on success, -1 on error
144 VLC_PUBLIC_API int libvlc_vlm_add_input( libvlc_instance_t *p_instance,
145 const char *psz_name,
146 const char *psz_input );
149 * Set a media's loop status.
151 * \param p_instance the instance
152 * \param psz_name the media to work on
153 * \param b_loop the new status
154 * \return 0 on success, -1 on error
156 VLC_PUBLIC_API int libvlc_vlm_set_loop( libvlc_instance_t *p_instance,
157 const char *psz_name,
161 * Set a media's vod muxer.
163 * \param p_instance the instance
164 * \param psz_name the media to work on
165 * \param psz_mux the new muxer
166 * \return 0 on success, -1 on error
168 VLC_PUBLIC_API int libvlc_vlm_set_mux( libvlc_instance_t *p_instance,
169 const char *psz_name,
170 const char *psz_mux );
173 * Edit the parameters of a media. This will delete all existing inputs and
174 * add the specified one.
176 * \param p_instance the instance
177 * \param psz_name the name of the new broadcast
178 * \param psz_input the input MRL
179 * \param psz_output the output MRL (the parameter to the "sout" variable)
180 * \param i_options number of additional options
181 * \param ppsz_options additional options
182 * \param b_enabled boolean for enabling the new broadcast
183 * \param b_loop Should this broadcast be played in loop ?
184 * \return 0 on success, -1 on error
186 VLC_PUBLIC_API int libvlc_vlm_change_media( libvlc_instance_t *p_instance,
187 const char *psz_name, const char *psz_input,
188 const char *psz_output, int i_options,
189 const char * const *ppsz_options,
190 int b_enabled, int b_loop );
193 * Play the named broadcast.
195 * \param p_instance the instance
196 * \param psz_name the name of the broadcast
197 * \return 0 on success, -1 on error
199 VLC_PUBLIC_API int libvlc_vlm_play_media ( libvlc_instance_t *p_instance,
200 const char *psz_name );
203 * Stop the named broadcast.
205 * \param p_instance the instance
206 * \param psz_name the name of the broadcast
207 * \return 0 on success, -1 on error
209 VLC_PUBLIC_API int libvlc_vlm_stop_media ( libvlc_instance_t *p_instance,
210 const char *psz_name );
213 * Pause the named broadcast.
215 * \param p_instance the instance
216 * \param psz_name the name of the broadcast
217 * \return 0 on success, -1 on error
219 VLC_PUBLIC_API int libvlc_vlm_pause_media( libvlc_instance_t *p_instance,
220 const char *psz_name );
223 * Seek in the named broadcast.
225 * \param p_instance the instance
226 * \param psz_name the name of the broadcast
227 * \param f_percentage the percentage to seek to
228 * \return 0 on success, -1 on error
230 VLC_PUBLIC_API int libvlc_vlm_seek_media( libvlc_instance_t *p_instance,
231 const char *psz_name,
232 float f_percentage );
235 * Return information about the named media as a JSON
236 * string representation.
238 * This function is mainly intended for debugging use,
239 * if you want programmatic access to the state of
240 * a vlm_media_instance_t, please use the corresponding
241 * libvlc_vlm_get_media_instance_xxx -functions.
242 * Currently there are no such functions available for
243 * vlm_media_t though.
245 * \param p_instance the instance
246 * \param psz_name the name of the media,
247 * if the name is an empty string, all media is described
248 * \return string with information about named media, or NULL on error
250 VLC_PUBLIC_API const char* libvlc_vlm_show_media( libvlc_instance_t *p_instance,
251 const char *psz_name );
254 * Get vlm_media instance position by name or instance id
256 * \param p_instance a libvlc instance
257 * \param psz_name name of vlm media instance
258 * \param i_instance instance id
259 * \return position as float or -1. on error
261 VLC_PUBLIC_API float libvlc_vlm_get_media_instance_position( libvlc_instance_t *p_instance,
262 const char *psz_name,
266 * Get vlm_media instance time by name or instance id
268 * \param p_instance a libvlc instance
269 * \param psz_name name of vlm media instance
270 * \param i_instance instance id
271 * \return time as integer or -1 on error
273 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_time( libvlc_instance_t *p_instance,
274 const char *psz_name,
278 * Get vlm_media instance length by name or instance id
280 * \param p_instance a libvlc instance
281 * \param psz_name name of vlm media instance
282 * \param i_instance instance id
283 * \return length of media item or -1 on error
285 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_length( libvlc_instance_t *p_instance,
286 const char *psz_name,
290 * Get vlm_media instance playback rate by name or instance id
292 * \param p_instance a libvlc instance
293 * \param psz_name name of vlm media instance
294 * \param i_instance instance id
295 * \return playback rate or -1 on error
297 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_rate( libvlc_instance_t *p_instance,
298 const char *psz_name,
302 * Get vlm_media instance title number by name or instance id
303 * \bug will always return 0
304 * \param p_instance a libvlc instance
305 * \param psz_name name of vlm media instance
306 * \param i_instance instance id
307 * \return title as number or -1 on error
309 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_title( libvlc_instance_t *,
313 * Get vlm_media instance chapter number by name or instance id
314 * \bug will always return 0
315 * \param p_instance a libvlc instance
316 * \param psz_name name of vlm media instance
317 * \param i_instance instance id
318 * \return chapter as number or -1 on error
320 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_chapter( libvlc_instance_t *,
324 * Is libvlc instance seekable ?
325 * \bug will always return 0
326 * \param p_instance a libvlc instance
327 * \param psz_name name of vlm media instance
328 * \param i_instance instance id
329 * \return 1 if seekable, 0 if not, -1 if media does not exist
331 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_seekable( libvlc_instance_t *,
335 * Get libvlc_event_manager from a vlm media.
336 * The p_event_manager is immutable, so you don't have to hold the lock
338 * \param p_instance a libvlc instance
339 * \return libvlc_event_manager
341 VLC_PUBLIC_API libvlc_event_manager_t *
342 libvlc_vlm_get_event_manager( libvlc_instance_t *p_instance );
350 #endif /* <vlc/libvlc_vlm.h> */