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