1 /*****************************************************************************
2 * libvlc.h: libvlc external API
3 *****************************************************************************
4 * Copyright (C) 1998-2005 the VideoLAN team
7 * Authors: Clément Stenac <zorglub@videolan.org>
8 * Jean-Paul Saman <jpsaman _at_ m2x _dot_ nl>
9 * Pierre d'Herbemont <pdherbemont@videolan.org>
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.
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.
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 *****************************************************************************/
27 * \defgroup libvlc libvlc
28 * This is libvlc, the base library of the VLC program.
43 /*****************************************************************************
45 *****************************************************************************/
46 /** \defgroup libvlc_exception libvlc_exception
47 * \ingroup libvlc_core
48 * LibVLC Exceptions handling
53 * Initialize an exception structure. This can be called several times to
54 * reuse an exception structure.
56 * \param p_exception the exception to initialize
58 VLC_PUBLIC_API void libvlc_exception_init( libvlc_exception_t *p_exception );
61 * Has an exception been raised?
63 * \param p_exception the exception to query
64 * \return 0 if the exception was raised, 1 otherwise
67 libvlc_exception_raised( const libvlc_exception_t *p_exception );
70 * Raise an exception using a user-provided message.
72 * \param p_exception the exception to raise
73 * \param psz_format the exception message format string
74 * \param ... the format string arguments
77 libvlc_exception_raise( libvlc_exception_t *p_exception,
78 const char *psz_format, ... );
81 * Clear an exception object so it can be reused.
82 * The exception object must have be initialized.
84 * \param p_exception the exception to clear
86 VLC_PUBLIC_API void libvlc_exception_clear( libvlc_exception_t * );
89 * Get an exception's message.
91 * \param p_exception the exception to query
92 * \return the exception message or NULL if not applicable (exception not
93 * raised, for example)
95 VLC_PUBLIC_API const char *
96 libvlc_exception_get_message( const libvlc_exception_t *p_exception );
100 /*****************************************************************************
102 *****************************************************************************/
104 /** \defgroup libvlc_core libvlc_core
111 * Create and initialize a libvlc instance.
113 * \param argc the number of arguments
114 * \param argv command-line-type arguments. argv[0] must be the path of the
116 * \param p_e an initialized exception pointer
117 * \return the libvlc instance
119 VLC_PUBLIC_API libvlc_instance_t *
120 libvlc_new( int , const char *const *, libvlc_exception_t *);
123 * Return a libvlc instance identifier for legacy APIs. Use of this
124 * function is discouraged, you should convert your program to use the
127 * \param p_instance the instance
128 * \return the instance identifier
130 VLC_PUBLIC_API int libvlc_get_vlc_id( libvlc_instance_t *p_instance );
133 * Decrement the reference count of a libvlc instance, and destroy it
134 * if it reaches zero.
136 * \param p_instance the instance to destroy
138 VLC_PUBLIC_API void libvlc_release( libvlc_instance_t * );
141 * Increments the reference count of a libvlc instance.
142 * The initial reference count is 1 after libvlc_new() returns.
144 * \param p_instance the instance to reference
146 VLC_PUBLIC_API void libvlc_retain( libvlc_instance_t * );
149 * Try to start a user interface for the libvlc instance, and wait until the
152 * \param p_instance the instance
153 * \param name interface name, or NULL for default
154 * \param p_exception an initialized exception pointer
157 void libvlc_run_interface( libvlc_instance_t *p_instance, const char *name,
158 libvlc_exception_t *p_exception );
161 * Retrieve libvlc version.
163 * Example: "0.9.0-git Grishenko"
165 * \return a string containing the libvlc version
167 VLC_PUBLIC_API const char * libvlc_get_version();
170 * Retrieve libvlc compiler version.
172 * Example: "gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu6)"
174 * \return a string containing the libvlc compiler version
176 VLC_PUBLIC_API const char * libvlc_get_compiler();
179 * Retrieve libvlc changeset.
181 * Example: "aa9bce0bc4"
183 * \return a string containing the libvlc changeset
185 VLC_PUBLIC_API const char * libvlc_get_changeset();
189 /*****************************************************************************
191 *****************************************************************************/
192 /** \defgroup libvlc_media libvlc_media
199 * Create a media with the given MRL.
201 * \param p_instance the instance
202 * \param psz_mrl the MRL to read
203 * \param p_e an initialized exception pointer
204 * \return the newly created media
206 VLC_PUBLIC_API libvlc_media_t * libvlc_media_new(
207 libvlc_instance_t *p_instance,
208 const char * psz_mrl,
209 libvlc_exception_t *p_e );
212 * Create a media as an empty node with the passed name.
214 * \param p_instance the instance
215 * \param psz_name the name of the node
216 * \param p_e an initialized exception pointer
217 * \return the new empty media
219 VLC_PUBLIC_API libvlc_media_t * libvlc_media_new_as_node(
220 libvlc_instance_t *p_instance,
221 const char * psz_name,
222 libvlc_exception_t *p_e );
225 * Add an option to the media.
227 * This option will be used to determine how the media_player will
228 * read the media. This allows to use VLC's advanced
229 * reading/streaming options on a per-media basis.
231 * The options are detailed in vlc --long-help, for instance "--sout-all"
233 * \param p_instance the instance
234 * \param ppsz_options the options (as a string)
235 * \param p_e an initialized exception pointer
237 VLC_PUBLIC_API void libvlc_media_add_option(
238 libvlc_media_t * p_md,
239 const char * ppsz_options,
240 libvlc_exception_t * p_e );
242 VLC_PUBLIC_API void libvlc_media_retain(
243 libvlc_media_t *p_meta_desc );
245 VLC_PUBLIC_API void libvlc_media_release(
246 libvlc_media_t *p_meta_desc );
248 VLC_PUBLIC_API char * libvlc_media_get_mrl( libvlc_media_t * p_md,
249 libvlc_exception_t * p_e );
251 VLC_PUBLIC_API libvlc_media_t * libvlc_media_duplicate( libvlc_media_t * );
254 * Read the meta of the media.
256 * \param p_meta_desc the media to read
257 * \param e_meta_desc the meta to read
258 * \param p_e an initialized exception pointer
259 * \return the media's meta
261 VLC_PUBLIC_API char * libvlc_media_get_meta(
262 libvlc_media_t *p_meta_desc,
263 libvlc_meta_t e_meta,
264 libvlc_exception_t *p_e );
266 VLC_PUBLIC_API libvlc_state_t libvlc_media_get_state(
267 libvlc_media_t *p_meta_desc,
268 libvlc_exception_t *p_e );
270 VLC_PUBLIC_API libvlc_media_list_t *
271 libvlc_media_subitems( libvlc_media_t *p_md,
272 libvlc_exception_t *p_e );
274 VLC_PUBLIC_API libvlc_event_manager_t *
275 libvlc_media_event_manager( libvlc_media_t * p_md,
276 libvlc_exception_t * p_e );
278 VLC_PUBLIC_API libvlc_time_t
279 libvlc_media_get_duration( libvlc_media_t * p_md,
280 libvlc_exception_t * p_e );
283 libvlc_media_is_preparsed( libvlc_media_t * p_md,
284 libvlc_exception_t * p_e );
287 libvlc_media_set_user_data( libvlc_media_t * p_md,
288 void * p_new_user_data,
289 libvlc_exception_t * p_e);
290 VLC_PUBLIC_API void *
291 libvlc_media_get_user_data( libvlc_media_t * p_md,
292 libvlc_exception_t * p_e);
296 /*****************************************************************************
298 *****************************************************************************/
299 /** \defgroup libvlc_media_player libvlc_media_player
301 * LibVLC Media Player, object that let you play a media
302 * in a libvlc_drawable_t
307 * Create an empty Media Player object
309 * \param p_libvlc_instance the libvlc instance in which the Media Player
311 * \param p_e an initialized exception pointer
313 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t *, libvlc_exception_t * );
316 * Create a Media Player object from a Media
318 * \param p_md the media. Afterwards the p_md can be safely
320 * \param p_e an initialized exception pointer
322 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new_from_media( libvlc_media_t *, libvlc_exception_t * );
325 * Release a media_player after use
327 * \param p_mi the Media Player to free
329 VLC_PUBLIC_API void libvlc_media_player_release( libvlc_media_player_t * );
330 VLC_PUBLIC_API void libvlc_media_player_retain( libvlc_media_player_t * );
332 /** Set the media that will be used by the media_player. If any,
333 * previous md will be released.
335 * \param p_mi the Media Player
336 * \param p_md the Media. Afterwards the p_md can be safely
338 * \param p_e an initialized exception pointer
340 VLC_PUBLIC_API void libvlc_media_player_set_media( libvlc_media_player_t *, libvlc_media_t *, libvlc_exception_t * );
343 * Get the media used by the media_player.
345 * \param p_mi the Media Player
346 * \param p_e an initialized exception pointer
347 * \return the media associated with p_mi, or NULL if no
348 * media is associated
350 VLC_PUBLIC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t *, libvlc_exception_t * );
353 * Get the Event Manager from which the media player send event.
355 * \param p_mi the Media Player
356 * \param p_e an initialized exception pointer
357 * \return the event manager associated with p_mi
359 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *, libvlc_exception_t * );
364 * \param p_mi the Media Player
365 * \param p_e an initialized exception pointer
367 VLC_PUBLIC_API void libvlc_media_player_play ( libvlc_media_player_t *, libvlc_exception_t * );
372 * \param p_mi the Media Player
373 * \param p_e an initialized exception pointer
375 VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *, libvlc_exception_t * );
380 * \param p_mi the Media Player
381 * \param p_e an initialized exception pointer
383 VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *, libvlc_exception_t * );
386 * Set the drawable where the media player should render its video output
388 * \param p_mi the Media Player
389 * \param drawable the libvlc_drawable_t where the media player
390 * should render its video
391 * \param p_e an initialized exception pointer
393 VLC_PUBLIC_API void libvlc_media_player_set_drawable ( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
396 * Get the drawable where the media player should render its video output
398 * \param p_mi the Media Player
399 * \param p_e an initialized exception pointer
400 * \return the libvlc_drawable_t where the media player
401 * should render its video
403 VLC_PUBLIC_API libvlc_drawable_t
404 libvlc_media_player_get_drawable ( libvlc_media_player_t *, libvlc_exception_t * );
406 /** \bug This might go away ... to be replaced by a broader system */
407 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_length ( libvlc_media_player_t *, libvlc_exception_t *);
408 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_time ( libvlc_media_player_t *, libvlc_exception_t *);
409 VLC_PUBLIC_API void libvlc_media_player_set_time ( libvlc_media_player_t *, libvlc_time_t, libvlc_exception_t *);
410 VLC_PUBLIC_API float libvlc_media_player_get_position ( libvlc_media_player_t *, libvlc_exception_t *);
411 VLC_PUBLIC_API void libvlc_media_player_set_position ( libvlc_media_player_t *, float, libvlc_exception_t *);
412 VLC_PUBLIC_API void libvlc_media_player_set_chapter ( libvlc_media_player_t *, int, libvlc_exception_t *);
413 VLC_PUBLIC_API int libvlc_media_player_get_chapter (libvlc_media_player_t *, libvlc_exception_t *);
414 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count( libvlc_media_player_t *, libvlc_exception_t *);
415 VLC_PUBLIC_API int libvlc_media_player_will_play ( libvlc_media_player_t *, libvlc_exception_t *);
416 VLC_PUBLIC_API float libvlc_media_player_get_rate ( libvlc_media_player_t *, libvlc_exception_t *);
417 VLC_PUBLIC_API void libvlc_media_player_set_rate ( libvlc_media_player_t *, float, libvlc_exception_t *);
418 VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state ( libvlc_media_player_t *, libvlc_exception_t *);
419 VLC_PUBLIC_API float libvlc_media_player_get_fps( libvlc_media_player_t *, libvlc_exception_t *);
422 * Does this media player have a video output?
424 * \param p_md the media player
425 * \param p_e an initialized exception pointer
427 VLC_PUBLIC_API int libvlc_media_player_has_vout( libvlc_media_player_t *, libvlc_exception_t *);
430 * Is this media player seekable?
432 * \param p_input the input
433 * \param p_e an initialized exception pointer
435 VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
438 * Can this media player be paused?
440 * \param p_input the input
441 * \param p_e an initialized exception pointer
443 VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
445 /** \defgroup libvlc_video libvlc_video
446 * \ingroup libvlc_media_player
447 * LibVLC Video handling
452 * Toggle fullscreen status on video output.
454 * \param p_mediaplayer the media player
455 * \param p_e an initialized exception pointer
457 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
460 * Enable or disable fullscreen on a video output.
462 * \param p_mediaplayer the media player
463 * \param b_fullscreen boolean for fullscreen status
464 * \param p_e an initialized exception pointer
466 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *, int, libvlc_exception_t * );
469 * Get current fullscreen status.
471 * \param p_mediaplayer the media player
472 * \param p_e an initialized exception pointer
473 * \return the fullscreen status (boolean)
475 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
478 * Get current video height.
480 * \param p_mediaplayer the media player
481 * \param p_e an initialized exception pointer
482 * \return the video height
484 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_player_t *, libvlc_exception_t * );
487 * Get current video width.
489 * \param p_mediaplayer the media player
490 * \param p_e an initialized exception pointer
491 * \return the video width
493 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_player_t *, libvlc_exception_t * );
496 * Get current video aspect ratio.
498 * \param p_mediaplayer the media player
499 * \param p_e an initialized exception pointer
500 * \return the video aspect ratio
502 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *, libvlc_exception_t * );
505 * Set new video aspect ratio.
507 * \param p_mediaplayer the media player
508 * \param psz_aspect new video aspect-ratio
509 * \param p_e an initialized exception pointer
511 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *, char *, libvlc_exception_t * );
514 * Get current video subtitle.
516 * \param p_mediaplayer the media player
517 * \param p_e an initialized exception pointer
518 * \return the video subtitle selected
520 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *, libvlc_exception_t * );
523 * Set new video subtitle.
525 * \param p_mediaplayer the media player
526 * \param i_spu new video subtitle to select
527 * \param p_e an initialized exception pointer
529 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_player_t *, int , libvlc_exception_t * );
532 * Set new video subtitle file.
534 * \param p_mediaplayer the media player
535 * \param psz_subtitle new video subtitle file
536 * \param p_e an initialized exception pointer
537 * \return the success status (boolean)
539 VLC_PUBLIC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *, char *, libvlc_exception_t * );
542 * Get current crop filter geometry.
544 * \param p_mediaplayer the media player
545 * \param p_e an initialized exception pointer
546 * \return the crop filter geometry
548 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *, libvlc_exception_t * );
551 * Set new crop filter geometry.
553 * \param p_mediaplayer the media player
554 * \param psz_geometry new crop filter geometry
555 * \param p_e an initialized exception pointer
557 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_player_t *, char *, libvlc_exception_t * );
560 * Toggle teletext transparent status on video output.
562 * \param p_mediaplayer the media player
563 * \param p_e an initialized exception pointer
565 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *, libvlc_exception_t * );
568 * Get current teletext page requested.
570 * \param p_mediaplayer the media player
571 * \param p_e an initialized exception pointer
572 * \return the current teletext page requested.
574 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t *, libvlc_exception_t * );
577 * Set new teletext page to retrieve.
579 * \param p_mediaplayer the media player
580 * \param i_page teletex page number requested
581 * \param p_e an initialized exception pointer
583 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *, int, libvlc_exception_t * );
586 * Take a snapshot of the current video window.
588 * If i_width AND i_height is 0, original size is used.
589 * If i_width XOR i_height is 0, original aspect-ratio is preserved.
591 * \param p_mediaplayer the media player
592 * \param psz_filepath the path where to save the screenshot to
593 * \param i_width the snapshot's width
594 * \param i_height the snapshot's height
595 * \param p_e an initialized exception pointer
597 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_player_t *, char *,unsigned int, unsigned int, libvlc_exception_t * );
599 VLC_PUBLIC_API int libvlc_video_destroy( libvlc_media_player_t *, libvlc_exception_t *);
602 * Resize the current video output window.
604 * \param p_instance libvlc instance
605 * \param width new width for video output window
606 * \param height new height for video output window
607 * \param p_e an initialized exception pointer
608 * \return the success status (boolean)
610 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_player_t *, int, int, libvlc_exception_t *);
613 * Change the parent for the current the video output.
615 * \param p_instance libvlc instance
616 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
617 * \param p_e an initialized exception pointer
618 * \return the success status (boolean)
620 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
623 * Tell windowless video output to redraw rectangular area (MacOS X only).
625 * \param p_instance libvlc instance
626 * \param area coordinates within video drawable
627 * \param p_e an initialized exception pointer
629 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_player_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
632 * Set the default video output's parent.
634 * This setting will be used as default for all video outputs.
636 * \param p_instance libvlc instance
637 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
638 * \param p_e an initialized exception pointer
640 VLC_PUBLIC_API void libvlc_video_set_parent( libvlc_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
643 * Set the default video output parent.
645 * This setting will be used as default for all video outputs.
647 * \param p_instance libvlc instance
648 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
649 * \param p_e an initialized exception pointer
651 VLC_PUBLIC_API libvlc_drawable_t libvlc_video_get_parent( libvlc_instance_t *, libvlc_exception_t * );
654 * Set the default video output size.
656 * This setting will be used as default for all video outputs.
658 * \param p_instance libvlc instance
659 * \param width new width for video drawable
660 * \param height new height for video drawable
661 * \param p_e an initialized exception pointer
663 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
666 * Set the default video output viewport for a windowless video output
669 * This setting will be used as default for all video outputs.
671 * \param p_instance libvlc instance
672 * \param view coordinates within video drawable
673 * \param clip coordinates within video drawable
674 * \param p_e an initialized exception pointer
676 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
680 /** \defgroup libvlc_audio libvlc_audio
681 * \ingroup libvlc_media_player
682 * LibVLC Audio handling
687 * Toggle mute status.
689 * \param p_instance libvlc instance
690 * \param p_e an initialized exception pointer
692 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
695 * Get current mute status.
697 * \param p_instance libvlc instance
698 * \param p_e an initialized exception pointer
699 * \return the mute status (boolean)
701 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
706 * \param p_instance libvlc instance
707 * \param status If status is true then mute, otherwise unmute
708 * \param p_e an initialized exception pointer
710 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, int , libvlc_exception_t * );
713 * Get current audio level.
715 * \param p_instance libvlc instance
716 * \param p_e an initialized exception pointer
717 * \return the audio level (int)
719 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
722 * Set current audio level.
724 * \param p_instance libvlc instance
725 * \param i_volume the volume (int)
726 * \param p_e an initialized exception pointer
728 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
731 * Get number of available audio tracks.
733 * \param p_mi media player
734 * \param p_e an initialized exception
735 * \return the number of available audio tracks (int)
737 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *, libvlc_exception_t * );
740 * Get current audio track.
742 * \param p_mi media player
743 * \param p_e an initialized exception pointer
744 * \return the audio track (int)
746 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *, libvlc_exception_t * );
749 * Set current audio track.
751 * \param p_mi media player
752 * \param i_track the track (int)
753 * \param p_e an initialized exception pointer
755 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_player_t *, int, libvlc_exception_t * );
758 * Get current audio channel.
760 * \param p_instance vlc instance
761 * \param p_e an initialized exception pointer
762 * \return the audio channel (int)
764 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
767 * Set current audio channel.
769 * \param p_instance vlc instance
770 * \param i_channel the audio channel (int)
771 * \param p_e an initialized exception pointer
773 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
777 /** @} media_player */
779 /*****************************************************************************
781 *****************************************************************************/
783 /** \defgroup libvlc_event libvlc_event
784 * \ingroup libvlc_core
790 * Register for an event notification.
792 * \param p_event_manager the event manager to which you want to attach to.
793 * Generally it is obtained by vlc_my_object_event_manager() where
794 * my_object is the object you want to listen to.
795 * \param i_event_type the desired event to which we want to listen
796 * \param f_callback the function to call when i_event_type occurs
797 * \param user_data user provided data to carry with the event
798 * \param p_e an initialized exception pointer
800 VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
801 libvlc_event_type_t i_event_type,
802 libvlc_callback_t f_callback,
804 libvlc_exception_t *p_e );
807 * Unregister an event notification.
809 * \param p_event_manager the event manager
810 * \param i_event_type the desired event to which we want to unregister
811 * \param f_callback the function to call when i_event_type occurs
812 * \param p_user_data user provided data to carry with the event
813 * \param p_e an initialized exception pointer
815 VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
816 libvlc_event_type_t i_event_type,
817 libvlc_callback_t f_callback,
819 libvlc_exception_t *p_e );
822 * Get an event's type name.
824 * \param i_event_type the desired event
826 VLC_PUBLIC_API const char * libvlc_event_type_name( libvlc_event_type_t event_type );
830 /*****************************************************************************
832 *****************************************************************************/
833 /** \defgroup libvlc_media_library libvlc_media_library
835 * LibVLC Media Library
838 VLC_PUBLIC_API libvlc_media_library_t *
839 libvlc_media_library_new( libvlc_instance_t * p_inst,
840 libvlc_exception_t * p_e );
842 libvlc_media_library_release( libvlc_media_library_t * p_mlib );
844 libvlc_media_library_retain( libvlc_media_library_t * p_mlib );
848 libvlc_media_library_load( libvlc_media_library_t * p_mlib,
849 libvlc_exception_t * p_e );
852 libvlc_media_library_save( libvlc_media_library_t * p_mlib,
853 libvlc_exception_t * p_e );
855 VLC_PUBLIC_API libvlc_media_list_t *
856 libvlc_media_library_media_list( libvlc_media_library_t * p_mlib,
857 libvlc_exception_t * p_e );
863 /*****************************************************************************
864 * Services/Media Discovery
865 *****************************************************************************/
866 /** \defgroup libvlc_media_discoverer libvlc_media_discoverer
868 * LibVLC Media Discoverer
872 VLC_PUBLIC_API libvlc_media_discoverer_t *
873 libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
874 const char * psz_name,
875 libvlc_exception_t * p_e );
876 VLC_PUBLIC_API void libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
877 VLC_PUBLIC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
879 VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis );
881 VLC_PUBLIC_API libvlc_event_manager_t *
882 libvlc_media_discoverer_event_manager( libvlc_media_discoverer_t * p_mdis );
885 libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis );
890 /*****************************************************************************
891 * Message log handling
892 *****************************************************************************/
894 /** \defgroup libvlc_log libvlc_log
895 * \ingroup libvlc_core
896 * LibVLC Message Logging
901 * Return the VLC messaging verbosity level.
903 * \param p_instance libvlc instance
904 * \param p_e an initialized exception pointer
906 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
907 libvlc_exception_t *p_e );
910 * Set the VLC messaging verbosity level.
912 * \param p_instance libvlc log instance
913 * \param level log level
914 * \param p_e an initialized exception pointer
916 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
917 libvlc_exception_t *p_e );
920 * Open a VLC message log instance.
922 * \param p_instance libvlc instance
923 * \param p_e an initialized exception pointer
925 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( libvlc_instance_t *, libvlc_exception_t *);
928 * Close a VLC message log instance.
930 * \param p_log libvlc log instance
931 * \param p_e an initialized exception pointer
933 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
936 * Returns the number of messages in a log instance.
938 * \param p_log libvlc log instance
939 * \param p_e an initialized exception pointer
941 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
944 * Clear a log instance.
946 * All messages in the log are removed. The log should be cleared on a
947 * regular basis to avoid clogging.
949 * \param p_log libvlc log instance
950 * \param p_e an initialized exception pointer
952 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
955 * Allocate and returns a new iterator to messages in log.
957 * \param p_log libvlc log instance
958 * \param p_e an initialized exception pointer
960 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
963 * Release a previoulsy allocated iterator.
965 * \param p_iter libvlc log iterator
966 * \param p_e an initialized exception pointer
968 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
971 * Return whether log iterator has more messages.
973 * \param p_iter libvlc log iterator
974 * \param p_e an initialized exception pointer
976 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
979 * Return the next log message.
981 * The message contents must not be freed
983 * \param p_iter libvlc log iterator
984 * \param p_buffer log buffer
985 * \param p_e an initialized exception pointer
987 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
988 libvlc_log_message_t *p_buffer,
989 libvlc_exception_t *p_e );
997 #endif /* <vlc/libvlc.h> */