]> git.sesse.net Git - vlc/blob - include/vlc/libvlc.h
libvlc.h: document the fact that libvlc_media_player_get_length/get_time/set_time...
[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 _at_ m2x _dot_ nl>
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  * \defgroup libvlc libvlc
28  * This is libvlc, the base library of the VLC program.
29  *
30  * @{
31  */
32
33
34 #ifndef VLC_LIBVLC_H
35 #define VLC_LIBVLC_H 1
36
37 #if defined (WIN32) && defined (DLL_EXPORT)
38 # define VLC_PUBLIC_API __declspec(dllexport)
39 #else
40 # define VLC_PUBLIC_API
41 #endif
42
43 #ifdef __LIBVLC__
44 /* Avoid unuseful warnings from libvlc with our deprecated APIs */
45 #   define VLC_DEPRECATED_API VLC_PUBLIC_API
46 #elif defined(__GNUC__) && \
47       (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
48 # define VLC_DEPRECATED_API VLC_PUBLIC_API __attribute__((deprecated))
49 #else
50 # define VLC_DEPRECATED_API VLC_PUBLIC_API
51 #endif
52
53 # ifdef __cplusplus
54 extern "C" {
55 # endif
56
57 /*****************************************************************************
58  * Exception handling
59  *****************************************************************************/
60 /** \defgroup libvlc_exception libvlc_exception
61  * \ingroup libvlc_core
62  * LibVLC Exceptions handling
63  * @{
64  */
65
66 /**
67  * Initialize an exception structure. This can be called several times to
68  * reuse an exception structure.
69  *
70  * \param p_exception the exception to initialize
71  */
72 VLC_PUBLIC_API void libvlc_exception_init( libvlc_exception_t *p_exception );
73
74 /**
75  * Has an exception been raised?
76  *
77  * \param p_exception the exception to query
78  * \return 0 if the exception was raised, 1 otherwise
79  */
80 VLC_PUBLIC_API int
81 libvlc_exception_raised( const libvlc_exception_t *p_exception );
82
83 /**
84  * Raise an exception using a user-provided message.
85  *
86  * \param p_exception the exception to raise
87  * \param psz_format the exception message format string
88  * \param ... the format string arguments
89  */
90 VLC_PUBLIC_API void
91 libvlc_exception_raise( libvlc_exception_t *p_exception,
92                         const char *psz_format, ... );
93
94 /**
95  * Clear an exception object so it can be reused.
96  * The exception object must have be initialized.
97  *
98  * \param p_exception the exception to clear
99  */
100 VLC_PUBLIC_API void libvlc_exception_clear( libvlc_exception_t * );
101
102 /**
103  * Get an exception's message.
104  *
105  * \param p_exception the exception to query
106  * \return the exception message or NULL if not applicable (exception not
107  *         raised, for example)
108  */
109 VLC_PUBLIC_API const char *
110 libvlc_exception_get_message( const libvlc_exception_t *p_exception );
111
112 /**@} */
113
114 /*****************************************************************************
115  * Core handling
116  *****************************************************************************/
117
118 /** \defgroup libvlc_core libvlc_core
119  * \ingroup libvlc
120  * LibVLC Core
121  * @{
122  */
123
124 /**
125  * Create and initialize a libvlc instance.
126  *
127  * \param argc the number of arguments
128  * \param argv command-line-type arguments. argv[0] must be the path of the
129  *        calling program.
130  * \param p_e an initialized exception pointer
131  * \return the libvlc instance
132  */
133 VLC_PUBLIC_API libvlc_instance_t *
134 libvlc_new( int , const char *const *, libvlc_exception_t *);
135
136 /**
137  * Return a libvlc instance identifier for legacy APIs. Use of this
138  * function is discouraged, you should convert your program to use the
139  * new API.
140  *
141  * \param p_instance the instance
142  * \return the instance identifier
143  */
144 VLC_PUBLIC_API int libvlc_get_vlc_id( libvlc_instance_t *p_instance );
145
146 /**
147  * Decrement the reference count of a libvlc instance, and destroy it
148  * if it reaches zero.
149  *
150  * \param p_instance the instance to destroy
151  */
152 VLC_PUBLIC_API void libvlc_release( libvlc_instance_t * );
153
154 /**
155  * Increments the reference count of a libvlc instance.
156  * The initial reference count is 1 after libvlc_new() returns.
157  *
158  * \param p_instance the instance to reference
159  */
160 VLC_PUBLIC_API void libvlc_retain( libvlc_instance_t * );
161
162 /**
163  * Try to start a user interface for the libvlc instance, and wait until the
164  * user exits.
165  *
166  * \param p_instance the instance
167  * \param name interface name, or NULL for default
168  * \param p_exception an initialized exception pointer
169  */
170 VLC_PUBLIC_API
171 void libvlc_add_intf( libvlc_instance_t *p_instance, const char *name,
172                       libvlc_exception_t *p_exception );
173
174 /**
175  * Waits until an interface causes the instance to exit.
176  * You should start at least one interface first, using libvlc_add_intf().
177  *
178  * \param p_instance the instance
179  */
180 VLC_PUBLIC_API
181 void libvlc_wait( libvlc_instance_t *p_instance );
182
183 /**
184  * Retrieve libvlc version.
185  *
186  * Example: "0.9.0-git Grishenko"
187  *
188  * \return a string containing the libvlc version
189  */
190 VLC_PUBLIC_API const char * libvlc_get_version(void);
191
192 /**
193  * Retrieve libvlc compiler version.
194  *
195  * Example: "gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu6)"
196  *
197  * \return a string containing the libvlc compiler version
198  */
199 VLC_PUBLIC_API const char * libvlc_get_compiler(void);
200
201 /**
202  * Retrieve libvlc changeset.
203  *
204  * Example: "aa9bce0bc4"
205  *
206  * \return a string containing the libvlc changeset
207  */
208 VLC_PUBLIC_API const char * libvlc_get_changeset(void);
209
210 /** @}*/
211
212 /*****************************************************************************
213  * media
214  *****************************************************************************/
215 /** \defgroup libvlc_media libvlc_media
216  * \ingroup libvlc
217  * LibVLC Media
218  * @{
219  */
220
221 /**
222  * Create a media with the given MRL.
223  *
224  * \param p_instance the instance
225  * \param psz_mrl the MRL to read
226  * \param p_e an initialized exception pointer
227  * \return the newly created media
228  */
229 VLC_PUBLIC_API libvlc_media_t * libvlc_media_new(
230                                    libvlc_instance_t *p_instance,
231                                    const char * psz_mrl,
232                                    libvlc_exception_t *p_e );
233
234 /**
235  * Create a media as an empty node with the passed name.
236  *
237  * \param p_instance the instance
238  * \param psz_name the name of the node
239  * \param p_e an initialized exception pointer
240  * \return the new empty media
241  */
242 VLC_PUBLIC_API libvlc_media_t * libvlc_media_new_as_node(
243                                    libvlc_instance_t *p_instance,
244                                    const char * psz_name,
245                                    libvlc_exception_t *p_e );
246
247 /**
248  * Add an option to the media.
249  *
250  * This option will be used to determine how the media_player will
251  * read the media. This allows to use VLC's advanced
252  * reading/streaming options on a per-media basis.
253  *
254  * The options are detailed in vlc --long-help, for instance "--sout-all"
255  *
256  * \param p_instance the instance
257  * \param ppsz_options the options (as a string)
258  * \param p_e an initialized exception pointer
259  */
260 VLC_PUBLIC_API void libvlc_media_add_option(
261                                    libvlc_media_t * p_md,
262                                    const char * ppsz_options,
263                                    libvlc_exception_t * p_e );
264
265 /**
266  * Retain a reference to a media descriptor object (libvlc_media_t). Use
267  * libvlc_media_release() to decrement the reference count of a 
268  * media descriptor object.
269  *
270  * \param p_meta_desc a media descriptor object.
271  */
272 VLC_PUBLIC_API void libvlc_media_retain(
273                                    libvlc_media_t *p_meta_desc );
274
275 /**
276  * Decrement the reference count of a media descriptor object. If the
277  * reference count is 0, then libvlc_media_release() will release the
278  * media descriptor object. It will send out an libvlc_MediaFreed event
279  * to all listeners. If the media descriptor object has been released it
280  * should not be used again.
281  *
282  * \param p_meta_desc a media descriptor object.
283  */
284 VLC_PUBLIC_API void libvlc_media_release(
285                                    libvlc_media_t *p_meta_desc );
286
287
288 /**
289  * Get the media resource locator (mrl) from a media descriptor object
290  *
291  * \param p_md a media descriptor object
292  * \param p_e an initialized exception object
293  * \return string with mrl of media descriptor object
294  */
295 VLC_PUBLIC_API char * libvlc_media_get_mrl( libvlc_media_t * p_md,
296                                                        libvlc_exception_t * p_e );
297
298 /**
299  * Duplicate a media descriptor object.
300  *
301  * \param p_meta_desc a media descriptor object.
302  */
303 VLC_PUBLIC_API libvlc_media_t * libvlc_media_duplicate( libvlc_media_t * );
304
305 /**
306  * Read the meta of the media.
307  *
308  * \param p_meta_desc the media to read
309  * \param e_meta_desc the meta to read
310  * \param p_e an initialized exception pointer
311  * \return the media's meta
312  */
313 VLC_PUBLIC_API char * libvlc_media_get_meta(
314                                    libvlc_media_t *p_meta_desc,
315                                    libvlc_meta_t e_meta,
316                                    libvlc_exception_t *p_e );
317 /**
318  * Get current state of media descriptor object. Possible media states
319  * are defined in libvlc_structures.c ( libvlc_NothingSpecial=0,
320  * libvlc_Opening, libvlc_Buffering, libvlc_Playing, libvlc_Paused,
321  * libvlc_Stopped, libvlc_Forward, libvlc_Backward, libvlc_Ended,
322  * libvlc_Error).
323  *
324  * @see libvlc_state_t
325  * \param p_meta_desc a media descriptor object
326  * \param p_e an initialized exception object
327  * \return state of media descriptor object
328  */
329 VLC_PUBLIC_API libvlc_state_t libvlc_media_get_state(
330                                    libvlc_media_t *p_meta_desc,
331                                    libvlc_exception_t *p_e );
332
333 /**
334  * Get subitems of media descriptor object. This will increment
335  * the reference count of supplied media descriptor object. Use
336  * libvlc_media_list_release() to decrement the reference counting.
337  *
338  * \param p_md media descriptor object
339  * \param p_e initalized exception object
340  * \return list of media descriptor subitems or NULL
341  */
342 VLC_PUBLIC_API libvlc_media_list_t *
343     libvlc_media_subitems( libvlc_media_t *p_md,
344                                       libvlc_exception_t *p_e );
345 /**
346  * Get event manager from media descriptor object.
347  * NOTE: this function doesn't increment reference counting.
348  *
349  * \param p_md a media descriptor object
350  * \param p_e an initialized exception object
351  * \return event manager object
352  */
353 VLC_PUBLIC_API libvlc_event_manager_t *
354     libvlc_media_event_manager( libvlc_media_t * p_md,
355                                            libvlc_exception_t * p_e );
356
357 /**
358  * Get duration of media descriptor object item.
359  *
360  * \param p_md media descriptor object
361  * \param p_e an initialized exception object
362  * \return duration of media item
363  */
364 VLC_PUBLIC_API libvlc_time_t
365    libvlc_media_get_duration( libvlc_media_t * p_md,
366                                          libvlc_exception_t * p_e );
367
368 /**
369  * Get preparsed status for media descriptor object.
370  *
371  * \param p_md media descriptor object
372  * \param p_e an initialized exception object
373  * \return true if media object has been preparsed otherwise it returns false
374  */
375 VLC_PUBLIC_API int
376    libvlc_media_is_preparsed( libvlc_media_t * p_md,
377                                          libvlc_exception_t * p_e );
378
379 /**
380  * Sets media descriptor's user_data. user_data is specialized data 
381  * accessed by the host application, VLC.framework uses it as a pointer to 
382  * an native object that references a libvlc_media_t pointer
383  *
384  * \param p_md media descriptor object
385  * \param p_new_user_data pointer to user data
386  * \param p_e an initialized exception object
387  */
388 VLC_PUBLIC_API void
389     libvlc_media_set_user_data( libvlc_media_t * p_md,
390                                            void * p_new_user_data,
391                                            libvlc_exception_t * p_e);
392
393 /**
394  * Get media descriptor's user_data. user_data is specialized data 
395  * accessed by the host application, VLC.framework uses it as a pointer to 
396  * an native object that references a libvlc_media_t pointer
397  *
398  * \param p_md media descriptor object
399  * \param p_e an initialized exception object
400  */
401 VLC_PUBLIC_API void *
402     libvlc_media_get_user_data( libvlc_media_t * p_md,
403                                            libvlc_exception_t * p_e);
404
405 /** @}*/
406
407 /*****************************************************************************
408  * Media Player
409  *****************************************************************************/
410 /** \defgroup libvlc_media_player libvlc_media_player
411  * \ingroup libvlc
412  * LibVLC Media Player, object that let you play a media
413  * in a libvlc_drawable_t
414  * @{
415  */
416
417 /**
418  * Create an empty Media Player object
419  *
420  * \param p_libvlc_instance the libvlc instance in which the Media Player
421  *        should be created.
422  * \param p_e an initialized exception pointer
423  */
424 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t *, libvlc_exception_t * );
425
426 /**
427  * Create a Media Player object from a Media
428  *
429  * \param p_md the media. Afterwards the p_md can be safely
430  *        destroyed.
431  * \param p_e an initialized exception pointer
432  */
433 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new_from_media( libvlc_media_t *, libvlc_exception_t * );
434
435 /**
436  * Release a media_player after use
437  * Decrement the reference count of a media player object. If the
438  * reference count is 0, then libvlc_media_player_release() will 
439  * release the media player object. If the media player object 
440  * has been released, then it should not be used again.
441  *
442  * \param p_mi the Media Player to free
443  */
444 VLC_PUBLIC_API void libvlc_media_player_release( libvlc_media_player_t * );
445
446 /**
447  * Retain a reference to a media player object. Use
448  * libvlc_media_player_release() to decrement reference count.
449  *
450  * \param p_mi media player object
451  */
452 VLC_PUBLIC_API void libvlc_media_player_retain( libvlc_media_player_t * );
453
454 /** 
455  * Set the media that will be used by the media_player. If any,
456  * previous md will be released.
457  *
458  * \param p_mi the Media Player
459  * \param p_md the Media. Afterwards the p_md can be safely
460  *        destroyed.
461  * \param p_e an initialized exception pointer
462  */
463 VLC_PUBLIC_API void libvlc_media_player_set_media( libvlc_media_player_t *, libvlc_media_t *, libvlc_exception_t * );
464
465 /**
466  * Get the media used by the media_player.
467  *
468  * \param p_mi the Media Player
469  * \param p_e an initialized exception pointer
470  * \return the media associated with p_mi, or NULL if no
471  *         media is associated
472  */
473 VLC_PUBLIC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t *, libvlc_exception_t * );
474
475 /**
476  * Get the Event Manager from which the media player send event.
477  *
478  * \param p_mi the Media Player
479  * \param p_e an initialized exception pointer
480  * \return the event manager associated with p_mi
481  */
482 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *, libvlc_exception_t * );
483
484 /**
485  * Play
486  *
487  * \param p_mi the Media Player
488  * \param p_e an initialized exception pointer
489  */
490 VLC_PUBLIC_API void libvlc_media_player_play ( libvlc_media_player_t *, libvlc_exception_t * );
491
492 /**
493  * Pause
494  *
495  * \param p_mi the Media Player
496  * \param p_e an initialized exception pointer
497  */
498 VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *, libvlc_exception_t * );
499
500 /**
501  * Stop
502  *
503  * \param p_mi the Media Player
504  * \param p_e an initialized exception pointer
505  */
506 VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *, libvlc_exception_t * );
507
508 /**
509  * Set the drawable where the media player should render its video output
510  *
511  * \param p_mi the Media Player
512  * \param drawable the libvlc_drawable_t where the media player
513  *        should render its video
514  * \param p_e an initialized exception pointer
515  */
516 VLC_PUBLIC_API void libvlc_media_player_set_drawable ( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
517
518 /**
519  * Get the drawable where the media player should render its video output
520  *
521  * \param p_mi the Media Player
522  * \param p_e an initialized exception pointer
523  * \return the libvlc_drawable_t where the media player
524  *         should render its video
525  */
526 VLC_PUBLIC_API libvlc_drawable_t
527                     libvlc_media_player_get_drawable ( libvlc_media_player_t *, libvlc_exception_t * );
528
529 /** \bug This might go away ... to be replaced by a broader system */
530 /**
531  * Get the current movie length (in ms).
532  *
533  * \param p_mi the Media Player
534  * \param p_e an initialized exception pointer
535  * \return the movie length (in ms).
536  */
537 VLC_PUBLIC_API libvlc_time_t  libvlc_media_player_get_length     ( libvlc_media_player_t *, libvlc_exception_t *);
538 /**
539  * Get the current movie time (in ms).
540  *
541  * \param p_mi the Media Player
542  * \param p_e an initialized exception pointer
543  * \return the movie time (in ms).
544  */
545 VLC_PUBLIC_API libvlc_time_t  libvlc_media_player_get_time       ( libvlc_media_player_t *, libvlc_exception_t *);
546 /**
547  * Set the movie time (in ms).
548  *
549  * \param p_mi the Media Player
550  * \param the movie time (in ms).
551  * \param p_e an initialized exception pointer
552  */
553 VLC_PUBLIC_API void           libvlc_media_player_set_time       ( libvlc_media_player_t *, libvlc_time_t, libvlc_exception_t *);
554 VLC_PUBLIC_API float          libvlc_media_player_get_position   ( libvlc_media_player_t *, libvlc_exception_t *);
555 VLC_PUBLIC_API void           libvlc_media_player_set_position   ( libvlc_media_player_t *, float, libvlc_exception_t *);
556 VLC_PUBLIC_API void           libvlc_media_player_set_chapter    ( libvlc_media_player_t *, int, libvlc_exception_t *);
557 VLC_PUBLIC_API int            libvlc_media_player_get_chapter    (libvlc_media_player_t *, libvlc_exception_t *);
558 VLC_PUBLIC_API int            libvlc_media_player_get_chapter_count( libvlc_media_player_t *, libvlc_exception_t *);
559 VLC_PUBLIC_API int            libvlc_media_player_will_play      ( libvlc_media_player_t *, libvlc_exception_t *);
560 VLC_PUBLIC_API float          libvlc_media_player_get_rate       ( libvlc_media_player_t *, libvlc_exception_t *);
561 VLC_PUBLIC_API void           libvlc_media_player_set_rate       ( libvlc_media_player_t *, float, libvlc_exception_t *);
562 VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state   ( libvlc_media_player_t *, libvlc_exception_t *);
563 VLC_PUBLIC_API float          libvlc_media_player_get_fps( libvlc_media_player_t *, libvlc_exception_t *);
564 /** end bug */
565
566 /**
567  * Does this media player have a video output?
568  *
569  * \param p_md the media player
570  * \param p_e an initialized exception pointer
571  */
572 VLC_PUBLIC_API int  libvlc_media_player_has_vout( libvlc_media_player_t *, libvlc_exception_t *);
573
574 /**
575  * Is this media player seekable?
576  *
577  * \param p_input the input
578  * \param p_e an initialized exception pointer
579  */
580 VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
581
582 /**
583  * Can this media player be paused?
584  *
585  * \param p_input the input
586  * \param p_e an initialized exception pointer
587  */
588 VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
589
590 /** \defgroup libvlc_video libvlc_video
591  * \ingroup libvlc_media_player
592  * LibVLC Video handling
593  * @{
594  */
595
596 /**
597  * Toggle fullscreen status on video output.
598  *
599  * \param p_mediaplayer the media player
600  * \param p_e an initialized exception pointer
601  */
602 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
603
604 /**
605  * Enable or disable fullscreen on a video output.
606  *
607  * \param p_mediaplayer the media player
608  * \param b_fullscreen boolean for fullscreen status
609  * \param p_e an initialized exception pointer
610  */
611 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *, int, libvlc_exception_t * );
612
613 /**
614  * Get current fullscreen status.
615  *
616  * \param p_mediaplayer the media player
617  * \param p_e an initialized exception pointer
618  * \return the fullscreen status (boolean)
619  */
620 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
621
622 /**
623  * Get current video height.
624  *
625  * \param p_mediaplayer the media player
626  * \param p_e an initialized exception pointer
627  * \return the video height
628  */
629 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_player_t *, libvlc_exception_t * );
630
631 /**
632  * Get current video width.
633  *
634  * \param p_mediaplayer the media player
635  * \param p_e an initialized exception pointer
636  * \return the video width
637  */
638 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_player_t *, libvlc_exception_t * );
639
640 /**
641  * Get current video aspect ratio.
642  *
643  * \param p_mediaplayer the media player
644  * \param p_e an initialized exception pointer
645  * \return the video aspect ratio
646  */
647 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *, libvlc_exception_t * );
648
649 /**
650  * Set new video aspect ratio.
651  *
652  * \param p_mediaplayer the media player
653  * \param psz_aspect new video aspect-ratio
654  * \param p_e an initialized exception pointer
655  */
656 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *, char *, libvlc_exception_t * );
657
658 /**
659  * Get current video subtitle.
660  *
661  * \param p_mediaplayer the media player
662  * \param p_e an initialized exception pointer
663  * \return the video subtitle selected
664  */
665 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *, libvlc_exception_t * );
666
667 /**
668  * Set new video subtitle.
669  *
670  * \param p_mediaplayer the media player
671  * \param i_spu new video subtitle to select
672  * \param p_e an initialized exception pointer
673  */
674 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_player_t *, int , libvlc_exception_t * );
675
676 /**
677  * Set new video subtitle file.
678  *
679  * \param p_mediaplayer the media player
680  * \param psz_subtitle new video subtitle file
681  * \param p_e an initialized exception pointer
682  * \return the success status (boolean)
683  */
684 VLC_PUBLIC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *, char *, libvlc_exception_t * );
685
686 /**
687  * Get current crop filter geometry.
688  *
689  * \param p_mediaplayer the media player
690  * \param p_e an initialized exception pointer
691  * \return the crop filter geometry
692  */
693 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *, libvlc_exception_t * );
694
695 /**
696  * Set new crop filter geometry.
697  *
698  * \param p_mediaplayer the media player
699  * \param psz_geometry new crop filter geometry
700  * \param p_e an initialized exception pointer
701  */
702 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_player_t *, char *, libvlc_exception_t * );
703
704 /**
705  * Toggle teletext transparent status on video output.
706  *
707  * \param p_mediaplayer the media player
708  * \param p_e an initialized exception pointer
709  */
710 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *, libvlc_exception_t * );
711
712 /**
713  * Get current teletext page requested.
714  *
715  * \param p_mediaplayer the media player
716  * \param p_e an initialized exception pointer
717  * \return the current teletext page requested.
718  */
719 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t *, libvlc_exception_t * );
720
721 /**
722  * Set new teletext page to retrieve.
723  *
724  * \param p_mediaplayer the media player
725  * \param i_page teletex page number requested
726  * \param p_e an initialized exception pointer
727  */
728 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *, int, libvlc_exception_t * );
729
730 /**
731  * Take a snapshot of the current video window.
732  *
733  * If i_width AND i_height is 0, original size is used.
734  * If i_width XOR i_height is 0, original aspect-ratio is preserved.
735  *
736  * \param p_mediaplayer the media player
737  * \param psz_filepath the path where to save the screenshot to
738  * \param i_width the snapshot's width
739  * \param i_height the snapshot's height
740  * \param p_e an initialized exception pointer
741  */
742 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_player_t *, char *,unsigned int, unsigned int, libvlc_exception_t * );
743
744 /**
745  * Resize the current video output window.
746  *
747  * \param p_instance libvlc instance
748  * \param width new width for video output window
749  * \param height new height for video output window
750  * \param p_e an initialized exception pointer
751  * \return the success status (boolean)
752  */
753 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_player_t *, int, int, libvlc_exception_t *);
754
755 /**
756  * Change the parent for the current the video output.
757  *
758  * \param p_instance libvlc instance
759  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
760  * \param p_e an initialized exception pointer
761  * \return the success status (boolean)
762  */
763 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
764
765 /**
766  * Tell windowless video output to redraw rectangular area (MacOS X only).
767  *
768  * \param p_instance libvlc instance
769  * \param area coordinates within video drawable
770  * \param p_e an initialized exception pointer
771  */
772 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_player_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
773
774 /**
775  * Set the default video output size.
776  *
777  * This setting will be used as default for all video outputs.
778  *
779  * \param p_instance libvlc instance
780  * \param width new width for video drawable
781  * \param height new height for video drawable
782  * \param p_e an initialized exception pointer
783  */
784 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
785
786 /**
787  * Set the default video output viewport for a windowless video output
788  * (MacOS X only).
789  *
790  * This setting will be used as default for all video outputs.
791  *
792  * \param p_instance libvlc instance
793  * \param view coordinates within video drawable
794  * \param clip coordinates within video drawable
795  * \param p_e an initialized exception pointer
796  */
797 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
798
799 /** @} video */
800
801 /** \defgroup libvlc_audio libvlc_audio
802  * \ingroup libvlc_media_player
803  * LibVLC Audio handling
804  * @{
805  */
806
807 /**
808  * Toggle mute status.
809  *
810  * \param p_instance libvlc instance
811  * \param p_e an initialized exception pointer
812  */
813 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
814
815 /**
816  * Get current mute status.
817  *
818  * \param p_instance libvlc instance
819  * \param p_e an initialized exception pointer
820  * \return the mute status (boolean)
821  */
822 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
823
824 /**
825  * Set mute status.
826  *
827  * \param p_instance libvlc instance
828  * \param status If status is true then mute, otherwise unmute
829  * \param p_e an initialized exception pointer
830  */
831 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, int , libvlc_exception_t * );
832
833 /**
834  * Get current audio level.
835  *
836  * \param p_instance libvlc instance
837  * \param p_e an initialized exception pointer
838  * \return the audio level (int)
839  */
840 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
841
842 /**
843  * Set current audio level.
844  *
845  * \param p_instance libvlc instance
846  * \param i_volume the volume (int)
847  * \param p_e an initialized exception pointer
848  */
849 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
850
851 /**
852  * Get number of available audio tracks.
853  *
854  * \param p_mi media player
855  * \param p_e an initialized exception
856  * \return the number of available audio tracks (int)
857  */
858 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *,  libvlc_exception_t * );
859
860 /**
861  * Get current audio track.
862  *
863  * \param p_mi media player
864  * \param p_e an initialized exception pointer
865  * \return the audio track (int)
866  */
867 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *, libvlc_exception_t * );
868
869 /**
870  * Set current audio track.
871  *
872  * \param p_mi media player
873  * \param i_track the track (int)
874  * \param p_e an initialized exception pointer
875  */
876 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_player_t *, int, libvlc_exception_t * );
877
878 /**
879  * Get current audio channel.
880  *
881  * \param p_instance vlc instance
882  * \param p_e an initialized exception pointer
883  * \return the audio channel (int)
884  */
885 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
886
887 /**
888  * Set current audio channel.
889  *
890  * \param p_instance vlc instance
891  * \param i_channel the audio channel (int)
892  * \param p_e an initialized exception pointer
893  */
894 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
895
896 /** @} audio */
897
898 /** @} media_player */
899
900 /*****************************************************************************
901  * Event handling
902  *****************************************************************************/
903
904 /** \defgroup libvlc_event libvlc_event
905  * \ingroup libvlc_core
906  * LibVLC Events
907  * @{
908  */
909
910 /**
911  * Register for an event notification.
912  *
913  * \param p_event_manager the event manager to which you want to attach to.
914  *        Generally it is obtained by vlc_my_object_event_manager() where
915  *        my_object is the object you want to listen to.
916  * \param i_event_type the desired event to which we want to listen
917  * \param f_callback the function to call when i_event_type occurs
918  * \param user_data user provided data to carry with the event
919  * \param p_e an initialized exception pointer
920  */
921 VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
922                                          libvlc_event_type_t i_event_type,
923                                          libvlc_callback_t f_callback,
924                                          void *user_data,
925                                          libvlc_exception_t *p_e );
926
927 /**
928  * Unregister an event notification.
929  *
930  * \param p_event_manager the event manager
931  * \param i_event_type the desired event to which we want to unregister
932  * \param f_callback the function to call when i_event_type occurs
933  * \param p_user_data user provided data to carry with the event
934  * \param p_e an initialized exception pointer
935  */
936 VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
937                                          libvlc_event_type_t i_event_type,
938                                          libvlc_callback_t f_callback,
939                                          void *p_user_data,
940                                          libvlc_exception_t *p_e );
941
942 /**
943  * Get an event's type name.
944  *
945  * \param i_event_type the desired event
946  */
947 VLC_PUBLIC_API const char * libvlc_event_type_name( libvlc_event_type_t event_type );
948
949 /** @} */
950
951 /*****************************************************************************
952  * Media Library
953  *****************************************************************************/
954 /** \defgroup libvlc_media_library libvlc_media_library
955  * \ingroup libvlc
956  * LibVLC Media Library
957  * @{
958  */
959 VLC_PUBLIC_API libvlc_media_library_t *
960     libvlc_media_library_new( libvlc_instance_t * p_inst,
961                               libvlc_exception_t * p_e );
962
963 /**
964  * Release media library object. This functions decrements the
965  * reference count of the media library object. If it reaches 0,
966  * then the object will be released.
967  *
968  * \param p_mlib media library object
969  */
970 VLC_PUBLIC_API void
971     libvlc_media_library_release( libvlc_media_library_t * p_mlib );
972
973 /**
974  * Retain a reference to a media library object. This function will
975  * increment the reference counting for this object. Use 
976  * libvlc_media_library_release() to decrement the reference count.
977  *
978  * \param p_mlib media library object
979  */
980 VLC_PUBLIC_API void
981     libvlc_media_library_retain( libvlc_media_library_t * p_mlib );
982
983 /**
984  * Load media library.
985  *
986  * \param p_mlib media library object
987  * \param p_e an initialized exception object.
988  */
989 VLC_PUBLIC_API void
990     libvlc_media_library_load( libvlc_media_library_t * p_mlib,
991                                libvlc_exception_t * p_e );
992
993 /**
994  * Save media library.
995  *
996  * \param p_mlib media library object
997  * \param p_e an initialized exception object.
998  */
999 VLC_PUBLIC_API void
1000     libvlc_media_library_save( libvlc_media_library_t * p_mlib,
1001                                libvlc_exception_t * p_e );
1002
1003 /**
1004  * Get media library subitems.
1005  *
1006  * \param p_mlib media library object
1007  * \param p_e an initialized exception object.
1008  * \return media list subitems
1009  */
1010 VLC_PUBLIC_API libvlc_media_list_t *
1011     libvlc_media_library_media_list( libvlc_media_library_t * p_mlib,
1012                                      libvlc_exception_t * p_e );
1013
1014
1015 /** @} */
1016
1017
1018 /*****************************************************************************
1019  * Services/Media Discovery
1020  *****************************************************************************/
1021 /** \defgroup libvlc_media_discoverer libvlc_media_discoverer
1022  * \ingroup libvlc
1023  * LibVLC Media Discoverer
1024  * @{
1025  */
1026
1027 /**
1028  * Discover media service by name.
1029  *
1030  * \param p_inst libvlc instance
1031  * \param psz_name service name
1032  * \param p_e an initialized exception object
1033  * \return media discover object
1034  */
1035 VLC_PUBLIC_API libvlc_media_discoverer_t *
1036 libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
1037                                        const char * psz_name,
1038                                        libvlc_exception_t * p_e );
1039
1040 /**
1041  * Release media discover object. If the reference count reaches 0, then
1042  * the object will be released.
1043  *
1044  * \param p_mdis media service discover object
1045  */
1046 VLC_PUBLIC_API void   libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
1047
1048 /**
1049  * Get media service discover object its localized name.
1050  *
1051  * \param media discover object
1052  * \return localized name
1053  */
1054 VLC_PUBLIC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
1055
1056 /**
1057  * Get media service discover media list.
1058  *
1059  * \param p_mdis media service discover object
1060  * \return list of media items
1061  */
1062 VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis );
1063
1064 /**
1065  * Get event manager from media service discover object.
1066  *
1067  * \param p_mdis media service discover object
1068  * \return event manager object.
1069  */
1070 VLC_PUBLIC_API libvlc_event_manager_t *
1071         libvlc_media_discoverer_event_manager( libvlc_media_discoverer_t * p_mdis );
1072
1073 /**
1074  * Query if media service discover object is running.
1075  *
1076  * \param p_mdis media service discover object
1077  * \return true if running, false if not
1078  */
1079 VLC_PUBLIC_API int
1080         libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis );
1081
1082 /**@} */
1083
1084
1085 /*****************************************************************************
1086  * Message log handling
1087  *****************************************************************************/
1088
1089 /** \defgroup libvlc_log libvlc_log
1090  * \ingroup libvlc_core
1091  * LibVLC Message Logging
1092  * @{
1093  */
1094
1095 /**
1096  * Return the VLC messaging verbosity level.
1097  *
1098  * \param p_instance libvlc instance
1099  * \param p_e an initialized exception pointer
1100  * \return verbosity level for messages
1101  */
1102 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
1103                                                   libvlc_exception_t *p_e );
1104
1105 /**
1106  * Set the VLC messaging verbosity level.
1107  *
1108  * \param p_instance libvlc log instance
1109  * \param level log level
1110  * \param p_e an initialized exception pointer
1111  */
1112 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
1113                                               libvlc_exception_t *p_e );
1114
1115 /**
1116  * Open a VLC message log instance.
1117  *
1118  * \param p_instance libvlc instance
1119  * \param p_e an initialized exception pointer
1120  * \return log message instance
1121  */
1122 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( libvlc_instance_t *, libvlc_exception_t *);
1123
1124 /**
1125  * Close a VLC message log instance.
1126  *
1127  * \param p_log libvlc log instance
1128  * \param p_e an initialized exception pointer
1129  */
1130 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
1131
1132 /**
1133  * Returns the number of messages in a log instance.
1134  *
1135  * \param p_log libvlc log instance
1136  * \param p_e an initialized exception pointer
1137  * \return number of log messages
1138  */
1139 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
1140
1141 /**
1142  * Clear a log instance.
1143  *
1144  * All messages in the log are removed. The log should be cleared on a
1145  * regular basis to avoid clogging.
1146  *
1147  * \param p_log libvlc log instance
1148  * \param p_e an initialized exception pointer
1149  */
1150 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
1151
1152 /**
1153  * Allocate and returns a new iterator to messages in log.
1154  *
1155  * \param p_log libvlc log instance
1156  * \param p_e an initialized exception pointer
1157  * \return log iterator object
1158  */
1159 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
1160
1161 /**
1162  * Release a previoulsy allocated iterator.
1163  *
1164  * \param p_iter libvlc log iterator
1165  * \param p_e an initialized exception pointer
1166  */
1167 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1168
1169 /**
1170  * Return whether log iterator has more messages.
1171  *
1172  * \param p_iter libvlc log iterator
1173  * \param p_e an initialized exception pointer
1174  * \return true if iterator has more message objects, else false
1175  */
1176 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1177
1178 /**
1179  * Return the next log message.
1180  *
1181  * The message contents must not be freed
1182  *
1183  * \param p_iter libvlc log iterator
1184  * \param p_buffer log buffer
1185  * \param p_e an initialized exception pointer
1186  * \return log message object
1187  */
1188 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
1189                                                                libvlc_log_message_t *p_buffer,
1190                                                                libvlc_exception_t *p_e );
1191
1192 /** @} */
1193
1194 # ifdef __cplusplus
1195 }
1196 # endif
1197
1198 #endif /* <vlc/libvlc.h> */