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 * );
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 * \param p_e an initialized exception pointer
67 VLC_PUBLIC_API void libvlc_vlm_add_broadcast( libvlc_instance_t *,
68 const char *, const char *,
72 libvlc_exception_t * );
75 * Add a vod, with one input.
77 * \param p_instance the instance
78 * \param psz_name the name of the new vod media
79 * \param psz_input the input MRL
80 * \param i_options number of additional options
81 * \param ppsz_options additional options
82 * \param b_enabled boolean for enabling the new vod
83 * \param psz_mux the muxer of the vod media
84 * \param p_e an initialized exception pointer
86 VLC_PUBLIC_API void libvlc_vlm_add_vod( libvlc_instance_t *,
87 const char *, const char *,
88 int, const char * const*,
90 libvlc_exception_t * );
93 * Delete a media (VOD or broadcast).
95 * \param p_instance the instance
96 * \param psz_name the media to delete
97 * \param p_e an initialized exception pointer
99 VLC_PUBLIC_API void libvlc_vlm_del_media( libvlc_instance_t *,
101 libvlc_exception_t * );
104 * Enable or disable a media (VOD or broadcast).
106 * \param p_instance the instance
107 * \param psz_name the media to work on
108 * \param b_enabled the new status
109 * \param p_e an initialized exception pointer
111 VLC_PUBLIC_API void libvlc_vlm_set_enabled( libvlc_instance_t *, const char *,
112 int, libvlc_exception_t * );
115 * Set the output for a media.
117 * \param p_instance the instance
118 * \param psz_name the media to work on
119 * \param psz_output the output MRL (the parameter to the "sout" variable)
120 * \param p_e an initialized exception pointer
122 VLC_PUBLIC_API void libvlc_vlm_set_output( libvlc_instance_t *, const char *,
124 libvlc_exception_t * );
127 * Set a media's input MRL. This will delete all existing inputs and
128 * add the specified one.
130 * \param p_instance the instance
131 * \param psz_name the media to work on
132 * \param psz_input the input MRL
133 * \param p_e an initialized exception pointer
135 VLC_PUBLIC_API void libvlc_vlm_set_input( libvlc_instance_t *, const char *,
137 libvlc_exception_t * );
140 * Add a media's input MRL. This will add the specified one.
142 * \param p_instance the instance
143 * \param psz_name the media to work on
144 * \param psz_input the input MRL
145 * \param p_e an initialized exception pointer
147 VLC_PUBLIC_API void libvlc_vlm_add_input( libvlc_instance_t *, const char *,
149 libvlc_exception_t * );
151 * Set a media's loop status.
153 * \param p_instance the instance
154 * \param psz_name the media to work on
155 * \param b_loop the new status
156 * \param p_e an initialized exception pointer
158 VLC_PUBLIC_API void libvlc_vlm_set_loop( libvlc_instance_t *, const char *,
159 int, libvlc_exception_t * );
162 * Set a media's vod muxer.
164 * \param p_instance the instance
165 * \param psz_name the media to work on
166 * \param psz_mux the new muxer
167 * \param p_e an initialized exception pointer
169 VLC_PUBLIC_API void libvlc_vlm_set_mux( libvlc_instance_t *, const char *,
170 const char *, libvlc_exception_t * );
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 * \param p_e an initialized exception pointer
186 VLC_PUBLIC_API void libvlc_vlm_change_media( libvlc_instance_t *,
187 const char *, const char *,
189 const char * const *, int, int,
190 libvlc_exception_t * );
193 * Play the named broadcast.
195 * \param p_instance the instance
196 * \param psz_name the name of the broadcast
197 * \param p_e an initialized exception pointer
199 VLC_PUBLIC_API void libvlc_vlm_play_media ( libvlc_instance_t *, const char *,
200 libvlc_exception_t * );
203 * Stop the named broadcast.
205 * \param p_instance the instance
206 * \param psz_name the name of the broadcast
207 * \param p_e an initialized exception pointer
209 VLC_PUBLIC_API void libvlc_vlm_stop_media ( libvlc_instance_t *, const char *,
210 libvlc_exception_t * );
213 * Pause the named broadcast.
215 * \param p_instance the instance
216 * \param psz_name the name of the broadcast
217 * \param p_e an initialized exception pointer
219 VLC_PUBLIC_API void libvlc_vlm_pause_media( libvlc_instance_t *, const char *,
220 libvlc_exception_t * );
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 * \param p_e an initialized exception pointer
230 VLC_PUBLIC_API void libvlc_vlm_seek_media( libvlc_instance_t *, const char *,
231 float, libvlc_exception_t * );
234 * Return information about the named media as a JSON
235 * string representation.
237 * This function is mainly intended for debugging use,
238 * if you want programmatic access to the state of
239 * a vlm_media_instance_t, please use the corresponding
240 * libvlc_vlm_get_media_instance_xxx -functions.
241 * Currently there are no such functions available for
242 * vlm_media_t though.
244 * \param p_instance the instance
245 * \param psz_name the name of the media,
246 * if the name is an empty string, all media is described
247 * \param p_e an initialized exception pointer
248 * \return string with information about named media
250 VLC_PUBLIC_API const char* libvlc_vlm_show_media( libvlc_instance_t *, const char *,
251 libvlc_exception_t * );
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 *,
265 * Get vlm_media instance time by name or instance id
267 * \param p_instance a libvlc instance
268 * \param psz_name name of vlm media instance
269 * \param i_instance instance id
270 * \return time as integer or -1 on error
272 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_time( libvlc_instance_t *,
276 * Get vlm_media instance length by name or instance id
278 * \param p_instance a libvlc instance
279 * \param psz_name name of vlm media instance
280 * \param i_instance instance id
281 * \return length of media item or -1 on error
283 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_length( libvlc_instance_t *,
287 * Get vlm_media instance playback rate by name or instance id
289 * \param p_instance a libvlc instance
290 * \param psz_name name of vlm media instance
291 * \param i_instance instance id
292 * \return playback rate or -1 on error
294 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_rate( libvlc_instance_t *,
298 * Get vlm_media instance title number by name or instance id
299 * \bug will always return 0
300 * \param p_instance a libvlc instance
301 * \param psz_name name of vlm media instance
302 * \param i_instance instance id
303 * \return title as number or -1 on error
305 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_title( libvlc_instance_t *,
309 * Get vlm_media instance chapter number by name or instance id
310 * \bug will always return 0
311 * \param p_instance a libvlc instance
312 * \param psz_name name of vlm media instance
313 * \param i_instance instance id
314 * \return chapter as number or -1 on error
316 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_chapter( libvlc_instance_t *,
320 * Is libvlc instance seekable ?
321 * \bug will always return 0
322 * \param p_instance a libvlc instance
323 * \param psz_name name of vlm media instance
324 * \param i_instance instance id
325 * \return 1 if seekable, 0 if not, -1 if media does not exist
327 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_seekable( libvlc_instance_t *,
331 * Get libvlc_event_manager from a vlm media.
332 * The p_event_manager is immutable, so you don't have to hold the lock
334 * \param p_instance a libvlc instance
335 * \return libvlc_event_manager
337 VLC_PUBLIC_API libvlc_event_manager_t *
338 libvlc_vlm_get_event_manager( libvlc_instance_t * );
346 #endif /* <vlc/libvlc_vlm.h> */