]> git.sesse.net Git - vlc/blob - include/vlc/libvlc.h
control/media_descriptor: Implement libvlc_media_descriptor_get_mrl.
[vlc] / include / vlc / libvlc.h
1 /*****************************************************************************
2  * libvlc.h:  libvlc_* new external API
3  *****************************************************************************
4  * Copyright (C) 1998-2005 the VideoLAN team
5  * $Id: vlc.h 13701 2005-12-12 17:58:56Z zorglub $
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 /**
26  * \defgroup libvlc Libvlc
27  * This is libvlc, the base library of the VLC program.
28  *
29  * @{
30  */
31
32
33 #ifndef _LIBVLC_H
34 #define _LIBVLC_H 1
35
36 #include <vlc/vlc.h>
37 #include <vlc/libvlc_structures.h>
38
39 # ifdef __cplusplus
40 extern "C" {
41 # endif
42
43 /*****************************************************************************
44  * Exception handling
45  *****************************************************************************/
46 /** defgroup libvlc_exception Exceptions
47  * \ingroup libvlc
48  * LibVLC Exceptions handling
49  * @{
50  */
51
52 /**
53  * Initialize an exception structure. This can be called several times to reuse
54  * an exception structure.
55  * \param p_exception the exception to initialize
56  */
57 VLC_PUBLIC_API void libvlc_exception_init( libvlc_exception_t *p_exception );
58
59 /**
60  * Has an exception been raised ?
61  * \param p_exception the exception to query
62  * \return 0 if no exception raised, 1 else
63  */
64 VLC_PUBLIC_API int libvlc_exception_raised( libvlc_exception_t *p_exception );
65
66 /**
67  * Raise an exception
68  * \param p_exception the exception to raise
69  * \param psz_message the exception message
70  */
71 VLC_PUBLIC_API void libvlc_exception_raise( libvlc_exception_t *p_exception, const char *psz_format, ... );
72
73 /**
74  * Clear an exception object so it can be reused.
75  * The exception object must be initialized
76  * \param p_exception the exception to clear
77  */
78 VLC_PUBLIC_API void libvlc_exception_clear( libvlc_exception_t * );
79
80 /**
81  * Get exception message
82  * \param p_exception the exception to query
83  * \return the exception message or NULL if not applicable (exception not raised
84  * for example)
85  */
86 VLC_PUBLIC_API char* libvlc_exception_get_message( libvlc_exception_t *p_exception );
87
88 /**@} */
89
90 /*****************************************************************************
91  * Core handling
92  *****************************************************************************/
93
94 /** defgroup libvlc_core Core
95  * \ingroup libvlc
96  * LibVLC Core
97  * @{
98  */
99
100 /**
101  * Create an initialized libvlc instance
102  * \param argc the number of arguments
103  * \param argv command-line-type arguments
104  * \param exception an initialized exception pointer
105  */
106 VLC_PUBLIC_API libvlc_instance_t * libvlc_new( int , char **, libvlc_exception_t *);
107
108 /**
109  * Returns a libvlc instance identifier for legacy APIs. Use of this
110  * function is discouraged, you should convert your program to use the
111  * new API.
112  * \param p_instance the instance
113  */
114 VLC_PUBLIC_API int libvlc_get_vlc_id( libvlc_instance_t *p_instance );
115
116 /**
117  * Destroy a libvlc instance.
118  * \param p_instance the instance to destroy
119  */
120 VLC_PUBLIC_API void libvlc_destroy( libvlc_instance_t *, libvlc_exception_t * );
121
122 /** @}*/
123
124
125 /*****************************************************************************
126  * Media descriptor
127  *****************************************************************************/
128 /** defgroup libvlc_media_descriptor Media Descriptor
129  * \ingroup libvlc
130  * LibVLC Media Descriptor
131  * @{
132  */
133  
134 /**
135  * Create a media descriptor with the given mrl.
136  * \param p_instance the instance
137  * \param psz_mrl the mrl to read
138  */
139 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_descriptor_new(
140                                    libvlc_instance_t *p_instance,
141                                    const char * psz_mrl,
142                                    libvlc_exception_t *p_e );
143
144 VLC_PUBLIC_API void libvlc_media_descriptor_retain(
145                                    libvlc_media_descriptor_t *p_meta_desc );
146
147 VLC_PUBLIC_API void libvlc_media_descriptor_release(
148                                    libvlc_media_descriptor_t *p_meta_desc );
149
150 VLC_PUBLIC_API char * libvlc_media_descriptor_get_mrl( libvlc_media_descriptor_t * p_md,
151                                                        libvlc_exception_t * p_e );
152
153 /**
154  * Read the meta of the media descriptor.
155  * \param p_meta_desc the media descriptor to read
156  * \param p_meta_desc the meta to read
157  */
158 VLC_PUBLIC_API char * libvlc_media_descriptor_get_meta(
159                                    libvlc_media_descriptor_t *p_meta_desc,
160                                    libvlc_meta_t e_meta,
161                                    libvlc_exception_t *p_e );
162
163 /** @}*/
164
165 /*****************************************************************************
166  * Playlist
167  *****************************************************************************/
168 /** defgroup libvlc_playlist Playlist
169  * \ingroup libvlc
170  * LibVLC Playlist handling
171  * @{
172  */
173
174 /**
175  * Set loop variable
176  */
177 VLC_PUBLIC_API void libvlc_playlist_loop( libvlc_instance_t* , vlc_bool_t,
178                                           libvlc_exception_t * );
179
180 /**
181  * Start playing. You can give some additionnal playlist item options
182  * that will be added to the item before playing it.
183  * \param p_instance the instance
184  * \param i_id the item to play. If this is a negative number, the next
185  * item will be selected. Else, the item with the given ID will be played
186  * \param i_options the number of options to add to the item
187  * \param ppsz_options the options to add to the item
188  * \param p_exception an initialized exception
189  */
190 VLC_PUBLIC_API void libvlc_playlist_play( libvlc_instance_t*, int, int, char **,
191                                           libvlc_exception_t * );
192
193 /**
194  * Pause a running playlist, resume if it was stopped
195  * \param p_instance the instance to pause
196  * \param p_exception an initialized exception
197  */
198 VLC_PUBLIC_API void libvlc_playlist_pause( libvlc_instance_t *, libvlc_exception_t * );
199
200 /**
201  * Checks if the playlist is running
202  * \param p_instance the instance
203  * \param p_exception an initialized exception
204  * \return 0 if the playlist is stopped or paused, 1 if it is running
205  */
206 VLC_PUBLIC_API int libvlc_playlist_isplaying( libvlc_instance_t *, libvlc_exception_t * );
207
208 /**
209  * Get the number of items in the playlist
210  * \param p_instance the instance
211  * \param p_exception an initialized exception
212  * \return the number of items
213  */
214 VLC_PUBLIC_API int libvlc_playlist_items_count( libvlc_instance_t *, libvlc_exception_t * );
215
216 /**
217  * Lock the playlist instance
218  * \param p_instance the instance
219  */
220 VLC_PUBLIC_API void libvlc_playlist_lock( libvlc_instance_t * );
221
222 /**
223  * Unlock the playlist instance
224  * \param p_instance the instance
225  */
226 VLC_PUBLIC_API void libvlc_playlist_unlock( libvlc_instance_t * );
227
228 /**
229  * Stop playing
230  * \param p_instance the instance to stop
231  * \param p_exception an initialized exception
232  */
233 VLC_PUBLIC_API void libvlc_playlist_stop( libvlc_instance_t *, libvlc_exception_t * );
234
235 /**
236  * Go to next playlist item (starts playback if it was stopped)
237  * \param p_instance the instance to use
238  * \param p_exception an initialized exception
239  */
240 VLC_PUBLIC_API void libvlc_playlist_next( libvlc_instance_t *, libvlc_exception_t * );
241
242 /**
243  * Go to previous playlist item (starts playback if it was stopped)
244  * \param p_instance the instance to use
245  * \param p_exception an initialized exception
246  */
247 VLC_PUBLIC_API void libvlc_playlist_prev( libvlc_instance_t *, libvlc_exception_t * );
248
249 /**
250  * Remove all playlist items
251  * \param p_instance the instance
252  * \param p_exception an initialized exception
253  */
254 VLC_PUBLIC_API void libvlc_playlist_clear( libvlc_instance_t *, libvlc_exception_t * );
255
256 /**
257  * Add an item at the end of the playlist
258  * If you need more advanced options, \see libvlc_playlist_add_extended
259  * \param p_instance the instance
260  * \param psz_uri the URI to open, using VLC format
261  * \param psz_name a name that you might want to give or NULL
262  * \return the identifier of the new item
263  */
264 VLC_PUBLIC_API int libvlc_playlist_add( libvlc_instance_t *, const char *, const char *,
265                                         libvlc_exception_t * );
266
267 /**
268  * Add an item at the end of the playlist, with additional input options
269  * \param p_instance the instance
270  * \param psz_uri the URI to open, using VLC format
271  * \param psz_name a name that you might want to give or NULL
272  * \param i_options the number of options to add
273  * \param ppsz_options strings representing the options to add
274  * \param p_exception an initialized exception
275  * \return the identifier of the new item
276  */
277 VLC_PUBLIC_API int libvlc_playlist_add_extended( libvlc_instance_t *, const char *,
278                                                  const char *, int, const char **,
279                                                  libvlc_exception_t * );
280
281 /**
282  * Delete the playlist item with the given ID.
283  * \param p_instance the instance
284  * \param i_id the id to remove
285  * \param p_exception an initialized exception
286  * \return
287  */
288 VLC_PUBLIC_API int libvlc_playlist_delete_item( libvlc_instance_t *, int,
289                                                 libvlc_exception_t * );
290
291 /* Get the input that is currently being played by the playlist
292  * \param p_instance the instance to use
293  * \param p_exception an initialized excecption
294  * \return an input object
295  */
296 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_playlist_get_media_instance(
297                                 libvlc_instance_t *, libvlc_exception_t * );
298
299 /** @}*/
300
301 /*****************************************************************************
302  * Media Instance
303  *****************************************************************************/
304 /** defgroup libvlc_media_instance Media Instance
305  * \ingroup libvlc
306  * LibVLC Media Instance
307  * @{
308  */
309
310 /** Create an empty Media Instance object
311  * \param p_libvlc_instance the libvlc instance in which the Media Instance
312  * should be (not used for now).
313  */
314 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new( libvlc_instance_t *, libvlc_exception_t * );
315
316 /** Create a Media Instance object from a Media Descriptor
317  * \param p_md the media descriptor. Afterwards the p_md can safely be
318  * destroyed.
319  */
320 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new_from_media_descriptor( libvlc_media_descriptor_t *, libvlc_exception_t * );
321
322 /** Release a media_instance after use
323  * \param p_mi the Media Instance to free
324  */
325 VLC_PUBLIC_API void libvlc_media_instance_release( libvlc_media_instance_t * );
326 VLC_PUBLIC_API void libvlc_media_instance_retain( libvlc_media_instance_t * );
327
328 /** Set the media descriptor that will be used by the media_instance. If any,
329  * previous md will be released.
330  * \param p_mi the Media Instance 
331  * \param p_md the Media Descriptor. Afterwards the p_md can safely be
332  * destroyed.
333  */
334 VLC_PUBLIC_API void libvlc_media_instance_set_media_descriptor( libvlc_media_instance_t *, libvlc_media_descriptor_t *, libvlc_exception_t * );
335
336 /** Get the media descriptor used by the media_instance (if any). A copy of
337  * the md is returned. NULL is returned if no media instance is associated.
338  * \param p_mi the Media Instance 
339  */
340 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_instance_get_media_descriptor( libvlc_media_instance_t *, libvlc_exception_t * );
341
342 /** Get the Event Manager from which the media instance send event.
343  * \param p_mi the Media Instance 
344  */
345 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_instance_event_manager ( libvlc_media_instance_t *, libvlc_exception_t * );
346
347 VLC_PUBLIC_API void libvlc_media_instance_play ( libvlc_media_instance_t *, libvlc_exception_t * );
348 VLC_PUBLIC_API void libvlc_media_instance_pause ( libvlc_media_instance_t *, libvlc_exception_t * );
349 VLC_PUBLIC_API void libvlc_media_instance_stop ( libvlc_media_instance_t *, libvlc_exception_t * );
350
351 /// \bug This might go away ... to be replaced by a broader system
352 VLC_PUBLIC_API vlc_int64_t libvlc_media_instance_get_length     ( libvlc_media_instance_t *, libvlc_exception_t *);
353 VLC_PUBLIC_API vlc_int64_t libvlc_media_instance_get_time       ( libvlc_media_instance_t *, libvlc_exception_t *);
354 VLC_PUBLIC_API void        libvlc_media_instance_set_time       ( libvlc_media_instance_t *, vlc_int64_t, libvlc_exception_t *);
355 VLC_PUBLIC_API float       libvlc_media_instance_get_position   ( libvlc_media_instance_t *, libvlc_exception_t *);
356 VLC_PUBLIC_API void        libvlc_media_instance_set_position   ( libvlc_media_instance_t *, float, libvlc_exception_t *);
357 VLC_PUBLIC_API vlc_bool_t  libvlc_media_instance_will_play      ( libvlc_media_instance_t *, libvlc_exception_t *);
358 VLC_PUBLIC_API float       libvlc_media_instance_get_rate       ( libvlc_media_instance_t *, libvlc_exception_t *);
359 VLC_PUBLIC_API void        libvlc_media_instance_set_rate       ( libvlc_media_instance_t *, float, libvlc_exception_t *);
360 VLC_PUBLIC_API int         libvlc_media_instance_get_state      ( libvlc_media_instance_t *, libvlc_exception_t *);
361
362 /**
363  * Does this input have a video output ?
364  * \param p_input the input
365  * \param p_exception an initialized exception
366  */
367 VLC_PUBLIC_API vlc_bool_t  libvlc_media_instance_has_vout( libvlc_media_instance_t *, libvlc_exception_t *);
368 VLC_PUBLIC_API float       libvlc_media_instance_get_fps( libvlc_media_instance_t *, libvlc_exception_t *);
369
370
371 /** @} */
372
373 /*****************************************************************************
374  * Tag Query
375  *****************************************************************************/
376 /** defgroup libvlc_tag_query Tag Query
377  * \ingroup libvlc
378  * LibVLC Tag query
379  * @{
380  */
381 VLC_PUBLIC_API libvlc_tag_query_t * 
382     libvlc_tag_query_new( libvlc_instance_t *, libvlc_exception_t * );
383
384 VLC_PUBLIC_API void 
385     libvlc_tag_query_release( libvlc_tag_query_t * );
386
387 VLC_PUBLIC_API void 
388     libvlc_tag_query_retain( libvlc_tag_query_t * );
389
390 VLC_PUBLIC_API vlc_bool_t 
391     libvlc_tag_query_match( libvlc_tag_query_t *, libvlc_media_descriptor_t *,
392                             libvlc_exception_t * );
393
394 /** @} */
395
396 /*****************************************************************************
397  * Media List
398  *****************************************************************************/
399 /** defgroup libvlc_media_list MediaList
400  * \ingroup libvlc
401  * LibVLC Media List
402  * @{
403  */
404 VLC_PUBLIC_API libvlc_media_list_t *
405     libvlc_media_list_new( libvlc_instance_t *, libvlc_exception_t * );
406
407 VLC_PUBLIC_API void
408     libvlc_media_list_release( libvlc_media_list_t * );
409
410 VLC_PUBLIC_API void
411     libvlc_media_list_retain( libvlc_media_list_t * );
412
413 VLC_PUBLIC_API void
414     libvlc_media_list_add_media_descriptor( libvlc_media_list_t *,
415                                             libvlc_media_descriptor_t *,
416                                             libvlc_exception_t * );
417 VLC_PUBLIC_API void
418     libvlc_media_list_insert_media_descriptor( libvlc_media_list_t *,
419                                                libvlc_media_descriptor_t *,
420                                                int,
421                                                libvlc_exception_t * );
422 VLC_PUBLIC_API void
423     libvlc_media_list_remove_index( libvlc_media_list_t *, int,
424                                     libvlc_exception_t * );
425
426 VLC_PUBLIC_API int
427     libvlc_media_list_count( libvlc_media_list_t * p_mlist,
428                              libvlc_exception_t * p_e );
429
430 VLC_PUBLIC_API libvlc_media_descriptor_t *
431     libvlc_media_list_item_at_index( libvlc_media_list_t *, int,
432                                      libvlc_exception_t * );
433 VLC_PUBLIC_API int
434     libvlc_media_list_index_of_item( libvlc_media_list_t *,
435                                      libvlc_media_descriptor_t *,
436                                      libvlc_exception_t * );
437
438 VLC_PUBLIC_API void
439     libvlc_media_list_lock( libvlc_media_list_t * );
440 VLC_PUBLIC_API void
441     libvlc_media_list_unlock( libvlc_media_list_t * );
442
443 VLC_PUBLIC_API libvlc_event_manager_t *
444     libvlc_media_list_event_manager( libvlc_media_list_t *,
445                                     libvlc_exception_t * );
446
447 VLC_PUBLIC_API libvlc_media_list_t *
448     libvlc_media_list_dynamic_sublist( libvlc_media_list_t *,
449                                        libvlc_tag_query_t *,
450                                        libvlc_exception_t * );
451
452 /** @} */
453
454 /*****************************************************************************
455  * Media List Player
456  *****************************************************************************/
457 /** defgroup libvlc_media_list_player MediaListPlayer
458  * \ingroup libvlc
459  * LibVLC Media List Player
460  * @{
461  */
462 VLC_PUBLIC_API libvlc_media_list_player_t *
463     libvlc_media_list_player_new( libvlc_instance_t * p_instance,
464                                   libvlc_exception_t * p_e );
465 VLC_PUBLIC_API void
466     libvlc_media_list_player_release( libvlc_media_list_player_t * p_mlp );
467
468 VLC_PUBLIC_API void
469     libvlc_media_list_player_set_media_instance(
470                                      libvlc_media_list_player_t * p_mlp,
471                                      libvlc_media_instance_t * p_mi,
472                                      libvlc_exception_t * p_e );
473
474 VLC_PUBLIC_API void
475     libvlc_media_list_player_set_media_list(
476                                      libvlc_media_list_player_t * p_mlp,
477                                      libvlc_media_list_t * p_mlist,
478                                      libvlc_exception_t * p_e );
479
480 VLC_PUBLIC_API void
481     libvlc_media_list_player_play( libvlc_media_list_player_t * p_mlp,
482                                    libvlc_exception_t * p_e );
483
484 VLC_PUBLIC_API void
485     libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp,
486                                    libvlc_exception_t * p_e );
487 VLC_PUBLIC_API void
488     libvlc_media_list_player_next( libvlc_media_list_player_t * p_mlp,
489                                    libvlc_exception_t * p_e );
490
491 /** @} */
492
493 /** defgroup libvlc_video Video
494  * \ingroup libvlc
495  * LibVLC Video handling
496  * @{
497  */
498
499 /**
500  * Does this input have a video output ?
501  * \param p_input the input
502  * \param p_exception an initialized exception
503  */
504 VLC_PUBLIC_API vlc_bool_t  libvlc_input_has_vout( libvlc_media_instance_t *, libvlc_exception_t *);
505 VLC_PUBLIC_API float       libvlc_input_get_fps( libvlc_media_instance_t *, libvlc_exception_t *);
506
507 /**
508  * Toggle fullscreen status on video output
509  * \param p_input the input
510  * \param p_exception an initialized exception
511  */
512 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_instance_t *, libvlc_exception_t * );
513
514 /**
515  * Enable or disable fullscreen on a video output
516  * \param p_input the input
517  * \param b_fullscreen boolean for fullscreen status
518  * \param p_exception an initialized exception
519  */
520 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_instance_t *, int, libvlc_exception_t * );
521
522 /**
523  * Get current fullscreen status
524  * \param p_input the input
525  * \param p_exception an initialized exception
526  * \return the fullscreen status (boolean)
527  */
528 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_instance_t *, libvlc_exception_t * );
529
530 /**
531  * Get current video height
532  * \param p_input the input
533  * \param p_exception an initialized exception
534  * \return the video height
535  */
536 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_instance_t *, libvlc_exception_t * );
537
538 /**
539  * Get current video width
540  * \param p_input the input
541  * \param p_exception an initialized exception
542  * \return the video width
543  */
544 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_instance_t *, libvlc_exception_t * );
545
546 /**
547  * Get current video aspect ratio
548  * \param p_input the input
549  * \param p_exception an initialized exception
550  * \return the video aspect ratio
551  */
552 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_instance_t *, libvlc_exception_t * );
553
554 /**
555  * Set new video aspect ratio
556  * \param p_input the input
557  * \param psz_aspect new video aspect-ratio
558  * \param p_exception an initialized exception
559  */
560 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_instance_t *, char *, libvlc_exception_t * );
561
562 /**
563  * Get current video subtitle
564  * \param p_input the input
565  * \param p_exception an initialized exception
566  * \return the video subtitle selected
567  */
568 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_instance_t *, libvlc_exception_t * );
569
570 /**
571  * Set new video subtitle
572  * \param p_input the input
573  * \param i_spu new video subtitle to select
574  * \param p_exception an initialized exception
575  */
576 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_instance_t *, int , libvlc_exception_t * );
577
578 /**
579  * Get current crop filter geometry
580  * \param p_input the input
581  * \param p_exception an initialized exception
582  * \return the crop filter geometry
583  */
584 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_instance_t *, libvlc_exception_t * );
585
586 /**
587  * Set new crop filter geometry
588  * \param p_input the input
589  * \param psz_geometry new crop filter geometry
590  * \param p_exception an initialized exception
591  */
592 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_instance_t *, char *, libvlc_exception_t * );
593
594 /**
595  * Get current teletext page requested.
596  * \param p_input the input
597  * \param p_exception an initialized exception
598  * \return the current teletext page requested.
599  */
600 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_instance_t *, libvlc_exception_t * );
601
602 /**
603  * Set new teletext page to retrieve
604  * \param p_input the input
605  * \param i_page teletex page number requested
606  * \param p_exception an initialized exception
607  */
608 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_instance_t *, int, libvlc_exception_t * );
609
610 /**
611  * Take a snapshot of the current video window
612  * \param p_input the input
613  * \param psz_filepath the path where to save the screenshot to
614  * \param p_exception an initialized exception
615  */
616 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_instance_t *, char *, libvlc_exception_t * );
617
618 VLC_PUBLIC_API int libvlc_video_destroy( libvlc_media_instance_t *, libvlc_exception_t *);
619
620 /**
621  * Resize the current video output window
622  * \param p_instance libvlc instance
623  * \param width new width for video output window
624  * \param height new height for video output window
625  * \param p_exception an initialized exception
626  * \return the success status (boolean)
627  */
628 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_instance_t *, int, int, libvlc_exception_t *);
629
630 /**
631  * change the parent for the current the video output
632  * \param p_instance libvlc instance
633  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
634  * \param p_exception an initialized exception
635  * \return the success status (boolean)
636  */
637 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
638
639 /**
640  * Tell windowless video output to redraw rectangular area (MacOS X only)
641  * \param p_instance libvlc instance
642  * \param area coordinates within video drawable
643  * \param p_exception an initialized exception
644  */
645 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_instance_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
646
647 /**
648  * Set the default video output parent
649  *  this settings will be used as default for all video outputs
650  * \param p_instance libvlc instance
651  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
652  * \param p_exception an initialized exception
653  */
654 VLC_PUBLIC_API void libvlc_video_set_parent( libvlc_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
655
656 /**
657  * Set the default video output parent
658  *  this settings will be used as default for all video outputs
659  * \param p_instance libvlc instance
660  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
661  * \param p_exception an initialized exception
662  */
663 VLC_PUBLIC_API libvlc_drawable_t libvlc_video_get_parent( libvlc_instance_t *, libvlc_exception_t * );
664
665 /**
666  * Set the default video output size
667  *  this settings will be used as default for all video outputs
668  * \param p_instance libvlc instance
669  * \param width new width for video drawable
670  * \param height new height for video drawable
671  * \param p_exception an initialized exception
672  */
673 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
674
675 /**
676  * Set the default video output viewport for a windowless video output (MacOS X only)
677  *  this settings will be used as default for all video outputs
678  * \param p_instance libvlc instance
679  * \param view coordinates within video drawable
680  * \param clip coordinates within video drawable
681  * \param p_exception an initialized exception
682  */
683 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
684
685 /** @} */
686
687 /**
688  * defgroup libvlc_vlm VLM
689  * \ingroup libvlc
690  * LibVLC VLM handling
691  * @{
692  */
693
694 /** defgroup libvlc_audio Audio
695  * \ingroup libvlc
696  * LibVLC Audio handling
697  * @{
698  */
699
700 /**
701  * Toggle mute status
702  * \param p_instance libvlc instance
703  * \param p_exception an initialized exception
704  * \return void
705  */
706 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
707
708 /**
709  * Get current mute status
710  * \param p_instance libvlc instance
711  * \param p_exception an initialized exception
712  * \return the mute status (boolean)
713  */
714 VLC_PUBLIC_API vlc_bool_t libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
715
716 /**
717  * Set mute status
718  * \param p_instance libvlc instance
719  * \param status If status is VLC_TRUE then mute, otherwise unmute
720  * \param p_exception an initialized exception
721  * \return void
722  */
723 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, vlc_bool_t , libvlc_exception_t * );
724
725 /**
726  * Get current audio level
727  * \param p_instance libvlc instance
728  * \param p_exception an initialized exception
729  * \return the audio level (int)
730  */
731 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
732
733 /**
734  * Set current audio level
735  * \param p_instance libvlc instance
736  * \param i_volume the volume (int)
737  * \param p_exception an initialized exception
738  */
739 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
740
741 /**
742 +  * Get current audio track
743 +  * \param p_input input instance
744 +  * \param p_exception an initialized exception
745 +  * \return the audio track (int)
746 +  */
747 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_instance_t *, libvlc_exception_t * );
748
749 /**
750  * Set current audio track
751  * \param p_input input instance
752  * \param i_track the track (int)
753  * \param p_exception an initialized exception
754  */
755 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_instance_t *, int, libvlc_exception_t * );
756
757 /**
758  * Get current audio channel
759  * \param p_instance input instance
760  * \param p_exception an initialized exception
761  * \return the audio channel (int)
762  */
763 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
764
765 /**
766  * Set current audio channel
767  * \param p_instance input instance
768  * \param i_channel the audio channel (int)
769  * \param p_exception an initialized exception
770  */
771 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
772
773 /** @} */
774
775
776 /**
777  * Add a broadcast, with one input
778  * \param p_instance the instance
779  * \param psz_name the name of the new broadcast
780  * \param psz_input the input MRL
781  * \param psz_output the output MRL (the parameter to the "sout" variable)
782  * \param i_options number of additional options
783  * \param ppsz_options additional options
784  * \param b_enabled boolean for enabling the new broadcast
785  * \param b_loop Should this broadcast be played in loop ?
786  * \param p_exception an initialized exception
787  */
788 VLC_PUBLIC_API void libvlc_vlm_add_broadcast( libvlc_instance_t *, char *, char *, char* ,
789                                               int, char **, int, int, libvlc_exception_t * );
790
791 /**
792  * Delete a media (vod or broadcast)
793  * \param p_instance the instance
794  * \param psz_name the media to delete
795  * \param p_exception an initialized exception
796  */
797 VLC_PUBLIC_API void libvlc_vlm_del_media( libvlc_instance_t *, char *, libvlc_exception_t * );
798
799 /**
800  * Enable or disable a media (vod or broadcast)
801  * \param p_instance the instance
802  * \param psz_name the media to work on
803  * \param b_enabled the new status
804  * \param p_exception an initialized exception
805  */
806 VLC_PUBLIC_API void libvlc_vlm_set_enabled( libvlc_instance_t *, char *, int,
807                                             libvlc_exception_t *);
808
809 /**
810  * Set the output for a media
811  * \param p_instance the instance
812  * \param psz_name the media to work on
813  * \param psz_output the output MRL (the parameter to the "sout" variable)
814  * \param p_exception an initialized exception
815  */
816 VLC_PUBLIC_API void libvlc_vlm_set_output( libvlc_instance_t *, char *, char*,
817                                            libvlc_exception_t *);
818
819 /**
820  * Set a media's input MRL. This will delete all existing inputs and
821  * add the specified one.
822  * \param p_instance the instance
823  * \param psz_name the media to work on
824  * \param psz_input the input MRL
825  * \param p_exception an initialized exception
826  */
827 VLC_PUBLIC_API void libvlc_vlm_set_input( libvlc_instance_t *, char *, char*,
828                                           libvlc_exception_t *);
829
830 /**
831  * Add a media's input MRL. This will add the specified one.
832  * \param p_instance the instance
833  * \param psz_name the media to work on
834  * \param psz_input the input MRL
835  * \param p_exception an initialized exception
836  */
837 VLC_PUBLIC_API void libvlc_vlm_add_input( libvlc_instance_t *, char *, char *,
838                                           libvlc_exception_t *p_exception );
839 /**
840  * Set output for a media
841  * \param p_instance the instance
842  * \param psz_name the media to work on
843  * \param b_loop the new status
844  * \param p_exception an initialized exception
845  */
846 VLC_PUBLIC_API void libvlc_vlm_set_loop( libvlc_instance_t *, char *, int,
847                                          libvlc_exception_t *);
848
849 /**
850  * Edit the parameters of a media. This will delete all existing inputs and
851  * add the specified one.
852  * \param p_instance the instance
853  * \param psz_name the name of the new broadcast
854  * \param psz_input the input MRL
855  * \param psz_output the output MRL (the parameter to the "sout" variable)
856  * \param i_options number of additional options
857  * \param ppsz_options additional options
858  * \param b_enabled boolean for enabling the new broadcast
859  * \param b_loop Should this broadcast be played in loop ?
860  * \param p_exception an initialized exception
861  */
862 VLC_PUBLIC_API void libvlc_vlm_change_media( libvlc_instance_t *, char *, char *, char* ,
863                                              int, char **, int, int, libvlc_exception_t * );
864
865 /**
866  * Plays the named broadcast.
867  * \param p_instance the instance
868  * \param psz_name the name of the broadcast
869  * \param p_exception an initialized exception
870  */
871 VLC_PUBLIC_API void libvlc_vlm_play_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
872
873 /**
874  * Stops the named broadcast.
875  * \param p_instance the instance
876  * \param psz_name the name of the broadcast
877  * \param p_exception an initialized exception
878  */ 
879 VLC_PUBLIC_API void libvlc_vlm_stop_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
880
881 /**
882  * Pauses the named broadcast.
883  * \param p_instance the instance
884  * \param psz_name the name of the broadcast
885  * \param p_exception an initialized exception
886  */ 
887 VLC_PUBLIC_API void libvlc_vlm_pause_media( libvlc_instance_t *, char *, libvlc_exception_t * );
888     
889 /**
890  * Seeks in the named broadcast.
891  * \param p_instance the instance
892  * \param psz_name the name of the broadcast
893  * \param f_percentage the percentage to seek to
894  * \param p_exception an initialized exception
895  */ 
896 VLC_PUBLIC_API void libvlc_vlm_seek_media( libvlc_instance_t *, char *,
897                                            float, libvlc_exception_t * );
898    
899 /**
900  * Return information of the named broadcast.
901  * \param p_instance the instance
902  * \param psz_name the name of the broadcast
903  * \param p_exception an initialized exception
904  */ 
905 VLC_PUBLIC_API char* libvlc_vlm_show_media( libvlc_instance_t *, char *, libvlc_exception_t * );
906
907 #define LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( attr, returnType, getType, default)\
908 returnType libvlc_vlm_get_media_## attr( libvlc_instance_t *, \
909                         char *, int , libvlc_exception_t * );
910
911 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( position, float, Float, -1);
912 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( time, int, Integer, -1);
913 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( length, int, Integer, -1);
914 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( rate, int, Integer, -1);
915 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( title, int, Integer, 0);
916 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( chapter, int, Integer, 0);
917 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( seekable, int, Bool, 0);
918
919 #undef LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
920
921 /** @} */
922 /** @} */
923
924 /*****************************************************************************
925  * Message log handling
926  *****************************************************************************/
927
928 /** defgroup libvlc_log Log
929  * \ingroup libvlc
930  * LibVLC Message Logging
931  * @{
932  */
933
934 /**
935  * Returns the VLC messaging verbosity level
936  * \param p_instance libvlc instance
937  * \param exception an initialized exception pointer
938  */
939 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
940                                                   libvlc_exception_t *p_e );
941
942 /**
943  * Set the VLC messaging verbosity level
944  * \param p_log libvlc log instance
945  * \param exception an initialized exception pointer
946  */
947 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
948                                               libvlc_exception_t *p_e );
949
950 /**
951  * Open an instance to VLC message log 
952  * \param p_instance libvlc instance
953  * \param exception an initialized exception pointer
954  */
955 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( const libvlc_instance_t *, libvlc_exception_t *);
956
957 /**
958  * Close an instance of VLC message log 
959  * \param p_log libvlc log instance
960  * \param exception an initialized exception pointer
961  */
962 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
963
964 /**
965  * Returns the number of messages in log
966  * \param p_log libvlc log instance
967  * \param exception an initialized exception pointer
968  */
969 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
970
971 /**
972  * Clear all messages in log
973  *  the log should be cleared on a regular basis to avoid clogging
974  * \param p_log libvlc log instance
975  * \param exception an initialized exception pointer
976  */
977 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
978
979 /**
980  * Allocate and returns a new iterator to messages in log
981  * \param p_log libvlc log instance
982  * \param exception an initialized exception pointer
983  */
984 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
985
986 /**
987  * Releases a previoulsy allocated iterator
988  * \param p_log libvlc log iterator 
989  * \param exception an initialized exception pointer
990  */
991 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
992
993 /**
994  * Returns whether log iterator has more messages 
995  * \param p_log libvlc log iterator
996  * \param exception an initialized exception pointer
997  */
998 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
999
1000 /**
1001  * Returns next log message
1002  *   the content of message must not be freed
1003  * \param p_log libvlc log iterator
1004  * \param exception an initialized exception pointer
1005  */
1006 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
1007                                                                struct libvlc_log_message_t *buffer,
1008                                                                libvlc_exception_t *p_e );
1009
1010 /** @} */
1011
1012 /*****************************************************************************
1013  * Event handling
1014  *****************************************************************************/
1015
1016 /** defgroup libvlc_callbacks Callbacks
1017  * \ingroup libvlc
1018  * LibVLC Events
1019  * @{
1020  */
1021
1022 /**
1023  * Register for an event notification
1024  * \param p_event_manager the event manager to which you want to attach to
1025  * Generally it is obtained by vlc_my_object_event_manager() where my_object
1026  * Is the object you want to listen to.
1027  * \param i_event_type the desired event to which we want to listen
1028  * \param f_callback the function to call when i_event_type occurs
1029  * \param user_data user provided data to carry with the event
1030  * \param p_e an initialized exception pointer
1031  */
1032 VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
1033                                          libvlc_event_type_t i_event_type,
1034                                          libvlc_callback_t f_callback,
1035                                          void *user_data,
1036                                          libvlc_exception_t *p_e );
1037
1038 /**
1039  * Unregister an event notification
1040  * \param p_event_manager the event manager
1041  * \param i_event_type the desired event to which we want to unregister
1042  * \param f_callback the function to call when i_event_type occurs
1043  * \param p_e an initialized exception pointer
1044  */
1045 VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
1046                                          libvlc_event_type_t i_event_type,
1047                                          libvlc_callback_t f_callback,
1048                                          void *p_user_data,
1049                                          libvlc_exception_t *p_e );
1050
1051
1052 /**
1053  * Get an event type name 
1054  * \param i_event_type the desired event
1055  */
1056 #define libvlc_event_type_name(a) #a
1057
1058 /** @} */
1059
1060
1061 # ifdef __cplusplus
1062 }
1063 # endif
1064
1065 #endif /* <vlc/libvlc.h> */