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 * \return 0 on success, -1 on error
67 VLC_PUBLIC_API int libvlc_vlm_add_broadcast( libvlc_instance_t *,
68 const char *, const char *,
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 * \param 0 on success, -1 on error
85 VLC_PUBLIC_API int libvlc_vlm_add_vod( libvlc_instance_t *,
86 const char *, const char *,
87 int, const char * const*,
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 *, const char * );
100 * Enable or disable a media (VOD or broadcast).
102 * \param p_instance the instance
103 * \param psz_name the media to work on
104 * \param b_enabled the new status
105 * \return 0 on success, -1 on error
107 VLC_PUBLIC_API int libvlc_vlm_set_enabled( libvlc_instance_t *, const char *,
111 * Set the output for a media.
113 * \param p_instance the instance
114 * \param psz_name the media to work on
115 * \param psz_output the output MRL (the parameter to the "sout" variable)
116 * \return 0 on success, -1 on error
118 VLC_PUBLIC_API int libvlc_vlm_set_output( libvlc_instance_t *, const char *,
122 * Set a media's input MRL. This will delete all existing inputs and
123 * add the specified one.
125 * \param p_instance the instance
126 * \param psz_name the media to work on
127 * \param psz_input the input MRL
128 * \return 0 on success, -1 on error
130 VLC_PUBLIC_API int libvlc_vlm_set_input( libvlc_instance_t *, const char *,
134 * Add a media's input MRL. This will add the specified one.
136 * \param p_instance the instance
137 * \param psz_name the media to work on
138 * \param psz_input the input MRL
139 * \return 0 on success, -1 on error
141 VLC_PUBLIC_API int libvlc_vlm_add_input( libvlc_instance_t *, const char *,
145 * Set a media's loop status.
147 * \param p_instance the instance
148 * \param psz_name the media to work on
149 * \param b_loop the new status
150 * \return 0 on success, -1 on error
152 VLC_PUBLIC_API int libvlc_vlm_set_loop( libvlc_instance_t *, const char *,
156 * Set a media's vod muxer.
158 * \param p_instance the instance
159 * \param psz_name the media to work on
160 * \param psz_mux the new muxer
161 * \return 0 on success, -1 on error
163 VLC_PUBLIC_API int libvlc_vlm_set_mux( libvlc_instance_t *, const char *,
167 * Edit the parameters of a media. This will delete all existing inputs and
168 * add the specified one.
170 * \param p_instance the instance
171 * \param psz_name the name of the new broadcast
172 * \param psz_input the input MRL
173 * \param psz_output the output MRL (the parameter to the "sout" variable)
174 * \param i_options number of additional options
175 * \param ppsz_options additional options
176 * \param b_enabled boolean for enabling the new broadcast
177 * \param b_loop Should this broadcast be played in loop ?
178 * \return 0 on success, -1 on error
180 VLC_PUBLIC_API int libvlc_vlm_change_media( libvlc_instance_t *,
181 const char *, const char *,
183 const char * const *, int, int );
186 * Play the named broadcast.
188 * \param p_instance the instance
189 * \param psz_name the name of the broadcast
190 * \return 0 on success, -1 on error
192 VLC_PUBLIC_API int libvlc_vlm_play_media ( libvlc_instance_t *, const char * );
195 * Stop the named broadcast.
197 * \param p_instance the instance
198 * \param psz_name the name of the broadcast
199 * \return 0 on success, -1 on error
201 VLC_PUBLIC_API int libvlc_vlm_stop_media ( libvlc_instance_t *, const char * );
204 * Pause the named broadcast.
206 * \param p_instance the instance
207 * \param psz_name the name of the broadcast
208 * \return 0 on success, -1 on error
210 VLC_PUBLIC_API int libvlc_vlm_pause_media( libvlc_instance_t *, const char * );
213 * Seek in the named broadcast.
215 * \param p_instance the instance
216 * \param psz_name the name of the broadcast
217 * \param f_percentage the percentage to seek to
218 * \return 0 on success, -1 on error
220 VLC_PUBLIC_API int libvlc_vlm_seek_media( libvlc_instance_t *, const char *,
224 * Return information about the named media as a JSON
225 * string representation.
227 * This function is mainly intended for debugging use,
228 * if you want programmatic access to the state of
229 * a vlm_media_instance_t, please use the corresponding
230 * libvlc_vlm_get_media_instance_xxx -functions.
231 * Currently there are no such functions available for
232 * vlm_media_t though.
234 * \param p_instance the instance
235 * \param psz_name the name of the media,
236 * if the name is an empty string, all media is described
237 * \return string with information about named media, or NULL on error
239 VLC_PUBLIC_API const char* libvlc_vlm_show_media( libvlc_instance_t *,
243 * Get vlm_media instance position by name or instance id
245 * \param p_instance a libvlc instance
246 * \param psz_name name of vlm media instance
247 * \param i_instance instance id
248 * \return position as float or -1. on error
250 VLC_PUBLIC_API float libvlc_vlm_get_media_instance_position( libvlc_instance_t *,
254 * Get vlm_media instance time 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 time as integer or -1 on error
261 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_time( libvlc_instance_t *,
265 * Get vlm_media instance length 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 length of media item or -1 on error
272 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_length( libvlc_instance_t *,
276 * Get vlm_media instance playback rate 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 playback rate or -1 on error
283 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_rate( libvlc_instance_t *,
287 * Get vlm_media instance title number by name or instance id
288 * \bug will always return 0
289 * \param p_instance a libvlc instance
290 * \param psz_name name of vlm media instance
291 * \param i_instance instance id
292 * \return title as number or -1 on error
294 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_title( libvlc_instance_t *,
298 * Get vlm_media instance chapter 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 chapter as number or -1 on error
305 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_chapter( libvlc_instance_t *,
309 * Is libvlc instance seekable ?
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 1 if seekable, 0 if not, -1 if media does not exist
316 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_seekable( libvlc_instance_t *,
320 * Get libvlc_event_manager from a vlm media.
321 * The p_event_manager is immutable, so you don't have to hold the lock
323 * \param p_instance a libvlc instance
324 * \return libvlc_event_manager
326 VLC_PUBLIC_API libvlc_event_manager_t *
327 libvlc_vlm_get_event_manager( libvlc_instance_t * );
335 #endif /* <vlc/libvlc_vlm.h> */