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