]> git.sesse.net Git - vlc/blob - include/vlc/libvlc.h
Document media descriptor, media library, media service discover, vlm and message...
[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 VLC_PUBLIC_API libvlc_time_t  libvlc_media_player_get_length     ( libvlc_media_player_t *, libvlc_exception_t *);
531 VLC_PUBLIC_API libvlc_time_t  libvlc_media_player_get_time       ( libvlc_media_player_t *, libvlc_exception_t *);
532 VLC_PUBLIC_API void           libvlc_media_player_set_time       ( libvlc_media_player_t *, libvlc_time_t, libvlc_exception_t *);
533 VLC_PUBLIC_API float          libvlc_media_player_get_position   ( libvlc_media_player_t *, libvlc_exception_t *);
534 VLC_PUBLIC_API void           libvlc_media_player_set_position   ( libvlc_media_player_t *, float, libvlc_exception_t *);
535 VLC_PUBLIC_API void           libvlc_media_player_set_chapter    ( libvlc_media_player_t *, int, libvlc_exception_t *);
536 VLC_PUBLIC_API int            libvlc_media_player_get_chapter    (libvlc_media_player_t *, libvlc_exception_t *);
537 VLC_PUBLIC_API int            libvlc_media_player_get_chapter_count( libvlc_media_player_t *, libvlc_exception_t *);
538 VLC_PUBLIC_API int            libvlc_media_player_will_play      ( libvlc_media_player_t *, libvlc_exception_t *);
539 VLC_PUBLIC_API float          libvlc_media_player_get_rate       ( libvlc_media_player_t *, libvlc_exception_t *);
540 VLC_PUBLIC_API void           libvlc_media_player_set_rate       ( libvlc_media_player_t *, float, libvlc_exception_t *);
541 VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state   ( libvlc_media_player_t *, libvlc_exception_t *);
542 VLC_PUBLIC_API float          libvlc_media_player_get_fps( libvlc_media_player_t *, libvlc_exception_t *);
543 /** end bug */
544
545 /**
546  * Does this media player have a video output?
547  *
548  * \param p_md the media player
549  * \param p_e an initialized exception pointer
550  */
551 VLC_PUBLIC_API int  libvlc_media_player_has_vout( libvlc_media_player_t *, libvlc_exception_t *);
552
553 /**
554  * Is this media player seekable?
555  *
556  * \param p_input the input
557  * \param p_e an initialized exception pointer
558  */
559 VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
560
561 /**
562  * Can this media player be paused?
563  *
564  * \param p_input the input
565  * \param p_e an initialized exception pointer
566  */
567 VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
568
569 /** \defgroup libvlc_video libvlc_video
570  * \ingroup libvlc_media_player
571  * LibVLC Video handling
572  * @{
573  */
574
575 /**
576  * Toggle fullscreen status on video output.
577  *
578  * \param p_mediaplayer the media player
579  * \param p_e an initialized exception pointer
580  */
581 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
582
583 /**
584  * Enable or disable fullscreen on a video output.
585  *
586  * \param p_mediaplayer the media player
587  * \param b_fullscreen boolean for fullscreen status
588  * \param p_e an initialized exception pointer
589  */
590 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *, int, libvlc_exception_t * );
591
592 /**
593  * Get current fullscreen status.
594  *
595  * \param p_mediaplayer the media player
596  * \param p_e an initialized exception pointer
597  * \return the fullscreen status (boolean)
598  */
599 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
600
601 /**
602  * Get current video height.
603  *
604  * \param p_mediaplayer the media player
605  * \param p_e an initialized exception pointer
606  * \return the video height
607  */
608 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_player_t *, libvlc_exception_t * );
609
610 /**
611  * Get current video width.
612  *
613  * \param p_mediaplayer the media player
614  * \param p_e an initialized exception pointer
615  * \return the video width
616  */
617 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_player_t *, libvlc_exception_t * );
618
619 /**
620  * Get current video aspect ratio.
621  *
622  * \param p_mediaplayer the media player
623  * \param p_e an initialized exception pointer
624  * \return the video aspect ratio
625  */
626 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *, libvlc_exception_t * );
627
628 /**
629  * Set new video aspect ratio.
630  *
631  * \param p_mediaplayer the media player
632  * \param psz_aspect new video aspect-ratio
633  * \param p_e an initialized exception pointer
634  */
635 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *, char *, libvlc_exception_t * );
636
637 /**
638  * Get current video subtitle.
639  *
640  * \param p_mediaplayer the media player
641  * \param p_e an initialized exception pointer
642  * \return the video subtitle selected
643  */
644 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *, libvlc_exception_t * );
645
646 /**
647  * Set new video subtitle.
648  *
649  * \param p_mediaplayer the media player
650  * \param i_spu new video subtitle to select
651  * \param p_e an initialized exception pointer
652  */
653 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_player_t *, int , libvlc_exception_t * );
654
655 /**
656  * Set new video subtitle file.
657  *
658  * \param p_mediaplayer the media player
659  * \param psz_subtitle new video subtitle file
660  * \param p_e an initialized exception pointer
661  * \return the success status (boolean)
662  */
663 VLC_PUBLIC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *, char *, libvlc_exception_t * );
664
665 /**
666  * Get current crop filter geometry.
667  *
668  * \param p_mediaplayer the media player
669  * \param p_e an initialized exception pointer
670  * \return the crop filter geometry
671  */
672 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *, libvlc_exception_t * );
673
674 /**
675  * Set new crop filter geometry.
676  *
677  * \param p_mediaplayer the media player
678  * \param psz_geometry new crop filter geometry
679  * \param p_e an initialized exception pointer
680  */
681 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_player_t *, char *, libvlc_exception_t * );
682
683 /**
684  * Toggle teletext transparent status on video output.
685  *
686  * \param p_mediaplayer the media player
687  * \param p_e an initialized exception pointer
688  */
689 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *, libvlc_exception_t * );
690
691 /**
692  * Get current teletext page requested.
693  *
694  * \param p_mediaplayer the media player
695  * \param p_e an initialized exception pointer
696  * \return the current teletext page requested.
697  */
698 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t *, libvlc_exception_t * );
699
700 /**
701  * Set new teletext page to retrieve.
702  *
703  * \param p_mediaplayer the media player
704  * \param i_page teletex page number requested
705  * \param p_e an initialized exception pointer
706  */
707 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *, int, libvlc_exception_t * );
708
709 /**
710  * Take a snapshot of the current video window.
711  *
712  * If i_width AND i_height is 0, original size is used.
713  * If i_width XOR i_height is 0, original aspect-ratio is preserved.
714  *
715  * \param p_mediaplayer the media player
716  * \param psz_filepath the path where to save the screenshot to
717  * \param i_width the snapshot's width
718  * \param i_height the snapshot's height
719  * \param p_e an initialized exception pointer
720  */
721 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_player_t *, char *,unsigned int, unsigned int, libvlc_exception_t * );
722
723 /**
724  * Resize the current video output window.
725  *
726  * \param p_instance libvlc instance
727  * \param width new width for video output window
728  * \param height new height for video output window
729  * \param p_e an initialized exception pointer
730  * \return the success status (boolean)
731  */
732 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_player_t *, int, int, libvlc_exception_t *);
733
734 /**
735  * Change the parent for the current the video output.
736  *
737  * \param p_instance libvlc instance
738  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
739  * \param p_e an initialized exception pointer
740  * \return the success status (boolean)
741  */
742 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
743
744 /**
745  * Tell windowless video output to redraw rectangular area (MacOS X only).
746  *
747  * \param p_instance libvlc instance
748  * \param area coordinates within video drawable
749  * \param p_e an initialized exception pointer
750  */
751 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_player_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
752
753 /**
754  * Set the default video output size.
755  *
756  * This setting will be used as default for all video outputs.
757  *
758  * \param p_instance libvlc instance
759  * \param width new width for video drawable
760  * \param height new height for video drawable
761  * \param p_e an initialized exception pointer
762  */
763 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
764
765 /**
766  * Set the default video output viewport for a windowless video output
767  * (MacOS X only).
768  *
769  * This setting will be used as default for all video outputs.
770  *
771  * \param p_instance libvlc instance
772  * \param view coordinates within video drawable
773  * \param clip coordinates within video drawable
774  * \param p_e an initialized exception pointer
775  */
776 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
777
778 /** @} video */
779
780 /** \defgroup libvlc_audio libvlc_audio
781  * \ingroup libvlc_media_player
782  * LibVLC Audio handling
783  * @{
784  */
785
786 /**
787  * Toggle mute status.
788  *
789  * \param p_instance libvlc instance
790  * \param p_e an initialized exception pointer
791  */
792 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
793
794 /**
795  * Get current mute status.
796  *
797  * \param p_instance libvlc instance
798  * \param p_e an initialized exception pointer
799  * \return the mute status (boolean)
800  */
801 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
802
803 /**
804  * Set mute status.
805  *
806  * \param p_instance libvlc instance
807  * \param status If status is true then mute, otherwise unmute
808  * \param p_e an initialized exception pointer
809  */
810 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, int , libvlc_exception_t * );
811
812 /**
813  * Get current audio level.
814  *
815  * \param p_instance libvlc instance
816  * \param p_e an initialized exception pointer
817  * \return the audio level (int)
818  */
819 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
820
821 /**
822  * Set current audio level.
823  *
824  * \param p_instance libvlc instance
825  * \param i_volume the volume (int)
826  * \param p_e an initialized exception pointer
827  */
828 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
829
830 /**
831  * Get number of available audio tracks.
832  *
833  * \param p_mi media player
834  * \param p_e an initialized exception
835  * \return the number of available audio tracks (int)
836  */
837 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *,  libvlc_exception_t * );
838
839 /**
840  * Get current audio track.
841  *
842  * \param p_mi media player
843  * \param p_e an initialized exception pointer
844  * \return the audio track (int)
845  */
846 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *, libvlc_exception_t * );
847
848 /**
849  * Set current audio track.
850  *
851  * \param p_mi media player
852  * \param i_track the track (int)
853  * \param p_e an initialized exception pointer
854  */
855 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_player_t *, int, libvlc_exception_t * );
856
857 /**
858  * Get current audio channel.
859  *
860  * \param p_instance vlc instance
861  * \param p_e an initialized exception pointer
862  * \return the audio channel (int)
863  */
864 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
865
866 /**
867  * Set current audio channel.
868  *
869  * \param p_instance vlc instance
870  * \param i_channel the audio channel (int)
871  * \param p_e an initialized exception pointer
872  */
873 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
874
875 /** @} audio */
876
877 /** @} media_player */
878
879 /*****************************************************************************
880  * Event handling
881  *****************************************************************************/
882
883 /** \defgroup libvlc_event libvlc_event
884  * \ingroup libvlc_core
885  * LibVLC Events
886  * @{
887  */
888
889 /**
890  * Register for an event notification.
891  *
892  * \param p_event_manager the event manager to which you want to attach to.
893  *        Generally it is obtained by vlc_my_object_event_manager() where
894  *        my_object is the object you want to listen to.
895  * \param i_event_type the desired event to which we want to listen
896  * \param f_callback the function to call when i_event_type occurs
897  * \param user_data user provided data to carry with the event
898  * \param p_e an initialized exception pointer
899  */
900 VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
901                                          libvlc_event_type_t i_event_type,
902                                          libvlc_callback_t f_callback,
903                                          void *user_data,
904                                          libvlc_exception_t *p_e );
905
906 /**
907  * Unregister an event notification.
908  *
909  * \param p_event_manager the event manager
910  * \param i_event_type the desired event to which we want to unregister
911  * \param f_callback the function to call when i_event_type occurs
912  * \param p_user_data user provided data to carry with the event
913  * \param p_e an initialized exception pointer
914  */
915 VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
916                                          libvlc_event_type_t i_event_type,
917                                          libvlc_callback_t f_callback,
918                                          void *p_user_data,
919                                          libvlc_exception_t *p_e );
920
921 /**
922  * Get an event's type name.
923  *
924  * \param i_event_type the desired event
925  */
926 VLC_PUBLIC_API const char * libvlc_event_type_name( libvlc_event_type_t event_type );
927
928 /** @} */
929
930 /*****************************************************************************
931  * Media Library
932  *****************************************************************************/
933 /** \defgroup libvlc_media_library libvlc_media_library
934  * \ingroup libvlc
935  * LibVLC Media Library
936  * @{
937  */
938 VLC_PUBLIC_API libvlc_media_library_t *
939     libvlc_media_library_new( libvlc_instance_t * p_inst,
940                               libvlc_exception_t * p_e );
941
942 /**
943  * Release media library object. This functions decrements the
944  * reference count of the media library object. If it reaches 0,
945  * then the object will be released.
946  *
947  * \param p_mlib media library object
948  */
949 VLC_PUBLIC_API void
950     libvlc_media_library_release( libvlc_media_library_t * p_mlib );
951
952 /**
953  * Retain a reference to a media library object. This function will
954  * increment the reference counting for this object. Use 
955  * libvlc_media_library_release() to decrement the reference count.
956  *
957  * \param p_mlib media library object
958  */
959 VLC_PUBLIC_API void
960     libvlc_media_library_retain( libvlc_media_library_t * p_mlib );
961
962 /**
963  * Load media library.
964  *
965  * \param p_mlib media library object
966  * \param p_e an initialized exception object.
967  */
968 VLC_PUBLIC_API void
969     libvlc_media_library_load( libvlc_media_library_t * p_mlib,
970                                libvlc_exception_t * p_e );
971
972 /**
973  * Save media library.
974  *
975  * \param p_mlib media library object
976  * \param p_e an initialized exception object.
977  */
978 VLC_PUBLIC_API void
979     libvlc_media_library_save( libvlc_media_library_t * p_mlib,
980                                libvlc_exception_t * p_e );
981
982 /**
983  * Get media library subitems.
984  *
985  * \param p_mlib media library object
986  * \param p_e an initialized exception object.
987  * \return media list subitems
988  */
989 VLC_PUBLIC_API libvlc_media_list_t *
990     libvlc_media_library_media_list( libvlc_media_library_t * p_mlib,
991                                      libvlc_exception_t * p_e );
992
993
994 /** @} */
995
996
997 /*****************************************************************************
998  * Services/Media Discovery
999  *****************************************************************************/
1000 /** \defgroup libvlc_media_discoverer libvlc_media_discoverer
1001  * \ingroup libvlc
1002  * LibVLC Media Discoverer
1003  * @{
1004  */
1005
1006 /**
1007  * Discover media service by name.
1008  *
1009  * \param p_inst libvlc instance
1010  * \param psz_name service name
1011  * \param p_e an initialized exception object
1012  * \return media discover object
1013  */
1014 VLC_PUBLIC_API libvlc_media_discoverer_t *
1015 libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
1016                                        const char * psz_name,
1017                                        libvlc_exception_t * p_e );
1018
1019 /**
1020  * Release media discover object. If the reference count reaches 0, then
1021  * the object will be released.
1022  *
1023  * \param p_mdis media service discover object
1024  */
1025 VLC_PUBLIC_API void   libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
1026
1027 /**
1028  * Get media service discover object its localized name.
1029  *
1030  * \param media discover object
1031  * \return localized name
1032  */
1033 VLC_PUBLIC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
1034
1035 /**
1036  * Get media service discover media list.
1037  *
1038  * \param p_mdis media service discover object
1039  * \return list of media items
1040  */
1041 VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis );
1042
1043 /**
1044  * Get event manager from media service discover object.
1045  *
1046  * \param p_mdis media service discover object
1047  * \return event manager object.
1048  */
1049 VLC_PUBLIC_API libvlc_event_manager_t *
1050         libvlc_media_discoverer_event_manager( libvlc_media_discoverer_t * p_mdis );
1051
1052 /**
1053  * Query if media service discover object is running.
1054  *
1055  * \param p_mdis media service discover object
1056  * \return true if running, false if not
1057  */
1058 VLC_PUBLIC_API int
1059         libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis );
1060
1061 /**@} */
1062
1063
1064 /*****************************************************************************
1065  * Message log handling
1066  *****************************************************************************/
1067
1068 /** \defgroup libvlc_log libvlc_log
1069  * \ingroup libvlc_core
1070  * LibVLC Message Logging
1071  * @{
1072  */
1073
1074 /**
1075  * Return the VLC messaging verbosity level.
1076  *
1077  * \param p_instance libvlc instance
1078  * \param p_e an initialized exception pointer
1079  * \return verbosity level for messages
1080  */
1081 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
1082                                                   libvlc_exception_t *p_e );
1083
1084 /**
1085  * Set the VLC messaging verbosity level.
1086  *
1087  * \param p_instance libvlc log instance
1088  * \param level log level
1089  * \param p_e an initialized exception pointer
1090  */
1091 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
1092                                               libvlc_exception_t *p_e );
1093
1094 /**
1095  * Open a VLC message log instance.
1096  *
1097  * \param p_instance libvlc instance
1098  * \param p_e an initialized exception pointer
1099  * \return log message instance
1100  */
1101 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( libvlc_instance_t *, libvlc_exception_t *);
1102
1103 /**
1104  * Close a VLC message log instance.
1105  *
1106  * \param p_log libvlc log instance
1107  * \param p_e an initialized exception pointer
1108  */
1109 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
1110
1111 /**
1112  * Returns the number of messages in a log instance.
1113  *
1114  * \param p_log libvlc log instance
1115  * \param p_e an initialized exception pointer
1116  * \return number of log messages
1117  */
1118 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
1119
1120 /**
1121  * Clear a log instance.
1122  *
1123  * All messages in the log are removed. The log should be cleared on a
1124  * regular basis to avoid clogging.
1125  *
1126  * \param p_log libvlc log instance
1127  * \param p_e an initialized exception pointer
1128  */
1129 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
1130
1131 /**
1132  * Allocate and returns a new iterator to messages in log.
1133  *
1134  * \param p_log libvlc log instance
1135  * \param p_e an initialized exception pointer
1136  * \return log iterator object
1137  */
1138 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
1139
1140 /**
1141  * Release a previoulsy allocated iterator.
1142  *
1143  * \param p_iter libvlc log iterator
1144  * \param p_e an initialized exception pointer
1145  */
1146 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1147
1148 /**
1149  * Return whether log iterator has more messages.
1150  *
1151  * \param p_iter libvlc log iterator
1152  * \param p_e an initialized exception pointer
1153  * \return true if iterator has more message objects, else false
1154  */
1155 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1156
1157 /**
1158  * Return the next log message.
1159  *
1160  * The message contents must not be freed
1161  *
1162  * \param p_iter libvlc log iterator
1163  * \param p_buffer log buffer
1164  * \param p_e an initialized exception pointer
1165  * \return log message object
1166  */
1167 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
1168                                                                libvlc_log_message_t *p_buffer,
1169                                                                libvlc_exception_t *p_e );
1170
1171 /** @} */
1172
1173 # ifdef __cplusplus
1174 }
1175 # endif
1176
1177 #endif /* <vlc/libvlc.h> */