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.
35 #define VLC_LIBVLC_H 1
37 #if defined (WIN32) && defined (DLL_EXPORT)
38 # define VLC_PUBLIC_API __declspec(dllexport)
40 # define VLC_PUBLIC_API
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))
50 # define VLC_DEPRECATED_API VLC_PUBLIC_API
57 /*****************************************************************************
59 *****************************************************************************/
60 /** \defgroup libvlc_exception libvlc_exception
61 * \ingroup libvlc_core
62 * LibVLC Exceptions handling
67 * Initialize an exception structure. This can be called several times to
68 * reuse an exception structure.
70 * \param p_exception the exception to initialize
72 VLC_PUBLIC_API void libvlc_exception_init( libvlc_exception_t *p_exception );
75 * Has an exception been raised?
77 * \param p_exception the exception to query
78 * \return 0 if the exception was raised, 1 otherwise
81 libvlc_exception_raised( const libvlc_exception_t *p_exception );
84 * Raise an exception using a user-provided message.
86 * \param p_exception the exception to raise
87 * \param psz_format the exception message format string
88 * \param ... the format string arguments
91 libvlc_exception_raise( libvlc_exception_t *p_exception,
92 const char *psz_format, ... );
95 * Clear an exception object so it can be reused.
96 * The exception object must have be initialized.
98 * \param p_exception the exception to clear
100 VLC_PUBLIC_API void libvlc_exception_clear( libvlc_exception_t * );
103 * Get an exception's message.
105 * \param p_exception the exception to query
106 * \return the exception message or NULL if not applicable (exception not
107 * raised, for example)
109 VLC_PUBLIC_API const char *
110 libvlc_exception_get_message( const libvlc_exception_t *p_exception );
114 /*****************************************************************************
116 *****************************************************************************/
118 /** \defgroup libvlc_core libvlc_core
125 * Create and initialize a libvlc instance.
127 * \param argc the number of arguments
128 * \param argv command-line-type arguments. argv[0] must be the path of the
130 * \param p_e an initialized exception pointer
131 * \return the libvlc instance
133 VLC_PUBLIC_API libvlc_instance_t *
134 libvlc_new( int , const char *const *, libvlc_exception_t *);
137 * Return a libvlc instance identifier for legacy APIs. Use of this
138 * function is discouraged, you should convert your program to use the
141 * \param p_instance the instance
142 * \return the instance identifier
144 VLC_PUBLIC_API int libvlc_get_vlc_id( libvlc_instance_t *p_instance );
147 * Decrement the reference count of a libvlc instance, and destroy it
148 * if it reaches zero.
150 * \param p_instance the instance to destroy
152 VLC_PUBLIC_API void libvlc_release( libvlc_instance_t * );
155 * Increments the reference count of a libvlc instance.
156 * The initial reference count is 1 after libvlc_new() returns.
158 * \param p_instance the instance to reference
160 VLC_PUBLIC_API void libvlc_retain( libvlc_instance_t * );
163 * Try to start a user interface for the libvlc instance, and wait until the
166 * \param p_instance the instance
167 * \param name interface name, or NULL for default
168 * \param p_exception an initialized exception pointer
171 void libvlc_add_intf( libvlc_instance_t *p_instance, const char *name,
172 libvlc_exception_t *p_exception );
175 * Waits until an interface causes the instance to exit.
176 * You should start at least one interface first, using libvlc_add_intf().
178 * \param p_instance the instance
181 void libvlc_wait( libvlc_instance_t *p_instance );
184 * Retrieve libvlc version.
186 * Example: "0.9.0-git Grishenko"
188 * \return a string containing the libvlc version
190 VLC_PUBLIC_API const char * libvlc_get_version(void);
193 * Retrieve libvlc compiler version.
195 * Example: "gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu6)"
197 * \return a string containing the libvlc compiler version
199 VLC_PUBLIC_API const char * libvlc_get_compiler(void);
202 * Retrieve libvlc changeset.
204 * Example: "aa9bce0bc4"
206 * \return a string containing the libvlc changeset
208 VLC_PUBLIC_API const char * libvlc_get_changeset(void);
212 /*****************************************************************************
214 *****************************************************************************/
215 /** \defgroup libvlc_media libvlc_media
222 * Create a media with the given MRL.
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
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 );
235 * Create a media as an empty node with the passed name.
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
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 );
248 * Add an option to the media.
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.
254 * The options are detailed in vlc --long-help, for instance "--sout-all"
256 * \param p_instance the instance
257 * \param ppsz_options the options (as a string)
258 * \param p_e an initialized exception pointer
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 );
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.
270 * \param p_meta_desc a media descriptor object.
272 VLC_PUBLIC_API void libvlc_media_retain(
273 libvlc_media_t *p_meta_desc );
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.
282 * \param p_meta_desc a media descriptor object.
284 VLC_PUBLIC_API void libvlc_media_release(
285 libvlc_media_t *p_meta_desc );
289 * Get the media resource locator (mrl) from a media descriptor object
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
295 VLC_PUBLIC_API char * libvlc_media_get_mrl( libvlc_media_t * p_md,
296 libvlc_exception_t * p_e );
299 * Duplicate a media descriptor object.
301 * \param p_meta_desc a media descriptor object.
303 VLC_PUBLIC_API libvlc_media_t * libvlc_media_duplicate( libvlc_media_t * );
306 * Read the meta of the media.
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
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 );
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,
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
329 VLC_PUBLIC_API libvlc_state_t libvlc_media_get_state(
330 libvlc_media_t *p_meta_desc,
331 libvlc_exception_t *p_e );
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.
338 * \param p_md media descriptor object
339 * \param p_e initalized exception object
340 * \return list of media descriptor subitems or NULL
342 VLC_PUBLIC_API libvlc_media_list_t *
343 libvlc_media_subitems( libvlc_media_t *p_md,
344 libvlc_exception_t *p_e );
346 * Get event manager from media descriptor object.
347 * NOTE: this function doesn't increment reference counting.
349 * \param p_md a media descriptor object
350 * \param p_e an initialized exception object
351 * \return event manager object
353 VLC_PUBLIC_API libvlc_event_manager_t *
354 libvlc_media_event_manager( libvlc_media_t * p_md,
355 libvlc_exception_t * p_e );
358 * Get duration of media descriptor object item.
360 * \param p_md media descriptor object
361 * \param p_e an initialized exception object
362 * \return duration of media item
364 VLC_PUBLIC_API libvlc_time_t
365 libvlc_media_get_duration( libvlc_media_t * p_md,
366 libvlc_exception_t * p_e );
369 * Get preparsed status for media descriptor object.
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
376 libvlc_media_is_preparsed( libvlc_media_t * p_md,
377 libvlc_exception_t * p_e );
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
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
389 libvlc_media_set_user_data( libvlc_media_t * p_md,
390 void * p_new_user_data,
391 libvlc_exception_t * p_e);
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
398 * \param p_md media descriptor object
399 * \param p_e an initialized exception object
401 VLC_PUBLIC_API void *
402 libvlc_media_get_user_data( libvlc_media_t * p_md,
403 libvlc_exception_t * p_e);
407 /*****************************************************************************
409 *****************************************************************************/
410 /** \defgroup libvlc_media_player libvlc_media_player
412 * LibVLC Media Player, object that let you play a media
413 * in a libvlc_drawable_t
418 * Create an empty Media Player object
420 * \param p_libvlc_instance the libvlc instance in which the Media Player
422 * \param p_e an initialized exception pointer
424 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t *, libvlc_exception_t * );
427 * Create a Media Player object from a Media
429 * \param p_md the media. Afterwards the p_md can be safely
431 * \param p_e an initialized exception pointer
433 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new_from_media( libvlc_media_t *, libvlc_exception_t * );
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.
442 * \param p_mi the Media Player to free
444 VLC_PUBLIC_API void libvlc_media_player_release( libvlc_media_player_t * );
447 * Retain a reference to a media player object. Use
448 * libvlc_media_player_release() to decrement reference count.
450 * \param p_mi media player object
452 VLC_PUBLIC_API void libvlc_media_player_retain( libvlc_media_player_t * );
455 * Set the media that will be used by the media_player. If any,
456 * previous md will be released.
458 * \param p_mi the Media Player
459 * \param p_md the Media. Afterwards the p_md can be safely
461 * \param p_e an initialized exception pointer
463 VLC_PUBLIC_API void libvlc_media_player_set_media( libvlc_media_player_t *, libvlc_media_t *, libvlc_exception_t * );
466 * Get the media used by the media_player.
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
473 VLC_PUBLIC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t *, libvlc_exception_t * );
476 * Get the Event Manager from which the media player send event.
478 * \param p_mi the Media Player
479 * \param p_e an initialized exception pointer
480 * \return the event manager associated with p_mi
482 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *, libvlc_exception_t * );
487 * \param p_mi the Media Player
488 * \param p_e an initialized exception pointer
490 VLC_PUBLIC_API void libvlc_media_player_play ( libvlc_media_player_t *, libvlc_exception_t * );
495 * \param p_mi the Media Player
496 * \param p_e an initialized exception pointer
498 VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *, libvlc_exception_t * );
503 * \param p_mi the Media Player
504 * \param p_e an initialized exception pointer
506 VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *, libvlc_exception_t * );
509 * Set the drawable where the media player should render its video output
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
516 VLC_PUBLIC_API void libvlc_media_player_set_drawable ( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
519 * Get the drawable where the media player should render its video output
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
526 VLC_PUBLIC_API libvlc_drawable_t
527 libvlc_media_player_get_drawable ( libvlc_media_player_t *, libvlc_exception_t * );
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 *);
546 * Does this media player have a video output?
548 * \param p_md the media player
549 * \param p_e an initialized exception pointer
551 VLC_PUBLIC_API int libvlc_media_player_has_vout( libvlc_media_player_t *, libvlc_exception_t *);
554 * Is this media player seekable?
556 * \param p_input the input
557 * \param p_e an initialized exception pointer
559 VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
562 * Can this media player be paused?
564 * \param p_input the input
565 * \param p_e an initialized exception pointer
567 VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
569 /** \defgroup libvlc_video libvlc_video
570 * \ingroup libvlc_media_player
571 * LibVLC Video handling
576 * Toggle fullscreen status on video output.
578 * \param p_mediaplayer the media player
579 * \param p_e an initialized exception pointer
581 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
584 * Enable or disable fullscreen on a video output.
586 * \param p_mediaplayer the media player
587 * \param b_fullscreen boolean for fullscreen status
588 * \param p_e an initialized exception pointer
590 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *, int, libvlc_exception_t * );
593 * Get current fullscreen status.
595 * \param p_mediaplayer the media player
596 * \param p_e an initialized exception pointer
597 * \return the fullscreen status (boolean)
599 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
602 * Get current video height.
604 * \param p_mediaplayer the media player
605 * \param p_e an initialized exception pointer
606 * \return the video height
608 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_player_t *, libvlc_exception_t * );
611 * Get current video width.
613 * \param p_mediaplayer the media player
614 * \param p_e an initialized exception pointer
615 * \return the video width
617 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_player_t *, libvlc_exception_t * );
620 * Get current video aspect ratio.
622 * \param p_mediaplayer the media player
623 * \param p_e an initialized exception pointer
624 * \return the video aspect ratio
626 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *, libvlc_exception_t * );
629 * Set new video aspect ratio.
631 * \param p_mediaplayer the media player
632 * \param psz_aspect new video aspect-ratio
633 * \param p_e an initialized exception pointer
635 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *, char *, libvlc_exception_t * );
638 * Get current video subtitle.
640 * \param p_mediaplayer the media player
641 * \param p_e an initialized exception pointer
642 * \return the video subtitle selected
644 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *, libvlc_exception_t * );
647 * Set new video subtitle.
649 * \param p_mediaplayer the media player
650 * \param i_spu new video subtitle to select
651 * \param p_e an initialized exception pointer
653 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_player_t *, int , libvlc_exception_t * );
656 * Set new video subtitle file.
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)
663 VLC_PUBLIC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *, char *, libvlc_exception_t * );
666 * Get current crop filter geometry.
668 * \param p_mediaplayer the media player
669 * \param p_e an initialized exception pointer
670 * \return the crop filter geometry
672 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *, libvlc_exception_t * );
675 * Set new crop filter geometry.
677 * \param p_mediaplayer the media player
678 * \param psz_geometry new crop filter geometry
679 * \param p_e an initialized exception pointer
681 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_player_t *, char *, libvlc_exception_t * );
684 * Toggle teletext transparent status on video output.
686 * \param p_mediaplayer the media player
687 * \param p_e an initialized exception pointer
689 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *, libvlc_exception_t * );
692 * Get current teletext page requested.
694 * \param p_mediaplayer the media player
695 * \param p_e an initialized exception pointer
696 * \return the current teletext page requested.
698 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t *, libvlc_exception_t * );
701 * Set new teletext page to retrieve.
703 * \param p_mediaplayer the media player
704 * \param i_page teletex page number requested
705 * \param p_e an initialized exception pointer
707 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *, int, libvlc_exception_t * );
710 * Take a snapshot of the current video window.
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.
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
721 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_player_t *, char *,unsigned int, unsigned int, libvlc_exception_t * );
724 * Resize the current video output window.
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)
732 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_player_t *, int, int, libvlc_exception_t *);
735 * Change the parent for the current the video output.
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)
742 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
745 * Tell windowless video output to redraw rectangular area (MacOS X only).
747 * \param p_instance libvlc instance
748 * \param area coordinates within video drawable
749 * \param p_e an initialized exception pointer
751 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_player_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
754 * Set the default video output size.
756 * This setting will be used as default for all video outputs.
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
763 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
766 * Set the default video output viewport for a windowless video output
769 * This setting will be used as default for all video outputs.
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
776 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
780 /** \defgroup libvlc_audio libvlc_audio
781 * \ingroup libvlc_media_player
782 * LibVLC Audio handling
787 * Toggle mute status.
789 * \param p_instance libvlc instance
790 * \param p_e an initialized exception pointer
792 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
795 * Get current mute status.
797 * \param p_instance libvlc instance
798 * \param p_e an initialized exception pointer
799 * \return the mute status (boolean)
801 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
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
810 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, int , libvlc_exception_t * );
813 * Get current audio level.
815 * \param p_instance libvlc instance
816 * \param p_e an initialized exception pointer
817 * \return the audio level (int)
819 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
822 * Set current audio level.
824 * \param p_instance libvlc instance
825 * \param i_volume the volume (int)
826 * \param p_e an initialized exception pointer
828 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
831 * Get number of available audio tracks.
833 * \param p_mi media player
834 * \param p_e an initialized exception
835 * \return the number of available audio tracks (int)
837 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *, libvlc_exception_t * );
840 * Get current audio track.
842 * \param p_mi media player
843 * \param p_e an initialized exception pointer
844 * \return the audio track (int)
846 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *, libvlc_exception_t * );
849 * Set current audio track.
851 * \param p_mi media player
852 * \param i_track the track (int)
853 * \param p_e an initialized exception pointer
855 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_player_t *, int, libvlc_exception_t * );
858 * Get current audio channel.
860 * \param p_instance vlc instance
861 * \param p_e an initialized exception pointer
862 * \return the audio channel (int)
864 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
867 * Set current audio channel.
869 * \param p_instance vlc instance
870 * \param i_channel the audio channel (int)
871 * \param p_e an initialized exception pointer
873 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
877 /** @} media_player */
879 /*****************************************************************************
881 *****************************************************************************/
883 /** \defgroup libvlc_event libvlc_event
884 * \ingroup libvlc_core
890 * Register for an event notification.
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
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,
904 libvlc_exception_t *p_e );
907 * Unregister an event notification.
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
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,
919 libvlc_exception_t *p_e );
922 * Get an event's type name.
924 * \param i_event_type the desired event
926 VLC_PUBLIC_API const char * libvlc_event_type_name( libvlc_event_type_t event_type );
930 /*****************************************************************************
932 *****************************************************************************/
933 /** \defgroup libvlc_media_library libvlc_media_library
935 * LibVLC Media Library
938 VLC_PUBLIC_API libvlc_media_library_t *
939 libvlc_media_library_new( libvlc_instance_t * p_inst,
940 libvlc_exception_t * p_e );
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.
947 * \param p_mlib media library object
950 libvlc_media_library_release( libvlc_media_library_t * p_mlib );
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.
957 * \param p_mlib media library object
960 libvlc_media_library_retain( libvlc_media_library_t * p_mlib );
963 * Load media library.
965 * \param p_mlib media library object
966 * \param p_e an initialized exception object.
969 libvlc_media_library_load( libvlc_media_library_t * p_mlib,
970 libvlc_exception_t * p_e );
973 * Save media library.
975 * \param p_mlib media library object
976 * \param p_e an initialized exception object.
979 libvlc_media_library_save( libvlc_media_library_t * p_mlib,
980 libvlc_exception_t * p_e );
983 * Get media library subitems.
985 * \param p_mlib media library object
986 * \param p_e an initialized exception object.
987 * \return media list subitems
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 );
997 /*****************************************************************************
998 * Services/Media Discovery
999 *****************************************************************************/
1000 /** \defgroup libvlc_media_discoverer libvlc_media_discoverer
1002 * LibVLC Media Discoverer
1007 * Discover media service by name.
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
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 );
1020 * Release media discover object. If the reference count reaches 0, then
1021 * the object will be released.
1023 * \param p_mdis media service discover object
1025 VLC_PUBLIC_API void libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
1028 * Get media service discover object its localized name.
1030 * \param media discover object
1031 * \return localized name
1033 VLC_PUBLIC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
1036 * Get media service discover media list.
1038 * \param p_mdis media service discover object
1039 * \return list of media items
1041 VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis );
1044 * Get event manager from media service discover object.
1046 * \param p_mdis media service discover object
1047 * \return event manager object.
1049 VLC_PUBLIC_API libvlc_event_manager_t *
1050 libvlc_media_discoverer_event_manager( libvlc_media_discoverer_t * p_mdis );
1053 * Query if media service discover object is running.
1055 * \param p_mdis media service discover object
1056 * \return true if running, false if not
1059 libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis );
1064 /*****************************************************************************
1065 * Message log handling
1066 *****************************************************************************/
1068 /** \defgroup libvlc_log libvlc_log
1069 * \ingroup libvlc_core
1070 * LibVLC Message Logging
1075 * Return the VLC messaging verbosity level.
1077 * \param p_instance libvlc instance
1078 * \param p_e an initialized exception pointer
1079 * \return verbosity level for messages
1081 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
1082 libvlc_exception_t *p_e );
1085 * Set the VLC messaging verbosity level.
1087 * \param p_instance libvlc log instance
1088 * \param level log level
1089 * \param p_e an initialized exception pointer
1091 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
1092 libvlc_exception_t *p_e );
1095 * Open a VLC message log instance.
1097 * \param p_instance libvlc instance
1098 * \param p_e an initialized exception pointer
1099 * \return log message instance
1101 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( libvlc_instance_t *, libvlc_exception_t *);
1104 * Close a VLC message log instance.
1106 * \param p_log libvlc log instance
1107 * \param p_e an initialized exception pointer
1109 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
1112 * Returns the number of messages in a log instance.
1114 * \param p_log libvlc log instance
1115 * \param p_e an initialized exception pointer
1116 * \return number of log messages
1118 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
1121 * Clear a log instance.
1123 * All messages in the log are removed. The log should be cleared on a
1124 * regular basis to avoid clogging.
1126 * \param p_log libvlc log instance
1127 * \param p_e an initialized exception pointer
1129 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
1132 * Allocate and returns a new iterator to messages in log.
1134 * \param p_log libvlc log instance
1135 * \param p_e an initialized exception pointer
1136 * \return log iterator object
1138 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
1141 * Release a previoulsy allocated iterator.
1143 * \param p_iter libvlc log iterator
1144 * \param p_e an initialized exception pointer
1146 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1149 * Return whether log iterator has more messages.
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
1155 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1158 * Return the next log message.
1160 * The message contents must not be freed
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
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 );
1177 #endif /* <vlc/libvlc.h> */