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 * Waits until an interface causes the instance to exit.
162 * You should start at least one interface first, using libvlc_add_intf().
164 * \param p_instance the instance
167 void libvlc_wait( libvlc_instance_t *p_instance );
170 * Retrieve libvlc version.
172 * Example: "0.9.0-git Grishenko"
174 * \return a string containing the libvlc version
176 VLC_PUBLIC_API const char * libvlc_get_version();
179 * Retrieve libvlc compiler version.
181 * Example: "gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu6)"
183 * \return a string containing the libvlc compiler version
185 VLC_PUBLIC_API const char * libvlc_get_compiler();
188 * Retrieve libvlc changeset.
190 * Example: "aa9bce0bc4"
192 * \return a string containing the libvlc changeset
194 VLC_PUBLIC_API const char * libvlc_get_changeset();
198 /*****************************************************************************
200 *****************************************************************************/
201 /** \defgroup libvlc_media libvlc_media
208 * Create a media with the given MRL.
210 * \param p_instance the instance
211 * \param psz_mrl the MRL to read
212 * \param p_e an initialized exception pointer
213 * \return the newly created media
215 VLC_PUBLIC_API libvlc_media_t * libvlc_media_new(
216 libvlc_instance_t *p_instance,
217 const char * psz_mrl,
218 libvlc_exception_t *p_e );
221 * Create a media as an empty node with the passed name.
223 * \param p_instance the instance
224 * \param psz_name the name of the node
225 * \param p_e an initialized exception pointer
226 * \return the new empty media
228 VLC_PUBLIC_API libvlc_media_t * libvlc_media_new_as_node(
229 libvlc_instance_t *p_instance,
230 const char * psz_name,
231 libvlc_exception_t *p_e );
234 * Add an option to the media.
236 * This option will be used to determine how the media_player will
237 * read the media. This allows to use VLC's advanced
238 * reading/streaming options on a per-media basis.
240 * The options are detailed in vlc --long-help, for instance "--sout-all"
242 * \param p_instance the instance
243 * \param ppsz_options the options (as a string)
244 * \param p_e an initialized exception pointer
246 VLC_PUBLIC_API void libvlc_media_add_option(
247 libvlc_media_t * p_md,
248 const char * ppsz_options,
249 libvlc_exception_t * p_e );
251 VLC_PUBLIC_API void libvlc_media_retain(
252 libvlc_media_t *p_meta_desc );
254 VLC_PUBLIC_API void libvlc_media_release(
255 libvlc_media_t *p_meta_desc );
257 VLC_PUBLIC_API char * libvlc_media_get_mrl( libvlc_media_t * p_md,
258 libvlc_exception_t * p_e );
260 VLC_PUBLIC_API libvlc_media_t * libvlc_media_duplicate( libvlc_media_t * );
263 * Read the meta of the media.
265 * \param p_meta_desc the media to read
266 * \param e_meta_desc the meta to read
267 * \param p_e an initialized exception pointer
268 * \return the media's meta
270 VLC_PUBLIC_API char * libvlc_media_get_meta(
271 libvlc_media_t *p_meta_desc,
272 libvlc_meta_t e_meta,
273 libvlc_exception_t *p_e );
275 VLC_PUBLIC_API libvlc_state_t libvlc_media_get_state(
276 libvlc_media_t *p_meta_desc,
277 libvlc_exception_t *p_e );
279 VLC_PUBLIC_API libvlc_media_list_t *
280 libvlc_media_subitems( libvlc_media_t *p_md,
281 libvlc_exception_t *p_e );
283 VLC_PUBLIC_API libvlc_event_manager_t *
284 libvlc_media_event_manager( libvlc_media_t * p_md,
285 libvlc_exception_t * p_e );
287 VLC_PUBLIC_API libvlc_time_t
288 libvlc_media_get_duration( libvlc_media_t * p_md,
289 libvlc_exception_t * p_e );
292 libvlc_media_is_preparsed( libvlc_media_t * p_md,
293 libvlc_exception_t * p_e );
296 libvlc_media_set_user_data( libvlc_media_t * p_md,
297 void * p_new_user_data,
298 libvlc_exception_t * p_e);
299 VLC_PUBLIC_API void *
300 libvlc_media_get_user_data( libvlc_media_t * p_md,
301 libvlc_exception_t * p_e);
305 /*****************************************************************************
307 *****************************************************************************/
308 /** \defgroup libvlc_media_player libvlc_media_player
310 * LibVLC Media Player, object that let you play a media
311 * in a libvlc_drawable_t
316 * Create an empty Media Player object
318 * \param p_libvlc_instance the libvlc instance in which the Media Player
320 * \param p_e an initialized exception pointer
322 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t *, libvlc_exception_t * );
325 * Create a Media Player object from a Media
327 * \param p_md the media. Afterwards the p_md can be safely
329 * \param p_e an initialized exception pointer
331 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new_from_media( libvlc_media_t *, libvlc_exception_t * );
334 * Release a media_player after use
336 * \param p_mi the Media Player to free
338 VLC_PUBLIC_API void libvlc_media_player_release( libvlc_media_player_t * );
339 VLC_PUBLIC_API void libvlc_media_player_retain( libvlc_media_player_t * );
341 /** Set the media that will be used by the media_player. If any,
342 * previous md will be released.
344 * \param p_mi the Media Player
345 * \param p_md the Media. Afterwards the p_md can be safely
347 * \param p_e an initialized exception pointer
349 VLC_PUBLIC_API void libvlc_media_player_set_media( libvlc_media_player_t *, libvlc_media_t *, libvlc_exception_t * );
352 * Get the media used by the media_player.
354 * \param p_mi the Media Player
355 * \param p_e an initialized exception pointer
356 * \return the media associated with p_mi, or NULL if no
357 * media is associated
359 VLC_PUBLIC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t *, libvlc_exception_t * );
362 * Get the Event Manager from which the media player send event.
364 * \param p_mi the Media Player
365 * \param p_e an initialized exception pointer
366 * \return the event manager associated with p_mi
368 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *, libvlc_exception_t * );
373 * \param p_mi the Media Player
374 * \param p_e an initialized exception pointer
376 VLC_PUBLIC_API void libvlc_media_player_play ( libvlc_media_player_t *, libvlc_exception_t * );
381 * \param p_mi the Media Player
382 * \param p_e an initialized exception pointer
384 VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *, libvlc_exception_t * );
389 * \param p_mi the Media Player
390 * \param p_e an initialized exception pointer
392 VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *, libvlc_exception_t * );
395 * Set the drawable where the media player should render its video output
397 * \param p_mi the Media Player
398 * \param drawable the libvlc_drawable_t where the media player
399 * should render its video
400 * \param p_e an initialized exception pointer
402 VLC_PUBLIC_API void libvlc_media_player_set_drawable ( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
405 * Get the drawable where the media player should render its video output
407 * \param p_mi the Media Player
408 * \param p_e an initialized exception pointer
409 * \return the libvlc_drawable_t where the media player
410 * should render its video
412 VLC_PUBLIC_API libvlc_drawable_t
413 libvlc_media_player_get_drawable ( libvlc_media_player_t *, libvlc_exception_t * );
415 /** \bug This might go away ... to be replaced by a broader system */
416 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_length ( libvlc_media_player_t *, libvlc_exception_t *);
417 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_time ( libvlc_media_player_t *, libvlc_exception_t *);
418 VLC_PUBLIC_API void libvlc_media_player_set_time ( libvlc_media_player_t *, libvlc_time_t, libvlc_exception_t *);
419 VLC_PUBLIC_API float libvlc_media_player_get_position ( libvlc_media_player_t *, libvlc_exception_t *);
420 VLC_PUBLIC_API void libvlc_media_player_set_position ( libvlc_media_player_t *, float, libvlc_exception_t *);
421 VLC_PUBLIC_API void libvlc_media_player_set_chapter ( libvlc_media_player_t *, int, libvlc_exception_t *);
422 VLC_PUBLIC_API int libvlc_media_player_get_chapter (libvlc_media_player_t *, libvlc_exception_t *);
423 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count( libvlc_media_player_t *, libvlc_exception_t *);
424 VLC_PUBLIC_API int libvlc_media_player_will_play ( libvlc_media_player_t *, libvlc_exception_t *);
425 VLC_PUBLIC_API float libvlc_media_player_get_rate ( libvlc_media_player_t *, libvlc_exception_t *);
426 VLC_PUBLIC_API void libvlc_media_player_set_rate ( libvlc_media_player_t *, float, libvlc_exception_t *);
427 VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state ( libvlc_media_player_t *, libvlc_exception_t *);
428 VLC_PUBLIC_API float libvlc_media_player_get_fps( libvlc_media_player_t *, libvlc_exception_t *);
431 * Does this media player have a video output?
433 * \param p_md the media player
434 * \param p_e an initialized exception pointer
436 VLC_PUBLIC_API int libvlc_media_player_has_vout( libvlc_media_player_t *, libvlc_exception_t *);
439 * Is this media player seekable?
441 * \param p_input the input
442 * \param p_e an initialized exception pointer
444 VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
447 * Can this media player be paused?
449 * \param p_input the input
450 * \param p_e an initialized exception pointer
452 VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
454 /** \defgroup libvlc_video libvlc_video
455 * \ingroup libvlc_media_player
456 * LibVLC Video handling
461 * Toggle fullscreen status on video output.
463 * \param p_mediaplayer the media player
464 * \param p_e an initialized exception pointer
466 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
469 * Enable or disable fullscreen on a video output.
471 * \param p_mediaplayer the media player
472 * \param b_fullscreen boolean for fullscreen status
473 * \param p_e an initialized exception pointer
475 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *, int, libvlc_exception_t * );
478 * Get current fullscreen status.
480 * \param p_mediaplayer the media player
481 * \param p_e an initialized exception pointer
482 * \return the fullscreen status (boolean)
484 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
487 * Get current video height.
489 * \param p_mediaplayer the media player
490 * \param p_e an initialized exception pointer
491 * \return the video height
493 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_player_t *, libvlc_exception_t * );
496 * Get current video width.
498 * \param p_mediaplayer the media player
499 * \param p_e an initialized exception pointer
500 * \return the video width
502 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_player_t *, libvlc_exception_t * );
505 * Get current video aspect ratio.
507 * \param p_mediaplayer the media player
508 * \param p_e an initialized exception pointer
509 * \return the video aspect ratio
511 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *, libvlc_exception_t * );
514 * Set new video aspect ratio.
516 * \param p_mediaplayer the media player
517 * \param psz_aspect new video aspect-ratio
518 * \param p_e an initialized exception pointer
520 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *, char *, libvlc_exception_t * );
523 * Get current video subtitle.
525 * \param p_mediaplayer the media player
526 * \param p_e an initialized exception pointer
527 * \return the video subtitle selected
529 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *, libvlc_exception_t * );
532 * Set new video subtitle.
534 * \param p_mediaplayer the media player
535 * \param i_spu new video subtitle to select
536 * \param p_e an initialized exception pointer
538 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_player_t *, int , libvlc_exception_t * );
541 * Set new video subtitle file.
543 * \param p_mediaplayer the media player
544 * \param psz_subtitle new video subtitle file
545 * \param p_e an initialized exception pointer
546 * \return the success status (boolean)
548 VLC_PUBLIC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *, char *, libvlc_exception_t * );
551 * Get current crop filter geometry.
553 * \param p_mediaplayer the media player
554 * \param p_e an initialized exception pointer
555 * \return the crop filter geometry
557 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *, libvlc_exception_t * );
560 * Set new crop filter geometry.
562 * \param p_mediaplayer the media player
563 * \param psz_geometry new crop filter geometry
564 * \param p_e an initialized exception pointer
566 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_player_t *, char *, libvlc_exception_t * );
569 * Toggle teletext transparent status on video output.
571 * \param p_mediaplayer the media player
572 * \param p_e an initialized exception pointer
574 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *, libvlc_exception_t * );
577 * Get current teletext page requested.
579 * \param p_mediaplayer the media player
580 * \param p_e an initialized exception pointer
581 * \return the current teletext page requested.
583 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t *, libvlc_exception_t * );
586 * Set new teletext page to retrieve.
588 * \param p_mediaplayer the media player
589 * \param i_page teletex page number requested
590 * \param p_e an initialized exception pointer
592 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *, int, libvlc_exception_t * );
595 * Take a snapshot of the current video window.
597 * If i_width AND i_height is 0, original size is used.
598 * If i_width XOR i_height is 0, original aspect-ratio is preserved.
600 * \param p_mediaplayer the media player
601 * \param psz_filepath the path where to save the screenshot to
602 * \param i_width the snapshot's width
603 * \param i_height the snapshot's height
604 * \param p_e an initialized exception pointer
606 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_player_t *, char *,unsigned int, unsigned int, libvlc_exception_t * );
608 VLC_PUBLIC_API int libvlc_video_destroy( libvlc_media_player_t *, libvlc_exception_t *);
611 * Resize the current video output window.
613 * \param p_instance libvlc instance
614 * \param width new width for video output window
615 * \param height new height for video output window
616 * \param p_e an initialized exception pointer
617 * \return the success status (boolean)
619 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_player_t *, int, int, libvlc_exception_t *);
622 * Change the parent for the current the video output.
624 * \param p_instance libvlc instance
625 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
626 * \param p_e an initialized exception pointer
627 * \return the success status (boolean)
629 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
632 * Tell windowless video output to redraw rectangular area (MacOS X only).
634 * \param p_instance libvlc instance
635 * \param area coordinates within video drawable
636 * \param p_e an initialized exception pointer
638 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_player_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
641 * Set the default video output's parent.
643 * This setting will be used as default for all video outputs.
645 * \param p_instance libvlc instance
646 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
647 * \param p_e an initialized exception pointer
649 VLC_PUBLIC_API void libvlc_video_set_parent( libvlc_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
652 * Set the default video output parent.
654 * This setting will be used as default for all video outputs.
656 * \param p_instance libvlc instance
657 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
658 * \param p_e an initialized exception pointer
660 VLC_PUBLIC_API libvlc_drawable_t libvlc_video_get_parent( libvlc_instance_t *, libvlc_exception_t * );
663 * Set the default video output size.
665 * This setting will be used as default for all video outputs.
667 * \param p_instance libvlc instance
668 * \param width new width for video drawable
669 * \param height new height for video drawable
670 * \param p_e an initialized exception pointer
672 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
675 * Set the default video output viewport for a windowless video output
678 * This setting will be used as default for all video outputs.
680 * \param p_instance libvlc instance
681 * \param view coordinates within video drawable
682 * \param clip coordinates within video drawable
683 * \param p_e an initialized exception pointer
685 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
689 /** \defgroup libvlc_audio libvlc_audio
690 * \ingroup libvlc_media_player
691 * LibVLC Audio handling
696 * Toggle mute status.
698 * \param p_instance libvlc instance
699 * \param p_e an initialized exception pointer
701 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
704 * Get current mute status.
706 * \param p_instance libvlc instance
707 * \param p_e an initialized exception pointer
708 * \return the mute status (boolean)
710 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
715 * \param p_instance libvlc instance
716 * \param status If status is true then mute, otherwise unmute
717 * \param p_e an initialized exception pointer
719 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, int , libvlc_exception_t * );
722 * Get current audio level.
724 * \param p_instance libvlc instance
725 * \param p_e an initialized exception pointer
726 * \return the audio level (int)
728 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
731 * Set current audio level.
733 * \param p_instance libvlc instance
734 * \param i_volume the volume (int)
735 * \param p_e an initialized exception pointer
737 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
740 * Get number of available audio tracks.
742 * \param p_mi media player
743 * \param p_e an initialized exception
744 * \return the number of available audio tracks (int)
746 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *, libvlc_exception_t * );
749 * Get current audio track.
751 * \param p_mi media player
752 * \param p_e an initialized exception pointer
753 * \return the audio track (int)
755 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *, libvlc_exception_t * );
758 * Set current audio track.
760 * \param p_mi media player
761 * \param i_track the track (int)
762 * \param p_e an initialized exception pointer
764 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_player_t *, int, libvlc_exception_t * );
767 * Get current audio channel.
769 * \param p_instance vlc instance
770 * \param p_e an initialized exception pointer
771 * \return the audio channel (int)
773 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
776 * Set current audio channel.
778 * \param p_instance vlc instance
779 * \param i_channel the audio channel (int)
780 * \param p_e an initialized exception pointer
782 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
786 /** @} media_player */
788 /*****************************************************************************
790 *****************************************************************************/
792 /** \defgroup libvlc_event libvlc_event
793 * \ingroup libvlc_core
799 * Register for an event notification.
801 * \param p_event_manager the event manager to which you want to attach to.
802 * Generally it is obtained by vlc_my_object_event_manager() where
803 * my_object is the object you want to listen to.
804 * \param i_event_type the desired event to which we want to listen
805 * \param f_callback the function to call when i_event_type occurs
806 * \param user_data user provided data to carry with the event
807 * \param p_e an initialized exception pointer
809 VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
810 libvlc_event_type_t i_event_type,
811 libvlc_callback_t f_callback,
813 libvlc_exception_t *p_e );
816 * Unregister an event notification.
818 * \param p_event_manager the event manager
819 * \param i_event_type the desired event to which we want to unregister
820 * \param f_callback the function to call when i_event_type occurs
821 * \param p_user_data user provided data to carry with the event
822 * \param p_e an initialized exception pointer
824 VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
825 libvlc_event_type_t i_event_type,
826 libvlc_callback_t f_callback,
828 libvlc_exception_t *p_e );
831 * Get an event's type name.
833 * \param i_event_type the desired event
835 VLC_PUBLIC_API const char * libvlc_event_type_name( libvlc_event_type_t event_type );
839 /*****************************************************************************
841 *****************************************************************************/
842 /** \defgroup libvlc_media_library libvlc_media_library
844 * LibVLC Media Library
847 VLC_PUBLIC_API libvlc_media_library_t *
848 libvlc_media_library_new( libvlc_instance_t * p_inst,
849 libvlc_exception_t * p_e );
851 libvlc_media_library_release( libvlc_media_library_t * p_mlib );
853 libvlc_media_library_retain( libvlc_media_library_t * p_mlib );
857 libvlc_media_library_load( libvlc_media_library_t * p_mlib,
858 libvlc_exception_t * p_e );
861 libvlc_media_library_save( libvlc_media_library_t * p_mlib,
862 libvlc_exception_t * p_e );
864 VLC_PUBLIC_API libvlc_media_list_t *
865 libvlc_media_library_media_list( libvlc_media_library_t * p_mlib,
866 libvlc_exception_t * p_e );
872 /*****************************************************************************
873 * Services/Media Discovery
874 *****************************************************************************/
875 /** \defgroup libvlc_media_discoverer libvlc_media_discoverer
877 * LibVLC Media Discoverer
881 VLC_PUBLIC_API libvlc_media_discoverer_t *
882 libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
883 const char * psz_name,
884 libvlc_exception_t * p_e );
885 VLC_PUBLIC_API void libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
886 VLC_PUBLIC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
888 VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis );
890 VLC_PUBLIC_API libvlc_event_manager_t *
891 libvlc_media_discoverer_event_manager( libvlc_media_discoverer_t * p_mdis );
894 libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis );
899 /*****************************************************************************
900 * Message log handling
901 *****************************************************************************/
903 /** \defgroup libvlc_log libvlc_log
904 * \ingroup libvlc_core
905 * LibVLC Message Logging
910 * Return the VLC messaging verbosity level.
912 * \param p_instance libvlc instance
913 * \param p_e an initialized exception pointer
915 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
916 libvlc_exception_t *p_e );
919 * Set the VLC messaging verbosity level.
921 * \param p_instance libvlc log instance
922 * \param level log level
923 * \param p_e an initialized exception pointer
925 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
926 libvlc_exception_t *p_e );
929 * Open a VLC message log instance.
931 * \param p_instance libvlc instance
932 * \param p_e an initialized exception pointer
934 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( libvlc_instance_t *, libvlc_exception_t *);
937 * Close a VLC message log instance.
939 * \param p_log libvlc log instance
940 * \param p_e an initialized exception pointer
942 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
945 * Returns the number of messages in a log instance.
947 * \param p_log libvlc log instance
948 * \param p_e an initialized exception pointer
950 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
953 * Clear a log instance.
955 * All messages in the log are removed. The log should be cleared on a
956 * regular basis to avoid clogging.
958 * \param p_log libvlc log instance
959 * \param p_e an initialized exception pointer
961 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
964 * Allocate and returns a new iterator to messages in log.
966 * \param p_log libvlc log instance
967 * \param p_e an initialized exception pointer
969 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
972 * Release a previoulsy allocated iterator.
974 * \param p_iter libvlc log iterator
975 * \param p_e an initialized exception pointer
977 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
980 * Return whether log iterator has more messages.
982 * \param p_iter libvlc log iterator
983 * \param p_e an initialized exception pointer
985 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
988 * Return the next log message.
990 * The message contents must not be freed
992 * \param p_iter libvlc log iterator
993 * \param p_buffer log buffer
994 * \param p_e an initialized exception pointer
996 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
997 libvlc_log_message_t *p_buffer,
998 libvlc_exception_t *p_e );
1006 #endif /* <vlc/libvlc.h> */