]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_vlm.h
libvlc: fix doxygen documentation
[vlc] / include / vlc / libvlc_vlm.h
1 /*****************************************************************************
2  * libvlc_vlm.h:  libvlc_* new external API
3  *****************************************************************************
4  * Copyright (C) 1998-2008 the VideoLAN team
5  * $Id$
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  *          Jean-Paul Saman <jpsaman _at_ m2x _dot_ nl>
9  *
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.
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 General Public License for more details.
19  *
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  *****************************************************************************/
24
25 #ifndef LIBVLC_VLM_H
26 #define LIBVLC_VLM_H 1
27
28 /**
29  * \file
30  * This file defines libvlc_vlm_* external API
31  */
32
33 # ifdef __cplusplus
34 extern "C" {
35 # endif
36
37 /*****************************************************************************
38  * VLM
39  *****************************************************************************/
40 /** \defgroup libvlc_vlm libvlc_vlm
41  * \ingroup libvlc
42  * LibVLC VLM
43  * @{
44  */
45
46
47 /**
48  * Release the vlm instance related to the given libvlc_instance_t
49  *
50  * \param p_instance the instance
51  */
52 VLC_PUBLIC_API void libvlc_vlm_release( libvlc_instance_t *p_instance );
53
54 /**
55  * Add a broadcast, with one input.
56  *
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
66  */
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 );
72
73 /**
74  * Add a vod, with one input.
75  *
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
84  */
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 );
89
90 /**
91  * Delete a media (VOD or broadcast).
92  *
93  * \param p_instance the instance
94  * \param psz_name the media to delete
95  * \return 0 on success, -1 on error
96  */
97 VLC_PUBLIC_API int libvlc_vlm_del_media( libvlc_instance_t * p_instance,
98                                          const char *psz_name );
99
100 /**
101  * Enable or disable a media (VOD or broadcast).
102  *
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
107  */
108 VLC_PUBLIC_API int libvlc_vlm_set_enabled( libvlc_instance_t *p_instance,
109                                            const char *psz_name, int b_enabled );
110
111 /**
112  * Set the output for a media.
113  *
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
118  */
119 VLC_PUBLIC_API int libvlc_vlm_set_output( libvlc_instance_t *p_instance,
120                                           const char *psz_name,
121                                           const char *psz_output );
122
123 /**
124  * Set a media's input MRL. This will delete all existing inputs and
125  * add the specified one.
126  *
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
131  */
132 VLC_PUBLIC_API int libvlc_vlm_set_input( libvlc_instance_t *p_instance,
133                                          const char *psz_name,
134                                          const char *psz_input );
135
136 /**
137  * Add a media's input MRL. This will add the specified one.
138  *
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
143  */
144 VLC_PUBLIC_API int libvlc_vlm_add_input( libvlc_instance_t *p_instance,
145                                          const char *psz_name,
146                                          const char *psz_input );
147
148 /**
149  * Set a media's loop status.
150  *
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
155  */
156 VLC_PUBLIC_API int libvlc_vlm_set_loop( libvlc_instance_t *p_instance,
157                                         const char *psz_name,
158                                         int b_loop );
159
160 /**
161  * Set a media's vod muxer.
162  *
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
167  */
168 VLC_PUBLIC_API int libvlc_vlm_set_mux( libvlc_instance_t *p_instance,
169                                        const char *psz_name,
170                                        const char *psz_mux );
171
172 /**
173  * Edit the parameters of a media. This will delete all existing inputs and
174  * add the specified one.
175  *
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
185  */
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 );
191
192 /**
193  * Play the named broadcast.
194  *
195  * \param p_instance the instance
196  * \param psz_name the name of the broadcast
197  * \return 0 on success, -1 on error
198  */
199 VLC_PUBLIC_API int libvlc_vlm_play_media ( libvlc_instance_t *p_instance,
200                                            const char *psz_name );
201
202 /**
203  * Stop the named broadcast.
204  *
205  * \param p_instance the instance
206  * \param psz_name the name of the broadcast
207  * \return 0 on success, -1 on error
208  */
209 VLC_PUBLIC_API int libvlc_vlm_stop_media ( libvlc_instance_t *p_instance,
210                                            const char *psz_name );
211
212 /**
213  * Pause the named broadcast.
214  *
215  * \param p_instance the instance
216  * \param psz_name the name of the broadcast
217  * \return 0 on success, -1 on error
218  */
219 VLC_PUBLIC_API int libvlc_vlm_pause_media( libvlc_instance_t *p_instance,
220                                            const char *psz_name );
221
222 /**
223  * Seek in the named broadcast.
224  *
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
229  */
230 VLC_PUBLIC_API int libvlc_vlm_seek_media( libvlc_instance_t *p_instance,
231                                           const char *psz_name,
232                                           float f_percentage );
233
234 /**
235  * Return information about the named media as a JSON
236  * string representation.
237  *
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.
244  *
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
249  */
250 VLC_PUBLIC_API const char* libvlc_vlm_show_media( libvlc_instance_t *p_instance,
251                                                   const char *psz_name );
252
253 /**
254  * Get vlm_media instance position by name or instance id
255  *
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
260  */
261 VLC_PUBLIC_API float libvlc_vlm_get_media_instance_position( libvlc_instance_t *p_instance,
262                                                              const char *psz_name,
263                                                              int i_instance );
264
265 /**
266  * Get vlm_media instance time by name or instance id
267  *
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
272  */
273 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_time( libvlc_instance_t *p_instance,
274                                                        const char *psz_name,
275                                                        int i_instance );
276
277 /**
278  * Get vlm_media instance length by name or instance id
279  *
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
284  */
285 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_length( libvlc_instance_t *p_instance,
286                                                          const char *psz_name,
287                                                          int i_instance );
288
289 /**
290  * Get vlm_media instance playback rate by name or instance id
291  *
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
296  */
297 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_rate( libvlc_instance_t *p_instance,
298                                                        const char *psz_name,
299                                                        int i_instance );
300 #if 0
301 /**
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
308  */
309 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_title( libvlc_instance_t *,
310                                                         const char *, int );
311
312 /**
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
319  */
320 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_chapter( libvlc_instance_t *,
321                                                           const char *, int );
322
323 /**
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
330  */
331 VLC_PUBLIC_API int libvlc_vlm_get_media_instance_seekable( libvlc_instance_t *,
332                                                            const char *, int );
333 #endif
334 /**
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
337  *
338  * \param p_instance a libvlc instance
339  * \return libvlc_event_manager
340  */
341 VLC_PUBLIC_API libvlc_event_manager_t *
342     libvlc_vlm_get_event_manager( libvlc_instance_t *p_instance );
343
344 /** @} */
345
346 # ifdef __cplusplus
347 }
348 # endif
349
350 #endif /* <vlc/libvlc_vlm.h> */