]> git.sesse.net Git - vlc/blob - include/vlc/libvlc.h
Fix libvlc_add_intf documentation
[vlc] / include / vlc / libvlc.h
1 /*****************************************************************************
2  * libvlc.h:  libvlc external API
3  *****************************************************************************
4  * Copyright (C) 1998-2005 the VideoLAN team
5  * $Id$
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  *          Jean-Paul Saman <jpsaman@videolan.org>
9  *          Pierre d'Herbemont <pdherbemont@videolan.org>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24  *****************************************************************************/
25
26 /**
27  * \file
28  * This file defines libvlc external API
29  */
30
31 /**
32  * \defgroup libvlc libvlc
33  * This is libvlc, the base library of the VLC program.
34  *
35  * @{
36  */
37
38 #ifndef VLC_LIBVLC_H
39 #define VLC_LIBVLC_H 1
40
41 #if defined (WIN32) && defined (DLL_EXPORT)
42 # define VLC_PUBLIC_API __declspec(dllexport)
43 #else
44 # define VLC_PUBLIC_API
45 #endif
46
47 #ifdef __LIBVLC__
48 /* Avoid unuseful warnings from libvlc with our deprecated APIs */
49 #   define VLC_DEPRECATED_API VLC_PUBLIC_API
50 #elif defined(__GNUC__) && \
51       (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
52 # define VLC_DEPRECATED_API VLC_PUBLIC_API __attribute__((deprecated))
53 #else
54 # define VLC_DEPRECATED_API VLC_PUBLIC_API
55 #endif
56
57 # ifdef __cplusplus
58 extern "C" {
59 # endif
60
61 /*****************************************************************************
62  * Exception handling
63  *****************************************************************************/
64 /** \defgroup libvlc_exception libvlc_exception
65  * \ingroup libvlc_core
66  * LibVLC Exceptions handling
67  * @{
68  */
69
70 /**
71  * Initialize an exception structure. This can be called several times to
72  * reuse an exception structure.
73  *
74  * \param p_exception the exception to initialize
75  */
76 VLC_PUBLIC_API void libvlc_exception_init( libvlc_exception_t *p_exception );
77
78 /**
79  * Has an exception been raised?
80  *
81  * \param p_exception the exception to query
82  * \return 0 if the exception was raised, 1 otherwise
83  */
84 VLC_PUBLIC_API int
85 libvlc_exception_raised( const libvlc_exception_t *p_exception );
86
87 /**
88  * Raise an exception using a user-provided message.
89  *
90  * \param p_exception the exception to raise
91  * \param psz_format the exception message format string
92  * \param ... the format string arguments
93  */
94 VLC_PUBLIC_API void
95 libvlc_exception_raise( libvlc_exception_t *p_exception,
96                         const char *psz_format, ... );
97
98 /**
99  * Clear an exception object so it can be reused.
100  * The exception object must have be initialized.
101  *
102  * \param p_exception the exception to clear
103  */
104 VLC_PUBLIC_API void libvlc_exception_clear( libvlc_exception_t * );
105
106 /**
107  * Get an exception's message.
108  *
109  * \param p_exception the exception to query
110  * \return the exception message or NULL if not applicable (exception not
111  *         raised, for example)
112  */
113 VLC_PUBLIC_API const char *
114 libvlc_exception_get_message( const libvlc_exception_t *p_exception );
115
116 /**@} */
117
118 /*****************************************************************************
119  * Core handling
120  *****************************************************************************/
121
122 /** \defgroup libvlc_core libvlc_core
123  * \ingroup libvlc
124  * LibVLC Core
125  * @{
126  */
127
128 /**
129  * Create and initialize a libvlc instance.
130  *
131  * \param argc the number of arguments
132  * \param argv command-line-type arguments. argv[0] must be the path of the
133  *        calling program.
134  * \param p_e an initialized exception pointer
135  * \return the libvlc instance
136  */
137 VLC_PUBLIC_API libvlc_instance_t *
138 libvlc_new( int , const char *const *, libvlc_exception_t *);
139
140 /**
141  * Return a libvlc instance identifier for legacy APIs. Use of this
142  * function is discouraged, you should convert your program to use the
143  * new API.
144  *
145  * \param p_instance the instance
146  * \return the instance identifier
147  */
148 VLC_PUBLIC_API int libvlc_get_vlc_id( libvlc_instance_t *p_instance );
149
150 /**
151  * Decrement the reference count of a libvlc instance, and destroy it
152  * if it reaches zero.
153  *
154  * \param p_instance the instance to destroy
155  */
156 VLC_PUBLIC_API void libvlc_release( libvlc_instance_t * );
157
158 /**
159  * Increments the reference count of a libvlc instance.
160  * The initial reference count is 1 after libvlc_new() returns.
161  *
162  * \param p_instance the instance to reference
163  */
164 VLC_PUBLIC_API void libvlc_retain( libvlc_instance_t * );
165
166 /**
167  * Try to start a user interface for the libvlc instance.
168  *
169  * \param p_instance the instance
170  * \param name interface name, or NULL for default
171  * \param p_exception an initialized exception pointer
172  */
173 VLC_PUBLIC_API
174 void libvlc_add_intf( libvlc_instance_t *p_instance, const char *name,
175                       libvlc_exception_t *p_exception );
176
177 /**
178  * Waits until an interface causes the instance to exit.
179  * You should start at least one interface first, using libvlc_add_intf().
180  *
181  * \param p_instance the instance
182  */
183 VLC_PUBLIC_API
184 void libvlc_wait( libvlc_instance_t *p_instance );
185
186 /**
187  * Retrieve libvlc version.
188  *
189  * Example: "0.9.0-git Grishenko"
190  *
191  * \return a string containing the libvlc version
192  */
193 VLC_PUBLIC_API const char * libvlc_get_version(void);
194
195 /**
196  * Retrieve libvlc compiler version.
197  *
198  * Example: "gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu6)"
199  *
200  * \return a string containing the libvlc compiler version
201  */
202 VLC_PUBLIC_API const char * libvlc_get_compiler(void);
203
204 /**
205  * Retrieve libvlc changeset.
206  *
207  * Example: "aa9bce0bc4"
208  *
209  * \return a string containing the libvlc changeset
210  */
211 VLC_PUBLIC_API const char * libvlc_get_changeset(void);
212
213 struct vlc_object_t;
214
215 /**
216  * Return the libvlc internal object, the main object that all other depend on.
217  * Any of of this function should be considered an ugly hack and avoided at all
218  * cost. E.g. you need to expose some functionality that is not provided by the
219  * libvlc API directly with libvlccore.
220  * Remember to release the object with vlc_object_release( obj* )
221  *
222  * \param p_instance the libvlc instance
223  */
224 VLC_PUBLIC_API struct vlc_object_t *libvlc_get_vlc_instance(libvlc_instance_t *);
225
226 /**
227  * Frees an heap allocation (char *) returned by a LibVLC API.
228  * If you know you're using the same underlying C run-time as the LibVLC
229  * implementation, then you can call ANSI C free() directly instead.
230  */
231 VLC_PUBLIC_API void libvlc_free( void *ptr );
232
233 /** @}*/
234
235 /*****************************************************************************
236  * media
237  *****************************************************************************/
238 /** \defgroup libvlc_media libvlc_media
239  * \ingroup libvlc
240  * LibVLC Media
241  * @{
242  */
243
244 /**
245  * Create a media with the given MRL.
246  *
247  * \param p_instance the instance
248  * \param psz_mrl the MRL to read
249  * \param p_e an initialized exception pointer
250  * \return the newly created media
251  */
252 VLC_PUBLIC_API libvlc_media_t * libvlc_media_new(
253                                    libvlc_instance_t *p_instance,
254                                    const char * psz_mrl,
255                                    libvlc_exception_t *p_e );
256
257 /**
258  * Create a media as an empty node with the passed name.
259  *
260  * \param p_instance the instance
261  * \param psz_name the name of the node
262  * \param p_e an initialized exception pointer
263  * \return the new empty media
264  */
265 VLC_PUBLIC_API libvlc_media_t * libvlc_media_new_as_node(
266                                    libvlc_instance_t *p_instance,
267                                    const char * psz_name,
268                                    libvlc_exception_t *p_e );
269
270 /**
271  * Add an option to the media.
272  *
273  * This option will be used to determine how the media_player will
274  * read the media. This allows to use VLC's advanced
275  * reading/streaming options on a per-media basis.
276  *
277  * The options are detailed in vlc --long-help, for instance "--sout-all"
278  *
279  * \param p_instance the instance
280  * \param ppsz_options the options (as a string)
281  * \param p_e an initialized exception pointer
282  */
283 VLC_PUBLIC_API void libvlc_media_add_option(
284                                    libvlc_media_t * p_md,
285                                    const char * ppsz_options,
286                                    libvlc_exception_t * p_e );
287 /**
288  * Add an option to the media from an untrusted source.
289  *
290  * This option will be used to determine how the media_player will
291  * read the media. This allows to use VLC's advanced
292  * reading/streaming options on a per-media basis.
293  *
294  * The options are detailed in vlc --long-help, for instance "--sout-all"
295  *
296  * \param p_instance the instance
297  * \param ppsz_options the options (as a string)
298  * \param p_e an initialized exception pointer
299  */
300 VLC_PUBLIC_API void libvlc_media_add_option_untrusted(
301                                    libvlc_media_t * p_md,
302                                    const char * ppsz_options,
303                                    libvlc_exception_t * p_e );
304
305
306 /**
307  * Retain a reference to a media descriptor object (libvlc_media_t). Use
308  * libvlc_media_release() to decrement the reference count of a
309  * media descriptor object.
310  *
311  * \param p_meta_desc a media descriptor object.
312  */
313 VLC_PUBLIC_API void libvlc_media_retain(
314                                    libvlc_media_t *p_meta_desc );
315
316 /**
317  * Decrement the reference count of a media descriptor object. If the
318  * reference count is 0, then libvlc_media_release() will release the
319  * media descriptor object. It will send out an libvlc_MediaFreed event
320  * to all listeners. If the media descriptor object has been released it
321  * should not be used again.
322  *
323  * \param p_meta_desc a media descriptor object.
324  */
325 VLC_PUBLIC_API void libvlc_media_release(
326                                    libvlc_media_t *p_meta_desc );
327
328
329 /**
330  * Get the media resource locator (mrl) from a media descriptor object
331  *
332  * \param p_md a media descriptor object
333  * \param p_e an initialized exception object
334  * \return string with mrl of media descriptor object
335  */
336 VLC_PUBLIC_API char * libvlc_media_get_mrl( libvlc_media_t * p_md,
337                                                        libvlc_exception_t * p_e );
338
339 /**
340  * Duplicate a media descriptor object.
341  *
342  * \param p_meta_desc a media descriptor object.
343  */
344 VLC_PUBLIC_API libvlc_media_t * libvlc_media_duplicate( libvlc_media_t * );
345
346 /**
347  * Read the meta of the media.
348  *
349  * \param p_meta_desc the media to read
350  * \param e_meta_desc the meta to read
351  * \param p_e an initialized exception pointer
352  * \return the media's meta
353  */
354 VLC_PUBLIC_API char * libvlc_media_get_meta(
355                                    libvlc_media_t *p_meta_desc,
356                                    libvlc_meta_t e_meta,
357                                    libvlc_exception_t *p_e );
358 /**
359  * Get current state of media descriptor object. Possible media states
360  * are defined in libvlc_structures.c ( libvlc_NothingSpecial=0,
361  * libvlc_Opening, libvlc_Buffering, libvlc_Playing, libvlc_Paused,
362  * libvlc_Stopped, libvlc_Ended,
363  * libvlc_Error).
364  *
365  * @see libvlc_state_t
366  * \param p_meta_desc a media descriptor object
367  * \param p_e an initialized exception object
368  * \return state of media descriptor object
369  */
370 VLC_PUBLIC_API libvlc_state_t libvlc_media_get_state(
371                                    libvlc_media_t *p_meta_desc,
372                                    libvlc_exception_t *p_e );
373
374 /**
375  * Get subitems of media descriptor object. This will increment
376  * the reference count of supplied media descriptor object. Use
377  * libvlc_media_list_release() to decrement the reference counting.
378  *
379  * \param p_md media descriptor object
380  * \param p_e initalized exception object
381  * \return list of media descriptor subitems or NULL
382  */
383 VLC_PUBLIC_API libvlc_media_list_t *
384     libvlc_media_subitems( libvlc_media_t *p_md,
385                                       libvlc_exception_t *p_e );
386 /**
387  * Get event manager from media descriptor object.
388  * NOTE: this function doesn't increment reference counting.
389  *
390  * \param p_md a media descriptor object
391  * \param p_e an initialized exception object
392  * \return event manager object
393  */
394 VLC_PUBLIC_API libvlc_event_manager_t *
395     libvlc_media_event_manager( libvlc_media_t * p_md,
396                                            libvlc_exception_t * p_e );
397
398 /**
399  * Get duration of media descriptor object item.
400  *
401  * \param p_md media descriptor object
402  * \param p_e an initialized exception object
403  * \return duration of media item
404  */
405 VLC_PUBLIC_API libvlc_time_t
406    libvlc_media_get_duration( libvlc_media_t * p_md,
407                                          libvlc_exception_t * p_e );
408
409 /**
410  * Get preparsed status for media descriptor object.
411  *
412  * \param p_md media descriptor object
413  * \param p_e an initialized exception object
414  * \return true if media object has been preparsed otherwise it returns false
415  */
416 VLC_PUBLIC_API int
417    libvlc_media_is_preparsed( libvlc_media_t * p_md,
418                                          libvlc_exception_t * p_e );
419
420 /**
421  * Sets media descriptor's user_data. user_data is specialized data
422  * accessed by the host application, VLC.framework uses it as a pointer to
423  * an native object that references a libvlc_media_t pointer
424  *
425  * \param p_md media descriptor object
426  * \param p_new_user_data pointer to user data
427  * \param p_e an initialized exception object
428  */
429 VLC_PUBLIC_API void
430     libvlc_media_set_user_data( libvlc_media_t * p_md,
431                                            void * p_new_user_data,
432                                            libvlc_exception_t * p_e);
433
434 /**
435  * Get media descriptor's user_data. user_data is specialized data
436  * accessed by the host application, VLC.framework uses it as a pointer to
437  * an native object that references a libvlc_media_t pointer
438  *
439  * \param p_md media descriptor object
440  * \param p_e an initialized exception object
441  */
442 VLC_PUBLIC_API void *
443     libvlc_media_get_user_data( libvlc_media_t * p_md,
444                                            libvlc_exception_t * p_e);
445
446 /** @}*/
447
448 /*****************************************************************************
449  * Media Player
450  *****************************************************************************/
451 /** \defgroup libvlc_media_player libvlc_media_player
452  * \ingroup libvlc
453  * LibVLC Media Player, object that let you play a media
454  * in a custom drawable
455  * @{
456  */
457
458 /**
459  * Create an empty Media Player object
460  *
461  * \param p_libvlc_instance the libvlc instance in which the Media Player
462  *        should be created.
463  * \param p_e an initialized exception pointer
464  */
465 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t *, libvlc_exception_t * );
466
467 /**
468  * Create a Media Player object from a Media
469  *
470  * \param p_md the media. Afterwards the p_md can be safely
471  *        destroyed.
472  * \param p_e an initialized exception pointer
473  */
474 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new_from_media( libvlc_media_t *, libvlc_exception_t * );
475
476 /**
477  * Release a media_player after use
478  * Decrement the reference count of a media player object. If the
479  * reference count is 0, then libvlc_media_player_release() will
480  * release the media player object. If the media player object
481  * has been released, then it should not be used again.
482  *
483  * \param p_mi the Media Player to free
484  */
485 VLC_PUBLIC_API void libvlc_media_player_release( libvlc_media_player_t * );
486
487 /**
488  * Retain a reference to a media player object. Use
489  * libvlc_media_player_release() to decrement reference count.
490  *
491  * \param p_mi media player object
492  */
493 VLC_PUBLIC_API void libvlc_media_player_retain( libvlc_media_player_t * );
494
495 /**
496  * Set the media that will be used by the media_player. If any,
497  * previous md will be released.
498  *
499  * \param p_mi the Media Player
500  * \param p_md the Media. Afterwards the p_md can be safely
501  *        destroyed.
502  * \param p_e an initialized exception pointer
503  */
504 VLC_PUBLIC_API void libvlc_media_player_set_media( libvlc_media_player_t *, libvlc_media_t *, libvlc_exception_t * );
505
506 /**
507  * Get the media used by the media_player.
508  *
509  * \param p_mi the Media Player
510  * \param p_e an initialized exception pointer
511  * \return the media associated with p_mi, or NULL if no
512  *         media is associated
513  */
514 VLC_PUBLIC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t *, libvlc_exception_t * );
515
516 /**
517  * Get the Event Manager from which the media player send event.
518  *
519  * \param p_mi the Media Player
520  * \param p_e an initialized exception pointer
521  * \return the event manager associated with p_mi
522  */
523 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *, libvlc_exception_t * );
524
525 /**
526  * is_playing
527  *
528  * \param p_mi the Media Player
529  * \param p_e an initialized exception pointer
530  * \return 1 if the media player is playing, 0 otherwise
531  */
532 VLC_PUBLIC_API int libvlc_media_player_is_playing ( libvlc_media_player_t *, libvlc_exception_t * );
533
534 /**
535  * Play
536  *
537  * \param p_mi the Media Player
538  * \param p_e an initialized exception pointer
539  */
540 VLC_PUBLIC_API void libvlc_media_player_play ( libvlc_media_player_t *, libvlc_exception_t * );
541
542 /**
543  * Pause
544  *
545  * \param p_mi the Media Player
546  * \param p_e an initialized exception pointer
547  */
548 VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *, libvlc_exception_t * );
549
550 /**
551  * Stop
552  *
553  * \param p_mi the Media Player
554  * \param p_e an initialized exception pointer
555  */
556 VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *, libvlc_exception_t * );
557
558 /**
559  * Set an X Window System drawable where the media player should render its
560  * video output. If LibVLC was built without X11 output support, then this has
561  * no effects.
562  *
563  * The specified identifier must correspond to an existing Input/Output class
564  * X11 window. Pixmaps are <b>not</b> supported. The caller shall ensure that
565  * the X11 server is the same as the one the VLC instance has been configured
566  * with.
567  * If XVideo is <b>not</b> used, it is assumed that the drawable has the
568  * following properties in common with the default X11 screen: depth, scan line
569  * pad, black pixel. This is a bug.
570  *
571  * \param p_mi the Media Player
572  * \param drawable the ID of the X window
573  * \param p_e an initialized exception pointer
574  */
575 VLC_PUBLIC_API void libvlc_media_player_set_xwindow ( libvlc_media_player_t *p_mi, uint32_t drawable, libvlc_exception_t *p_e );
576
577 /**
578  * Get the X Window System window identifier previously set with
579  * libvlc_media_player_set_xwindow(). Note that this will return the identifier
580  * even if VLC is not currently using it (for instance if it is playing an
581  * audio-only input).
582  *
583  * \return an X window ID, or 0 if none where set.
584  */
585 VLC_PUBLIC_API uint32_t libvlc_media_player_get_xwindow ( libvlc_media_player_t *p_mi );
586
587 /**
588  * Set a Win32/Win64 API window handle (HWND) where the media player should
589  * render its video output. If LibVLC was built without Win32/Win64 API output
590  * support, then this has no effects.
591  *
592  * \param p_mi the Media Player
593  * \param drawable windows handle of the drawable
594  * \param p_e an initialized exception pointer
595  */
596 VLC_PUBLIC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi, void *drawable, libvlc_exception_t *p_e );
597
598 /**
599  * Get the Windows API window handle (HWND) previously set with
600  * libvlc_media_player_set_hwnd(). The handle will be returned even if LibVLC
601  * is not currently outputting any video to it.
602  *
603  * \return a window handle or NULL if there are none.
604  */
605 VLC_PUBLIC_API void *libvlc_media_player_get_hwnd ( libvlc_media_player_t *p_mi );
606
607
608
609 /** \bug This might go away ... to be replaced by a broader system */
610
611 /**
612  * Get the current movie length (in ms).
613  *
614  * \param p_mi the Media Player
615  * \param p_e an initialized exception pointer
616  * \return the movie length (in ms).
617  */
618 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_length( libvlc_media_player_t *, libvlc_exception_t *);
619
620 /**
621  * Get the current movie time (in ms).
622  *
623  * \param p_mi the Media Player
624  * \param p_e an initialized exception pointer
625  * \return the movie time (in ms).
626  */
627 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_time( libvlc_media_player_t *, libvlc_exception_t *);
628
629 /**
630  * Set the movie time (in ms).
631  *
632  * \param p_mi the Media Player
633  * \param the movie time (in ms).
634  * \param p_e an initialized exception pointer
635  */
636 VLC_PUBLIC_API void libvlc_media_player_set_time( libvlc_media_player_t *, libvlc_time_t, libvlc_exception_t *);
637
638 /**
639  * Get movie position.
640  *
641  * \param p_mi the Media Player
642  * \param p_e an initialized exception pointer
643  * \return movie position
644  */
645 VLC_PUBLIC_API float libvlc_media_player_get_position( libvlc_media_player_t *, libvlc_exception_t *);
646
647 /**
648  * Set movie position.
649  *
650  * \param p_mi the Media Player
651  * \param p_e an initialized exception pointer
652  * \return movie position
653  */
654 VLC_PUBLIC_API void libvlc_media_player_set_position( libvlc_media_player_t *, float, libvlc_exception_t *);
655
656 /**
657  * Set movie chapter
658  *
659  * \param p_mi the Media Player
660  * \param i_chapter chapter number to play
661  * \param p_e an initialized exception pointer
662  */
663 VLC_PUBLIC_API void libvlc_media_player_set_chapter( libvlc_media_player_t *, int, libvlc_exception_t *);
664
665 /**
666  * Get movie chapter
667  *
668  * \param p_mi the Media Player
669  * \param p_e an initialized exception pointer
670  * \return chapter number currently playing
671  */
672 VLC_PUBLIC_API int libvlc_media_player_get_chapter( libvlc_media_player_t *, libvlc_exception_t * );
673
674 /**
675  * Get movie chapter count
676  *
677  * \param p_mi the Media Player
678  * \param p_e an initialized exception pointer
679  * \return number of chapters in movie
680  */
681 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count( libvlc_media_player_t *, libvlc_exception_t *);
682 VLC_PUBLIC_API int libvlc_media_player_will_play        ( libvlc_media_player_t *, libvlc_exception_t *);
683
684 /**
685  * Get title chapter count
686  *
687  * \param p_mi the Media Player
688  * \param i_title title
689  * \param p_e an initialized exception pointer
690  * \return number of chapters in title
691  */
692 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count_for_title(
693                        libvlc_media_player_t *, int, libvlc_exception_t *);
694
695 /**
696  * Set movie title
697  *
698  * \param p_mi the Media Player
699  * \param i_title title number to play
700  * \param p_e an initialized exception pointer
701  */
702 VLC_PUBLIC_API void libvlc_media_player_set_title( libvlc_media_player_t *, int, libvlc_exception_t *);
703
704 /**
705  * Get movie title
706  *
707  * \param p_mi the Media Player
708  * \param p_e an initialized exception pointer
709  * \return title number currently playing
710  */
711 VLC_PUBLIC_API int libvlc_media_player_get_title( libvlc_media_player_t *, libvlc_exception_t *);
712
713 /**
714  * Get movie title count
715  *
716  * \param p_mi the Media Player
717  * \param p_e an initialized exception pointer
718  * \return title number count
719  */
720 VLC_PUBLIC_API int libvlc_media_player_get_title_count( libvlc_media_player_t *, libvlc_exception_t *);
721
722 /**
723  * Set previous chapter
724  *
725  * \param p_mi the Media Player
726  * \param p_e an initialized exception pointer
727  */
728 VLC_PUBLIC_API void libvlc_media_player_previous_chapter( libvlc_media_player_t *, libvlc_exception_t *);
729
730 /**
731  * Set next chapter
732  *
733  * \param p_mi the Media Player
734  * \param p_e an initialized exception pointer
735  */
736 VLC_PUBLIC_API void libvlc_media_player_next_chapter( libvlc_media_player_t *, libvlc_exception_t *);
737
738 /**
739  * Get movie play rate
740  *
741  * \param p_mi the Media Player
742  * \param p_e an initialized exception pointer
743  * \return movie play rate
744  */
745 VLC_PUBLIC_API float libvlc_media_player_get_rate( libvlc_media_player_t *, libvlc_exception_t *);
746
747 /**
748  * Set movie play rate
749  *
750  * \param p_mi the Media Player
751  * \param movie play rate to set
752  * \param p_e an initialized exception pointer
753  */
754 VLC_PUBLIC_API void libvlc_media_player_set_rate( libvlc_media_player_t *, float, libvlc_exception_t *);
755
756 /**
757  * Get current movie state
758  *
759  * \param p_mi the Media Player
760  * \param p_e an initialized exception pointer
761  * \return current movie state as libvlc_state_t
762  */
763 VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *, libvlc_exception_t *);
764
765 /**
766  * Get movie fps rate
767  *
768  * \param p_mi the Media Player
769  * \param p_e an initialized exception pointer
770  * \return frames per second (fps) for this playing movie
771  */
772 VLC_PUBLIC_API float libvlc_media_player_get_fps( libvlc_media_player_t *, libvlc_exception_t *);
773
774 /** end bug */
775
776 /**
777  * Does this media player have a video output?
778  *
779  * \param p_md the media player
780  * \param p_e an initialized exception pointer
781  */
782 VLC_PUBLIC_API int  libvlc_media_player_has_vout( libvlc_media_player_t *, libvlc_exception_t *);
783
784 /**
785  * Is this media player seekable?
786  *
787  * \param p_input the input
788  * \param p_e an initialized exception pointer
789  */
790 VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
791
792 /**
793  * Can this media player be paused?
794  *
795  * \param p_input the input
796  * \param p_e an initialized exception pointer
797  */
798 VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
799
800 /**
801  * Release (free) libvlc_track_description_t
802  *
803  * \param p_track_description the structure to release
804  */
805 VLC_PUBLIC_API void libvlc_track_description_release( libvlc_track_description_t *p_track_description );
806
807 /** \defgroup libvlc_video libvlc_video
808  * \ingroup libvlc_media_player
809  * LibVLC Video handling
810  * @{
811  */
812
813 /**
814  * Toggle fullscreen status on video output.
815  *
816  * \param p_mediaplayer the media player
817  * \param p_e an initialized exception pointer
818  */
819 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
820
821 /**
822  * Enable or disable fullscreen on a video output.
823  *
824  * \param p_mediaplayer the media player
825  * \param b_fullscreen boolean for fullscreen status
826  * \param p_e an initialized exception pointer
827  */
828 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *, int, libvlc_exception_t * );
829
830 /**
831  * Get current fullscreen status.
832  *
833  * \param p_mediaplayer the media player
834  * \param p_e an initialized exception pointer
835  * \return the fullscreen status (boolean)
836  */
837 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
838
839 /**
840  * Get current video height.
841  *
842  * \param p_mediaplayer the media player
843  * \param p_e an initialized exception pointer
844  * \return the video height
845  */
846 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_player_t *, libvlc_exception_t * );
847
848 /**
849  * Get current video width.
850  *
851  * \param p_mediaplayer the media player
852  * \param p_e an initialized exception pointer
853  * \return the video width
854  */
855 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_player_t *, libvlc_exception_t * );
856
857 /**
858  * Get current video aspect ratio.
859  *
860  * \param p_mediaplayer the media player
861  * \param p_e an initialized exception pointer
862  * \return the video aspect ratio
863  */
864 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *, libvlc_exception_t * );
865
866 /**
867  * Set new video aspect ratio.
868  *
869  * \param p_mediaplayer the media player
870  * \param psz_aspect new video aspect-ratio
871  * \param p_e an initialized exception pointer
872  */
873 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *, char *, libvlc_exception_t * );
874
875 /**
876  * Get current video subtitle.
877  *
878  * \param p_mediaplayer the media player
879  * \param p_e an initialized exception pointer
880  * \return the video subtitle selected
881  */
882 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *, libvlc_exception_t * );
883
884 /**
885  * Get the number of available video subtitles.
886  *
887  * \param p_mediaplayer the media player
888  * \param p_e an initialized exception pointer
889  * \return the number of available video subtitles
890  */
891 VLC_PUBLIC_API int libvlc_video_get_spu_count( libvlc_media_player_t *, libvlc_exception_t * );
892
893 /**
894  * Get the description of available video subtitles.
895  *
896  * \param p_mediaplayer the media player
897  * \param p_e an initialized exception pointer
898  * \return list containing description of available video subtitles
899  */
900 VLC_PUBLIC_API libvlc_track_description_t *
901         libvlc_video_get_spu_description( libvlc_media_player_t *, libvlc_exception_t * );
902
903 /**
904  * Set new video subtitle.
905  *
906  * \param p_mediaplayer the media player
907  * \param i_spu new video subtitle to select
908  * \param p_e an initialized exception pointer
909  */
910 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_player_t *, int , libvlc_exception_t * );
911
912 /**
913  * Set new video subtitle file.
914  *
915  * \param p_mediaplayer the media player
916  * \param psz_subtitle new video subtitle file
917  * \param p_e an initialized exception pointer
918  * \return the success status (boolean)
919  */
920 VLC_PUBLIC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *, char *, libvlc_exception_t * );
921
922 /**
923  * Get the description of available titles.
924  *
925  * \param p_mediaplayer the media player
926  * \param p_e an initialized exception pointer
927  * \return list containing description of available titles
928  */
929 VLC_PUBLIC_API libvlc_track_description_t *
930         libvlc_video_get_title_description( libvlc_media_player_t *, libvlc_exception_t * );
931
932 /**
933  * Get the description of available chapters for specific title.
934  *
935  * \param p_mediaplayer the media player
936  * \param i_title selected title
937  * \param p_e an initialized exception pointer
938  * \return list containing description of available chapter for title i_title
939  */
940 VLC_PUBLIC_API libvlc_track_description_t *
941         libvlc_video_get_chapter_description( libvlc_media_player_t *, int, libvlc_exception_t * );
942
943 /**
944  * Get current crop filter geometry.
945  *
946  * \param p_mediaplayer the media player
947  * \param p_e an initialized exception pointer
948  * \return the crop filter geometry
949  */
950 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *, libvlc_exception_t * );
951
952 /**
953  * Set new crop filter geometry.
954  *
955  * \param p_mediaplayer the media player
956  * \param psz_geometry new crop filter geometry
957  * \param p_e an initialized exception pointer
958  */
959 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_player_t *, char *, libvlc_exception_t * );
960
961 /**
962  * Toggle teletext transparent status on video output.
963  *
964  * \param p_mediaplayer the media player
965  * \param p_e an initialized exception pointer
966  */
967 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *, libvlc_exception_t * );
968
969 /**
970  * Get current teletext page requested.
971  *
972  * \param p_mediaplayer the media player
973  * \param p_e an initialized exception pointer
974  * \return the current teletext page requested.
975  */
976 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t *, libvlc_exception_t * );
977
978 /**
979  * Set new teletext page to retrieve.
980  *
981  * \param p_mediaplayer the media player
982  * \param i_page teletex page number requested
983  * \param p_e an initialized exception pointer
984  */
985 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *, int, libvlc_exception_t * );
986
987 /**
988  * Get number of available video tracks.
989  *
990  * \param p_mi media player
991  * \param p_e an initialized exception
992  * \return the number of available video tracks (int)
993  */
994 VLC_PUBLIC_API int libvlc_video_get_track_count( libvlc_media_player_t *,  libvlc_exception_t * );
995
996 /**
997  * Get the description of available video tracks.
998  *
999  * \param p_mi media player
1000  * \param p_e an initialized exception
1001  * \return list with description of available video tracks
1002  */
1003 VLC_PUBLIC_API libvlc_track_description_t *
1004         libvlc_video_get_track_description( libvlc_media_player_t *,  libvlc_exception_t * );
1005
1006 /**
1007  * Get current video track.
1008  *
1009  * \param p_mi media player
1010  * \param p_e an initialized exception pointer
1011  * \return the video track (int)
1012  */
1013 VLC_PUBLIC_API int libvlc_video_get_track( libvlc_media_player_t *, libvlc_exception_t * );
1014
1015 /**
1016  * Set video track.
1017  *
1018  * \param p_mi media player
1019  * \param i_track the track (int)
1020  * \param p_e an initialized exception pointer
1021  */
1022 VLC_PUBLIC_API void libvlc_video_set_track( libvlc_media_player_t *, int, libvlc_exception_t * );
1023
1024 /**
1025  * Take a snapshot of the current video window.
1026  *
1027  * If i_width AND i_height is 0, original size is used.
1028  * If i_width XOR i_height is 0, original aspect-ratio is preserved.
1029  *
1030  * \param p_mediaplayer the media player
1031  * \param psz_filepath the path where to save the screenshot to
1032  * \param i_width the snapshot's width
1033  * \param i_height the snapshot's height
1034  * \param p_e an initialized exception pointer
1035  */
1036 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_player_t *, char *,unsigned int, unsigned int, libvlc_exception_t * );
1037
1038 /**
1039  * Resize the current video output window.
1040  *
1041  * \param p_instance libvlc instance
1042  * \param width new width for video output window
1043  * \param height new height for video output window
1044  * \param p_e an initialized exception pointer
1045  * \return the success status (boolean)
1046  */
1047 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_player_t *, int, int, libvlc_exception_t *);
1048
1049 /**
1050  * Tell windowless video output to redraw rectangular area (MacOS X only).
1051  *
1052  * \param p_instance libvlc instance
1053  * \param area coordinates within video drawable
1054  * \param p_e an initialized exception pointer
1055  */
1056 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_player_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
1057
1058 /**
1059  * Set the default video output size.
1060  *
1061  * This setting will be used as default for all video outputs.
1062  *
1063  * \param p_instance libvlc instance
1064  * \param width new width for video drawable
1065  * \param height new height for video drawable
1066  * \param p_e an initialized exception pointer
1067  */
1068 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
1069
1070 /**
1071  * Set the default video output viewport for a windowless video output
1072  * (MacOS X only).
1073  *
1074  * This setting will be used as default for all video outputs.
1075  *
1076  * \param p_instance libvlc instance
1077  * \param view coordinates within video drawable
1078  * \param clip coordinates within video drawable
1079  * \param p_e an initialized exception pointer
1080  */
1081 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
1082
1083 /** @} video */
1084
1085 /** \defgroup libvlc_audio libvlc_audio
1086  * \ingroup libvlc_media_player
1087  * LibVLC Audio handling
1088  * @{
1089  */
1090
1091 /**
1092  * Audio device types
1093  */
1094 typedef enum libvlc_audio_output_device_types_t {
1095     libvlc_AudioOutputDevice_Error  = -1,
1096     libvlc_AudioOutputDevice_Mono   =  1,
1097     libvlc_AudioOutputDevice_Stereo =  2,
1098     libvlc_AudioOutputDevice_2F2R   =  4,
1099     libvlc_AudioOutputDevice_3F2R   =  5,
1100     libvlc_AudioOutputDevice_5_1    =  6,
1101     libvlc_AudioOutputDevice_6_1    =  7,
1102     libvlc_AudioOutputDevice_7_1    =  8,
1103     libvlc_AudioOutputDevice_SPDIF  = 10
1104 } libvlc_audio_output_device_types_t;
1105
1106 /**
1107  * Audio channels
1108  */
1109 typedef enum libvlc_audio_output_channel_t {
1110     libvlc_AudioChannel_Error   = -1,
1111     libvlc_AudioChannel_Stereo  =  1,
1112     libvlc_AudioChannel_RStereo =  2,
1113     libvlc_AudioChannel_Left    =  3,
1114     libvlc_AudioChannel_Right   =  4,
1115     libvlc_AudioChannel_Dolbys  =  5
1116 } libvlc_audio_output_channel_t;
1117
1118
1119 /**
1120  * Get the list of available audio outputs
1121  *
1122  * \param p_instance libvlc instance
1123  * \param p_e an initialized exception pointer
1124  * \return list of available audio outputs, at the end free it with
1125 *          \see libvlc_audio_output_list_release \see libvlc_audio_output_t
1126  */
1127 VLC_PUBLIC_API libvlc_audio_output_t *
1128         libvlc_audio_output_list_get( libvlc_instance_t *,
1129                                       libvlc_exception_t * );
1130
1131 /**
1132  * Free the list of available audio outputs
1133  *
1134  * \param p_list list with audio outputs for release
1135  */
1136 VLC_PUBLIC_API void libvlc_audio_output_list_release( libvlc_audio_output_t * );
1137
1138 /**
1139  * Set the audio output.
1140  * Change will be applied after stop and play.
1141  *
1142  * \param p_instance libvlc instance
1143  * \param psz_name name of audio output,
1144  *               use psz_name of \see libvlc_audio_output_t
1145  * \return true if function succeded
1146  */
1147 VLC_PUBLIC_API int libvlc_audio_output_set( libvlc_instance_t *,
1148                                             const char * );
1149
1150 /**
1151  * Get count of devices for audio output, these devices are hardware oriented
1152  * like analor or digital output of sound card
1153  *
1154  * \param p_instance libvlc instance
1155  * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1156  * \return number of devices
1157  */
1158 VLC_PUBLIC_API int libvlc_audio_output_device_count( libvlc_instance_t *,
1159                                                      const char * );
1160
1161 /**
1162  * Get long name of device, if not available short name given
1163  *
1164  * \param p_instance libvlc instance
1165  * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1166  * \param i_device device index
1167  * \return long name of device
1168  */
1169 VLC_PUBLIC_API char * libvlc_audio_output_device_longname( libvlc_instance_t *,
1170                                                            const char *,
1171                                                            int );
1172
1173 /**
1174  * Get id name of device
1175  *
1176  * \param p_instance libvlc instance
1177  * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1178  * \param i_device device index
1179  * \return id name of device, use for setting device, need to be free after use
1180  */
1181 VLC_PUBLIC_API char * libvlc_audio_output_device_id( libvlc_instance_t *,
1182                                                      const char *,
1183                                                      int );
1184
1185 /**
1186  * Set device for using
1187  *
1188  * \param p_instance libvlc instance
1189  * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1190  * \param psz_device_id device
1191  */
1192 VLC_PUBLIC_API void libvlc_audio_output_device_set( libvlc_instance_t *,
1193                                                     const char *,
1194                                                     const char * );
1195
1196 /**
1197  * Get current audio device type. Device type describes something like
1198  * character of output sound - stereo sound, 2.1, 5.1 etc
1199  *
1200  * \param p_instance vlc instance
1201  * \param p_e an initialized exception pointer
1202  * \return the audio devices type \see libvlc_audio_output_device_types_t
1203  */
1204 VLC_PUBLIC_API int libvlc_audio_output_get_device_type(
1205         libvlc_instance_t *, libvlc_exception_t * );
1206
1207 /**
1208  * Set current audio device type.
1209  *
1210  * \param p_instance vlc instance
1211  * \param device_type the audio device type,
1212           according to \see libvlc_audio_output_device_types_t
1213  * \param p_e an initialized exception pointer
1214  */
1215 VLC_PUBLIC_API void libvlc_audio_output_set_device_type( libvlc_instance_t *,
1216                                                          int,
1217                                                          libvlc_exception_t * );
1218
1219
1220 /**
1221  * Toggle mute status.
1222  *
1223  * \param p_instance libvlc instance
1224  * \param p_e an initialized exception pointer
1225  */
1226 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
1227
1228 /**
1229  * Get current mute status.
1230  *
1231  * \param p_instance libvlc instance
1232  * \param p_e an initialized exception pointer
1233  * \return the mute status (boolean)
1234  */
1235 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
1236
1237 /**
1238  * Set mute status.
1239  *
1240  * \param p_instance libvlc instance
1241  * \param status If status is true then mute, otherwise unmute
1242  * \param p_e an initialized exception pointer
1243  */
1244 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, int , libvlc_exception_t * );
1245
1246 /**
1247  * Get current audio level.
1248  *
1249  * \param p_instance libvlc instance
1250  * \param p_e an initialized exception pointer
1251  * \return the audio level (int)
1252  */
1253 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
1254
1255 /**
1256  * Set current audio level.
1257  *
1258  * \param p_instance libvlc instance
1259  * \param i_volume the volume (int)
1260  * \param p_e an initialized exception pointer
1261  */
1262 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
1263
1264 /**
1265  * Get number of available audio tracks.
1266  *
1267  * \param p_mi media player
1268  * \param p_e an initialized exception
1269  * \return the number of available audio tracks (int)
1270  */
1271 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *,  libvlc_exception_t * );
1272
1273  /**
1274  * Get the description of available audio tracks.
1275  *
1276  * \param p_mi media player
1277  * \param p_e an initialized exception
1278  * \return list with description of available audio tracks
1279  */
1280 VLC_PUBLIC_API libvlc_track_description_t *
1281         libvlc_audio_get_track_description( libvlc_media_player_t *,  libvlc_exception_t * );
1282
1283 /**
1284  * Get current audio track.
1285  *
1286  * \param p_mi media player
1287  * \param p_e an initialized exception pointer
1288  * \return the audio track (int)
1289  */
1290 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *, libvlc_exception_t * );
1291
1292 /**
1293  * Set current audio track.
1294  *
1295  * \param p_mi media player
1296  * \param i_track the track (int)
1297  * \param p_e an initialized exception pointer
1298  */
1299 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_player_t *, int, libvlc_exception_t * );
1300
1301 /**
1302  * Get current audio channel.
1303  *
1304  * \param p_instance vlc instance
1305  * \param p_e an initialized exception pointer
1306  * \return the audio channel \see libvlc_audio_output_channel_t
1307  */
1308 VLC_PUBLIC_API int
1309     libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
1310
1311 /**
1312  * Set current audio channel.
1313  *
1314  * \param p_instance vlc instance
1315  * \param channel the audio channel, \see libvlc_audio_output_channel_t
1316  * \param p_e an initialized exception pointer
1317  */
1318 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *,
1319                                               int,
1320                                               libvlc_exception_t * );
1321
1322 /** @} audio */
1323
1324 /** @} media_player */
1325
1326 /*****************************************************************************
1327  * Event handling
1328  *****************************************************************************/
1329
1330 /** \defgroup libvlc_event libvlc_event
1331  * \ingroup libvlc_core
1332  * LibVLC Events
1333  * @{
1334  */
1335
1336 /**
1337  * Register for an event notification.
1338  *
1339  * \param p_event_manager the event manager to which you want to attach to.
1340  *        Generally it is obtained by vlc_my_object_event_manager() where
1341  *        my_object is the object you want to listen to.
1342  * \param i_event_type the desired event to which we want to listen
1343  * \param f_callback the function to call when i_event_type occurs
1344  * \param user_data user provided data to carry with the event
1345  * \param p_e an initialized exception pointer
1346  */
1347 VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
1348                                          libvlc_event_type_t i_event_type,
1349                                          libvlc_callback_t f_callback,
1350                                          void *user_data,
1351                                          libvlc_exception_t *p_e );
1352
1353 /**
1354  * Unregister an event notification.
1355  *
1356  * \param p_event_manager the event manager
1357  * \param i_event_type the desired event to which we want to unregister
1358  * \param f_callback the function to call when i_event_type occurs
1359  * \param p_user_data user provided data to carry with the event
1360  * \param p_e an initialized exception pointer
1361  */
1362 VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
1363                                          libvlc_event_type_t i_event_type,
1364                                          libvlc_callback_t f_callback,
1365                                          void *p_user_data,
1366                                          libvlc_exception_t *p_e );
1367
1368 /**
1369  * Get an event's type name.
1370  *
1371  * \param i_event_type the desired event
1372  */
1373 VLC_PUBLIC_API const char * libvlc_event_type_name( libvlc_event_type_t event_type );
1374
1375 /** @} */
1376
1377 /*****************************************************************************
1378  * Media Library
1379  *****************************************************************************/
1380 /** \defgroup libvlc_media_library libvlc_media_library
1381  * \ingroup libvlc
1382  * LibVLC Media Library
1383  * @{
1384  */
1385 VLC_PUBLIC_API libvlc_media_library_t *
1386     libvlc_media_library_new( libvlc_instance_t * p_inst,
1387                               libvlc_exception_t * p_e );
1388
1389 /**
1390  * Release media library object. This functions decrements the
1391  * reference count of the media library object. If it reaches 0,
1392  * then the object will be released.
1393  *
1394  * \param p_mlib media library object
1395  */
1396 VLC_PUBLIC_API void
1397     libvlc_media_library_release( libvlc_media_library_t * p_mlib );
1398
1399 /**
1400  * Retain a reference to a media library object. This function will
1401  * increment the reference counting for this object. Use
1402  * libvlc_media_library_release() to decrement the reference count.
1403  *
1404  * \param p_mlib media library object
1405  */
1406 VLC_PUBLIC_API void
1407     libvlc_media_library_retain( libvlc_media_library_t * p_mlib );
1408
1409 /**
1410  * Load media library.
1411  *
1412  * \param p_mlib media library object
1413  * \param p_e an initialized exception object.
1414  */
1415 VLC_PUBLIC_API void
1416     libvlc_media_library_load( libvlc_media_library_t * p_mlib,
1417                                libvlc_exception_t * p_e );
1418
1419 /**
1420  * Save media library.
1421  *
1422  * \param p_mlib media library object
1423  * \param p_e an initialized exception object.
1424  */
1425 VLC_PUBLIC_API void
1426     libvlc_media_library_save( libvlc_media_library_t * p_mlib,
1427                                libvlc_exception_t * p_e );
1428
1429 /**
1430  * Get media library subitems.
1431  *
1432  * \param p_mlib media library object
1433  * \param p_e an initialized exception object.
1434  * \return media list subitems
1435  */
1436 VLC_PUBLIC_API libvlc_media_list_t *
1437     libvlc_media_library_media_list( libvlc_media_library_t * p_mlib,
1438                                      libvlc_exception_t * p_e );
1439
1440
1441 /** @} */
1442
1443
1444 /*****************************************************************************
1445  * Services/Media Discovery
1446  *****************************************************************************/
1447 /** \defgroup libvlc_media_discoverer libvlc_media_discoverer
1448  * \ingroup libvlc
1449  * LibVLC Media Discoverer
1450  * @{
1451  */
1452
1453 /**
1454  * Discover media service by name.
1455  *
1456  * \param p_inst libvlc instance
1457  * \param psz_name service name
1458  * \param p_e an initialized exception object
1459  * \return media discover object
1460  */
1461 VLC_PUBLIC_API libvlc_media_discoverer_t *
1462 libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
1463                                        const char * psz_name,
1464                                        libvlc_exception_t * p_e );
1465
1466 /**
1467  * Release media discover object. If the reference count reaches 0, then
1468  * the object will be released.
1469  *
1470  * \param p_mdis media service discover object
1471  */
1472 VLC_PUBLIC_API void   libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
1473
1474 /**
1475  * Get media service discover object its localized name.
1476  *
1477  * \param media discover object
1478  * \return localized name
1479  */
1480 VLC_PUBLIC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
1481
1482 /**
1483  * Get media service discover media list.
1484  *
1485  * \param p_mdis media service discover object
1486  * \return list of media items
1487  */
1488 VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis );
1489
1490 /**
1491  * Get event manager from media service discover object.
1492  *
1493  * \param p_mdis media service discover object
1494  * \return event manager object.
1495  */
1496 VLC_PUBLIC_API libvlc_event_manager_t *
1497         libvlc_media_discoverer_event_manager( libvlc_media_discoverer_t * p_mdis );
1498
1499 /**
1500  * Query if media service discover object is running.
1501  *
1502  * \param p_mdis media service discover object
1503  * \return true if running, false if not
1504  */
1505 VLC_PUBLIC_API int
1506         libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis );
1507
1508 /**@} */
1509
1510
1511 /*****************************************************************************
1512  * Message log handling
1513  *****************************************************************************/
1514
1515 /** \defgroup libvlc_log libvlc_log
1516  * \ingroup libvlc_core
1517  * LibVLC Message Logging
1518  * @{
1519  */
1520
1521 /**
1522  * Return the VLC messaging verbosity level.
1523  *
1524  * \param p_instance libvlc instance
1525  * \param p_e an initialized exception pointer
1526  * \return verbosity level for messages
1527  */
1528 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
1529                                                   libvlc_exception_t *p_e );
1530
1531 /**
1532  * Set the VLC messaging verbosity level.
1533  *
1534  * \param p_instance libvlc log instance
1535  * \param level log level
1536  * \param p_e an initialized exception pointer
1537  */
1538 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
1539                                               libvlc_exception_t *p_e );
1540
1541 /**
1542  * Open a VLC message log instance.
1543  *
1544  * \param p_instance libvlc instance
1545  * \param p_e an initialized exception pointer
1546  * \return log message instance
1547  */
1548 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( libvlc_instance_t *, libvlc_exception_t *);
1549
1550 /**
1551  * Close a VLC message log instance.
1552  *
1553  * \param p_log libvlc log instance
1554  * \param p_e an initialized exception pointer
1555  */
1556 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
1557
1558 /**
1559  * Returns the number of messages in a log instance.
1560  *
1561  * \param p_log libvlc log instance
1562  * \param p_e an initialized exception pointer
1563  * \return number of log messages
1564  */
1565 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
1566
1567 /**
1568  * Clear a log instance.
1569  *
1570  * All messages in the log are removed. The log should be cleared on a
1571  * regular basis to avoid clogging.
1572  *
1573  * \param p_log libvlc log instance
1574  * \param p_e an initialized exception pointer
1575  */
1576 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
1577
1578 /**
1579  * Allocate and returns a new iterator to messages in log.
1580  *
1581  * \param p_log libvlc log instance
1582  * \param p_e an initialized exception pointer
1583  * \return log iterator object
1584  */
1585 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
1586
1587 /**
1588  * Release a previoulsy allocated iterator.
1589  *
1590  * \param p_iter libvlc log iterator
1591  * \param p_e an initialized exception pointer
1592  */
1593 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1594
1595 /**
1596  * Return whether log iterator has more messages.
1597  *
1598  * \param p_iter libvlc log iterator
1599  * \param p_e an initialized exception pointer
1600  * \return true if iterator has more message objects, else false
1601  */
1602 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1603
1604 /**
1605  * Return the next log message.
1606  *
1607  * The message contents must not be freed
1608  *
1609  * \param p_iter libvlc log iterator
1610  * \param p_buffer log buffer
1611  * \param p_e an initialized exception pointer
1612  * \return log message object
1613  */
1614 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
1615                                                                libvlc_log_message_t *p_buffer,
1616                                                                libvlc_exception_t *p_e );
1617
1618 /** @} */
1619
1620 # ifdef __cplusplus
1621 }
1622 # endif
1623
1624 #endif /* <vlc/libvlc.h> */