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@videolan.org>
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 *****************************************************************************/
28 * This file defines libvlc external API
32 * \defgroup libvlc libvlc
33 * This is libvlc, the base library of the VLC program.
39 #define VLC_LIBVLC_H 1
41 #if defined (WIN32) && defined (DLL_EXPORT)
42 # define VLC_PUBLIC_API __declspec(dllexport)
44 # define VLC_PUBLIC_API
48 /* Avoid unuseful warnings from libvlc with our deprecated APIs */
49 # define VLC_DEPRECATED_API VLC_PUBLIC_API
50 #elif defined(__GNUC__) && \
51 (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
52 # define VLC_DEPRECATED_API VLC_PUBLIC_API __attribute__((deprecated))
54 # define VLC_DEPRECATED_API VLC_PUBLIC_API
61 /*****************************************************************************
63 *****************************************************************************/
64 /** \defgroup libvlc_exception libvlc_exception
65 * \ingroup libvlc_core
66 * LibVLC Exceptions handling
71 * Initialize an exception structure. This can be called several times to
72 * reuse an exception structure.
74 * \param p_exception the exception to initialize
76 VLC_PUBLIC_API void libvlc_exception_init( libvlc_exception_t *p_exception );
79 * Has an exception been raised?
81 * \param p_exception the exception to query
82 * \return 0 if the exception was raised, 1 otherwise
85 libvlc_exception_raised( const libvlc_exception_t *p_exception );
88 * Raise an exception using a user-provided message.
90 * \param p_exception the exception to raise
91 * \param psz_format the exception message format string
92 * \param ... the format string arguments
95 libvlc_exception_raise( libvlc_exception_t *p_exception,
96 const char *psz_format, ... );
99 * Clear an exception object so it can be reused.
100 * The exception object must have be initialized.
102 * \param p_exception the exception to clear
104 VLC_PUBLIC_API void libvlc_exception_clear( libvlc_exception_t * );
107 * Get an exception's message.
109 * \param p_exception the exception to query
110 * \return the exception message or NULL if not applicable (exception not
111 * raised, for example)
113 VLC_PUBLIC_API const char *
114 libvlc_exception_get_message( const libvlc_exception_t *p_exception );
118 /*****************************************************************************
120 *****************************************************************************/
122 /** \defgroup libvlc_core libvlc_core
129 * Create and initialize a libvlc instance.
131 * \param argc the number of arguments
132 * \param argv command-line-type arguments. argv[0] must be the path of the
134 * \param p_e an initialized exception pointer
135 * \return the libvlc instance
137 VLC_PUBLIC_API libvlc_instance_t *
138 libvlc_new( int , const char *const *, libvlc_exception_t *);
141 * Return a libvlc instance identifier for legacy APIs. Use of this
142 * function is discouraged, you should convert your program to use the
145 * \param p_instance the instance
146 * \return the instance identifier
148 VLC_PUBLIC_API int libvlc_get_vlc_id( libvlc_instance_t *p_instance );
151 * Decrement the reference count of a libvlc instance, and destroy it
152 * if it reaches zero.
154 * \param p_instance the instance to destroy
156 VLC_PUBLIC_API void libvlc_release( libvlc_instance_t * );
159 * Increments the reference count of a libvlc instance.
160 * The initial reference count is 1 after libvlc_new() returns.
162 * \param p_instance the instance to reference
164 VLC_PUBLIC_API void libvlc_retain( libvlc_instance_t * );
167 * Try to start a user interface for the libvlc instance, and wait until the
170 * \param p_instance the instance
171 * \param name interface name, or NULL for default
172 * \param p_exception an initialized exception pointer
175 void libvlc_add_intf( libvlc_instance_t *p_instance, const char *name,
176 libvlc_exception_t *p_exception );
179 * Waits until an interface causes the instance to exit.
180 * You should start at least one interface first, using libvlc_add_intf().
182 * \param p_instance the instance
185 void libvlc_wait( libvlc_instance_t *p_instance );
188 * Retrieve libvlc version.
190 * Example: "0.9.0-git Grishenko"
192 * \return a string containing the libvlc version
194 VLC_PUBLIC_API const char * libvlc_get_version(void);
197 * Retrieve libvlc compiler version.
199 * Example: "gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu6)"
201 * \return a string containing the libvlc compiler version
203 VLC_PUBLIC_API const char * libvlc_get_compiler(void);
206 * Retrieve libvlc changeset.
208 * Example: "aa9bce0bc4"
210 * \return a string containing the libvlc changeset
212 VLC_PUBLIC_API const char * libvlc_get_changeset(void);
217 * Return the libvlc internal object, the main object that all other depend on.
218 * Any of of this function should be considered an ugly hack and avoided at all
219 * cost. E.g. you need to expose some functionality that is not provided by the
220 * libvlc API directly with libvlccore.
221 * Remember to release the object with vlc_object_release( obj* )
223 * \param p_instance the libvlc instance
225 VLC_PUBLIC_API struct vlc_object_t *libvlc_get_vlc_instance(libvlc_instance_t *);
229 /*****************************************************************************
231 *****************************************************************************/
232 /** \defgroup libvlc_media libvlc_media
239 * Create a media with the given MRL.
241 * \param p_instance the instance
242 * \param psz_mrl the MRL to read
243 * \param p_e an initialized exception pointer
244 * \return the newly created media
246 VLC_PUBLIC_API libvlc_media_t * libvlc_media_new(
247 libvlc_instance_t *p_instance,
248 const char * psz_mrl,
249 libvlc_exception_t *p_e );
252 * Create a media as an empty node with the passed name.
254 * \param p_instance the instance
255 * \param psz_name the name of the node
256 * \param p_e an initialized exception pointer
257 * \return the new empty media
259 VLC_PUBLIC_API libvlc_media_t * libvlc_media_new_as_node(
260 libvlc_instance_t *p_instance,
261 const char * psz_name,
262 libvlc_exception_t *p_e );
265 * Add an option to the media.
267 * This option will be used to determine how the media_player will
268 * read the media. This allows to use VLC's advanced
269 * reading/streaming options on a per-media basis.
271 * The options are detailed in vlc --long-help, for instance "--sout-all"
273 * \param p_instance the instance
274 * \param ppsz_options the options (as a string)
275 * \param p_e an initialized exception pointer
277 VLC_PUBLIC_API void libvlc_media_add_option(
278 libvlc_media_t * p_md,
279 const char * ppsz_options,
280 libvlc_exception_t * p_e );
282 * Add an option to the media from an untrusted source.
284 * This option will be used to determine how the media_player will
285 * read the media. This allows to use VLC's advanced
286 * reading/streaming options on a per-media basis.
288 * The options are detailed in vlc --long-help, for instance "--sout-all"
290 * \param p_instance the instance
291 * \param ppsz_options the options (as a string)
292 * \param p_e an initialized exception pointer
294 VLC_PUBLIC_API void libvlc_media_add_option_untrusted(
295 libvlc_media_t * p_md,
296 const char * ppsz_options,
297 libvlc_exception_t * p_e );
301 * Retain a reference to a media descriptor object (libvlc_media_t). Use
302 * libvlc_media_release() to decrement the reference count of a
303 * media descriptor object.
305 * \param p_meta_desc a media descriptor object.
307 VLC_PUBLIC_API void libvlc_media_retain(
308 libvlc_media_t *p_meta_desc );
311 * Decrement the reference count of a media descriptor object. If the
312 * reference count is 0, then libvlc_media_release() will release the
313 * media descriptor object. It will send out an libvlc_MediaFreed event
314 * to all listeners. If the media descriptor object has been released it
315 * should not be used again.
317 * \param p_meta_desc a media descriptor object.
319 VLC_PUBLIC_API void libvlc_media_release(
320 libvlc_media_t *p_meta_desc );
324 * Get the media resource locator (mrl) from a media descriptor object
326 * \param p_md a media descriptor object
327 * \param p_e an initialized exception object
328 * \return string with mrl of media descriptor object
330 VLC_PUBLIC_API char * libvlc_media_get_mrl( libvlc_media_t * p_md,
331 libvlc_exception_t * p_e );
334 * Duplicate a media descriptor object.
336 * \param p_meta_desc a media descriptor object.
338 VLC_PUBLIC_API libvlc_media_t * libvlc_media_duplicate( libvlc_media_t * );
341 * Read the meta of the media.
343 * \param p_meta_desc the media to read
344 * \param e_meta_desc the meta to read
345 * \param p_e an initialized exception pointer
346 * \return the media's meta
348 VLC_PUBLIC_API char * libvlc_media_get_meta(
349 libvlc_media_t *p_meta_desc,
350 libvlc_meta_t e_meta,
351 libvlc_exception_t *p_e );
353 * Get current state of media descriptor object. Possible media states
354 * are defined in libvlc_structures.c ( libvlc_NothingSpecial=0,
355 * libvlc_Opening, libvlc_Buffering, libvlc_Playing, libvlc_Paused,
356 * libvlc_Stopped, libvlc_Ended,
359 * @see libvlc_state_t
360 * \param p_meta_desc a media descriptor object
361 * \param p_e an initialized exception object
362 * \return state of media descriptor object
364 VLC_PUBLIC_API libvlc_state_t libvlc_media_get_state(
365 libvlc_media_t *p_meta_desc,
366 libvlc_exception_t *p_e );
369 * Get subitems of media descriptor object. This will increment
370 * the reference count of supplied media descriptor object. Use
371 * libvlc_media_list_release() to decrement the reference counting.
373 * \param p_md media descriptor object
374 * \param p_e initalized exception object
375 * \return list of media descriptor subitems or NULL
377 VLC_PUBLIC_API libvlc_media_list_t *
378 libvlc_media_subitems( libvlc_media_t *p_md,
379 libvlc_exception_t *p_e );
381 * Get event manager from media descriptor object.
382 * NOTE: this function doesn't increment reference counting.
384 * \param p_md a media descriptor object
385 * \param p_e an initialized exception object
386 * \return event manager object
388 VLC_PUBLIC_API libvlc_event_manager_t *
389 libvlc_media_event_manager( libvlc_media_t * p_md,
390 libvlc_exception_t * p_e );
393 * Get duration of media descriptor object item.
395 * \param p_md media descriptor object
396 * \param p_e an initialized exception object
397 * \return duration of media item
399 VLC_PUBLIC_API libvlc_time_t
400 libvlc_media_get_duration( libvlc_media_t * p_md,
401 libvlc_exception_t * p_e );
404 * Get preparsed status for media descriptor object.
406 * \param p_md media descriptor object
407 * \param p_e an initialized exception object
408 * \return true if media object has been preparsed otherwise it returns false
411 libvlc_media_is_preparsed( libvlc_media_t * p_md,
412 libvlc_exception_t * p_e );
415 * Sets media descriptor's user_data. user_data is specialized data
416 * accessed by the host application, VLC.framework uses it as a pointer to
417 * an native object that references a libvlc_media_t pointer
419 * \param p_md media descriptor object
420 * \param p_new_user_data pointer to user data
421 * \param p_e an initialized exception object
424 libvlc_media_set_user_data( libvlc_media_t * p_md,
425 void * p_new_user_data,
426 libvlc_exception_t * p_e);
429 * Get media descriptor's user_data. user_data is specialized data
430 * accessed by the host application, VLC.framework uses it as a pointer to
431 * an native object that references a libvlc_media_t pointer
433 * \param p_md media descriptor object
434 * \param p_e an initialized exception object
436 VLC_PUBLIC_API void *
437 libvlc_media_get_user_data( libvlc_media_t * p_md,
438 libvlc_exception_t * p_e);
442 /*****************************************************************************
444 *****************************************************************************/
445 /** \defgroup libvlc_media_player libvlc_media_player
447 * LibVLC Media Player, object that let you play a media
448 * in a libvlc_drawable_t
453 * Create an empty Media Player object
455 * \param p_libvlc_instance the libvlc instance in which the Media Player
457 * \param p_e an initialized exception pointer
459 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t *, libvlc_exception_t * );
462 * Create a Media Player object from a Media
464 * \param p_md the media. Afterwards the p_md can be safely
466 * \param p_e an initialized exception pointer
468 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new_from_media( libvlc_media_t *, libvlc_exception_t * );
471 * Release a media_player after use
472 * Decrement the reference count of a media player object. If the
473 * reference count is 0, then libvlc_media_player_release() will
474 * release the media player object. If the media player object
475 * has been released, then it should not be used again.
477 * \param p_mi the Media Player to free
479 VLC_PUBLIC_API void libvlc_media_player_release( libvlc_media_player_t * );
482 * Retain a reference to a media player object. Use
483 * libvlc_media_player_release() to decrement reference count.
485 * \param p_mi media player object
487 VLC_PUBLIC_API void libvlc_media_player_retain( libvlc_media_player_t * );
490 * Set the media that will be used by the media_player. If any,
491 * previous md will be released.
493 * \param p_mi the Media Player
494 * \param p_md the Media. Afterwards the p_md can be safely
496 * \param p_e an initialized exception pointer
498 VLC_PUBLIC_API void libvlc_media_player_set_media( libvlc_media_player_t *, libvlc_media_t *, libvlc_exception_t * );
501 * Get the media used by the media_player.
503 * \param p_mi the Media Player
504 * \param p_e an initialized exception pointer
505 * \return the media associated with p_mi, or NULL if no
506 * media is associated
508 VLC_PUBLIC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t *, libvlc_exception_t * );
511 * Get the Event Manager from which the media player send event.
513 * \param p_mi the Media Player
514 * \param p_e an initialized exception pointer
515 * \return the event manager associated with p_mi
517 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *, libvlc_exception_t * );
522 * \param p_mi the Media Player
523 * \param p_e an initialized exception pointer
524 * \return 1 if the media player is playing, 0 otherwise
526 VLC_PUBLIC_API int libvlc_media_player_is_playing ( libvlc_media_player_t *, libvlc_exception_t * );
531 * \param p_mi the Media Player
532 * \param p_e an initialized exception pointer
534 VLC_PUBLIC_API void libvlc_media_player_play ( libvlc_media_player_t *, libvlc_exception_t * );
539 * \param p_mi the Media Player
540 * \param p_e an initialized exception pointer
542 VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *, libvlc_exception_t * );
547 * \param p_mi the Media Player
548 * \param p_e an initialized exception pointer
550 VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *, libvlc_exception_t * );
553 * Set the drawable where the media player should render its video output.
555 * On Windows 32-bits, a window handle (HWND) is expected.
556 * On Windows 64-bits, this function will always fail.
558 * On OSX, a CGrafPort is expected.
560 * Otherwise, this shall be the identifier of an existing X11 drawable (window
561 * or pixmap). It is assumed that the X11 server is the same as the one in
562 * x11-display if configured. If XVideo is <b>not</b> supported, it is assumed
563 * that the drawable has the same pixmap format as the default X11 screen
564 * (especially depth, scan line pad, black pixel); this is a bug.
566 * \param p_mi the Media Player
567 * \param drawable the libvlc_drawable_t where the media player
568 * should render its video
569 * \param p_e an initialized exception pointer
571 VLC_PUBLIC_API void libvlc_media_player_set_drawable ( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
574 * Get the drawable where the media player should render its video output
576 * \param p_mi the Media Player
577 * \param p_e an initialized exception pointer
578 * \return the libvlc_drawable_t where the media player
579 * should render its video
581 VLC_PUBLIC_API libvlc_drawable_t
582 libvlc_media_player_get_drawable ( libvlc_media_player_t *, libvlc_exception_t * );
584 /** \bug This might go away ... to be replaced by a broader system */
587 * Get the current movie length (in ms).
589 * \param p_mi the Media Player
590 * \param p_e an initialized exception pointer
591 * \return the movie length (in ms).
593 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_length( libvlc_media_player_t *, libvlc_exception_t *);
596 * Get the current movie time (in ms).
598 * \param p_mi the Media Player
599 * \param p_e an initialized exception pointer
600 * \return the movie time (in ms).
602 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_time( libvlc_media_player_t *, libvlc_exception_t *);
605 * Set the movie time (in ms).
607 * \param p_mi the Media Player
608 * \param the movie time (in ms).
609 * \param p_e an initialized exception pointer
611 VLC_PUBLIC_API void libvlc_media_player_set_time( libvlc_media_player_t *, libvlc_time_t, libvlc_exception_t *);
614 * Get movie position.
616 * \param p_mi the Media Player
617 * \param p_e an initialized exception pointer
618 * \return movie position
620 VLC_PUBLIC_API float libvlc_media_player_get_position( libvlc_media_player_t *, libvlc_exception_t *);
623 * Set movie position.
625 * \param p_mi the Media Player
626 * \param p_e an initialized exception pointer
627 * \return movie position
629 VLC_PUBLIC_API void libvlc_media_player_set_position( libvlc_media_player_t *, float, libvlc_exception_t *);
634 * \param p_mi the Media Player
635 * \param i_chapter chapter number to play
636 * \param p_e an initialized exception pointer
638 VLC_PUBLIC_API void libvlc_media_player_set_chapter( libvlc_media_player_t *, int, libvlc_exception_t *);
643 * \param p_mi the Media Player
644 * \param p_e an initialized exception pointer
645 * \return chapter number currently playing
647 VLC_PUBLIC_API int libvlc_media_player_get_chapter( libvlc_media_player_t *, libvlc_exception_t * );
650 * Get movie chapter count
652 * \param p_mi the Media Player
653 * \param p_e an initialized exception pointer
654 * \return number of chapters in movie
656 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count( libvlc_media_player_t *, libvlc_exception_t *);
657 VLC_PUBLIC_API int libvlc_media_player_will_play ( libvlc_media_player_t *, libvlc_exception_t *);
660 * Get title chapter count
662 * \param p_mi the Media Player
663 * \param i_title title
664 * \param p_e an initialized exception pointer
665 * \return number of chapters in title
667 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count_for_title(
668 libvlc_media_player_t *, int, libvlc_exception_t *);
673 * \param p_mi the Media Player
674 * \param i_title title number to play
675 * \param p_e an initialized exception pointer
677 VLC_PUBLIC_API void libvlc_media_player_set_title( libvlc_media_player_t *, int, libvlc_exception_t *);
682 * \param p_mi the Media Player
683 * \param p_e an initialized exception pointer
684 * \return title number currently playing
686 VLC_PUBLIC_API int libvlc_media_player_get_title( libvlc_media_player_t *, libvlc_exception_t *);
689 * Get movie title count
691 * \param p_mi the Media Player
692 * \param p_e an initialized exception pointer
693 * \return title number count
695 VLC_PUBLIC_API int libvlc_media_player_get_title_count( libvlc_media_player_t *, libvlc_exception_t *);
698 * Set previous chapter
700 * \param p_mi the Media Player
701 * \param p_e an initialized exception pointer
703 VLC_PUBLIC_API void libvlc_media_player_previous_chapter( libvlc_media_player_t *, libvlc_exception_t *);
708 * \param p_mi the Media Player
709 * \param p_e an initialized exception pointer
711 VLC_PUBLIC_API void libvlc_media_player_next_chapter( libvlc_media_player_t *, libvlc_exception_t *);
714 * Get movie play rate
716 * \param p_mi the Media Player
717 * \param p_e an initialized exception pointer
718 * \return movie play rate
720 VLC_PUBLIC_API float libvlc_media_player_get_rate( libvlc_media_player_t *, libvlc_exception_t *);
723 * Set movie play rate
725 * \param p_mi the Media Player
726 * \param movie play rate to set
727 * \param p_e an initialized exception pointer
729 VLC_PUBLIC_API void libvlc_media_player_set_rate( libvlc_media_player_t *, float, libvlc_exception_t *);
732 * Get current movie state
734 * \param p_mi the Media Player
735 * \param p_e an initialized exception pointer
736 * \return current movie state as libvlc_state_t
738 VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *, libvlc_exception_t *);
743 * \param p_mi the Media Player
744 * \param p_e an initialized exception pointer
745 * \return frames per second (fps) for this playing movie
747 VLC_PUBLIC_API float libvlc_media_player_get_fps( libvlc_media_player_t *, libvlc_exception_t *);
752 * Does this media player have a video output?
754 * \param p_md the media player
755 * \param p_e an initialized exception pointer
757 VLC_PUBLIC_API int libvlc_media_player_has_vout( libvlc_media_player_t *, libvlc_exception_t *);
760 * Is this media player seekable?
762 * \param p_input the input
763 * \param p_e an initialized exception pointer
765 VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
768 * Can this media player be paused?
770 * \param p_input the input
771 * \param p_e an initialized exception pointer
773 VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
776 * Release (free) libvlc_track_description_t
778 * \param p_track_description the structure to release
780 VLC_PUBLIC_API void libvlc_track_description_release( libvlc_track_description_t *p_track_description );
782 /** \defgroup libvlc_video libvlc_video
783 * \ingroup libvlc_media_player
784 * LibVLC Video handling
789 * Toggle fullscreen status on video output.
791 * \param p_mediaplayer the media player
792 * \param p_e an initialized exception pointer
794 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
797 * Enable or disable fullscreen on a video output.
799 * \param p_mediaplayer the media player
800 * \param b_fullscreen boolean for fullscreen status
801 * \param p_e an initialized exception pointer
803 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *, int, libvlc_exception_t * );
806 * Get current fullscreen status.
808 * \param p_mediaplayer the media player
809 * \param p_e an initialized exception pointer
810 * \return the fullscreen status (boolean)
812 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
815 * Get current video height.
817 * \param p_mediaplayer the media player
818 * \param p_e an initialized exception pointer
819 * \return the video height
821 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_player_t *, libvlc_exception_t * );
824 * Get current video width.
826 * \param p_mediaplayer the media player
827 * \param p_e an initialized exception pointer
828 * \return the video width
830 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_player_t *, libvlc_exception_t * );
833 * Get current video aspect ratio.
835 * \param p_mediaplayer the media player
836 * \param p_e an initialized exception pointer
837 * \return the video aspect ratio
839 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *, libvlc_exception_t * );
842 * Set new video aspect ratio.
844 * \param p_mediaplayer the media player
845 * \param psz_aspect new video aspect-ratio
846 * \param p_e an initialized exception pointer
848 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *, char *, libvlc_exception_t * );
851 * Get current video subtitle.
853 * \param p_mediaplayer the media player
854 * \param p_e an initialized exception pointer
855 * \return the video subtitle selected
857 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *, libvlc_exception_t * );
860 * Get the number of available video subtitles.
862 * \param p_mediaplayer the media player
863 * \param p_e an initialized exception pointer
864 * \return the number of available video subtitles
866 VLC_PUBLIC_API int libvlc_video_get_spu_count( libvlc_media_player_t *, libvlc_exception_t * );
869 * Get the description of available video subtitles.
871 * \param p_mediaplayer the media player
872 * \param p_e an initialized exception pointer
873 * \return list containing description of available video subtitles
875 VLC_PUBLIC_API libvlc_track_description_t *
876 libvlc_video_get_spu_description( libvlc_media_player_t *, libvlc_exception_t * );
879 * Set new video subtitle.
881 * \param p_mediaplayer the media player
882 * \param i_spu new video subtitle to select
883 * \param p_e an initialized exception pointer
885 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_player_t *, int , libvlc_exception_t * );
888 * Set new video subtitle file.
890 * \param p_mediaplayer the media player
891 * \param psz_subtitle new video subtitle file
892 * \param p_e an initialized exception pointer
893 * \return the success status (boolean)
895 VLC_PUBLIC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *, char *, libvlc_exception_t * );
898 * Get the description of available titles.
900 * \param p_mediaplayer the media player
901 * \param p_e an initialized exception pointer
902 * \return list containing description of available titles
904 VLC_PUBLIC_API libvlc_track_description_t *
905 libvlc_video_get_title_description( libvlc_media_player_t *, libvlc_exception_t * );
908 * Get the description of available chapters for specific title.
910 * \param p_mediaplayer the media player
911 * \param i_title selected title
912 * \param p_e an initialized exception pointer
913 * \return list containing description of available chapter for title i_title
915 VLC_PUBLIC_API libvlc_track_description_t *
916 libvlc_video_get_chapter_description( libvlc_media_player_t *, int, libvlc_exception_t * );
919 * Get current crop filter geometry.
921 * \param p_mediaplayer the media player
922 * \param p_e an initialized exception pointer
923 * \return the crop filter geometry
925 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *, libvlc_exception_t * );
928 * Set new crop filter geometry.
930 * \param p_mediaplayer the media player
931 * \param psz_geometry new crop filter geometry
932 * \param p_e an initialized exception pointer
934 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_player_t *, char *, libvlc_exception_t * );
937 * Toggle teletext transparent status on video output.
939 * \param p_mediaplayer the media player
940 * \param p_e an initialized exception pointer
942 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *, libvlc_exception_t * );
945 * Get current teletext page requested.
947 * \param p_mediaplayer the media player
948 * \param p_e an initialized exception pointer
949 * \return the current teletext page requested.
951 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t *, libvlc_exception_t * );
954 * Set new teletext page to retrieve.
956 * \param p_mediaplayer the media player
957 * \param i_page teletex page number requested
958 * \param p_e an initialized exception pointer
960 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *, int, libvlc_exception_t * );
963 * Get number of available video tracks.
965 * \param p_mi media player
966 * \param p_e an initialized exception
967 * \return the number of available video tracks (int)
969 VLC_PUBLIC_API int libvlc_video_get_track_count( libvlc_media_player_t *, libvlc_exception_t * );
972 * Get the description of available video tracks.
974 * \param p_mi media player
975 * \param p_e an initialized exception
976 * \return list with description of available video tracks
978 VLC_PUBLIC_API libvlc_track_description_t *
979 libvlc_video_get_track_description( libvlc_media_player_t *, libvlc_exception_t * );
982 * Get current video track.
984 * \param p_mi media player
985 * \param p_e an initialized exception pointer
986 * \return the video track (int)
988 VLC_PUBLIC_API int libvlc_video_get_track( libvlc_media_player_t *, libvlc_exception_t * );
993 * \param p_mi media player
994 * \param i_track the track (int)
995 * \param p_e an initialized exception pointer
997 VLC_PUBLIC_API void libvlc_video_set_track( libvlc_media_player_t *, int, libvlc_exception_t * );
1000 * Take a snapshot of the current video window.
1002 * If i_width AND i_height is 0, original size is used.
1003 * If i_width XOR i_height is 0, original aspect-ratio is preserved.
1005 * \param p_mediaplayer the media player
1006 * \param psz_filepath the path where to save the screenshot to
1007 * \param i_width the snapshot's width
1008 * \param i_height the snapshot's height
1009 * \param p_e an initialized exception pointer
1011 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_player_t *, char *,unsigned int, unsigned int, libvlc_exception_t * );
1014 * Resize the current video output window.
1016 * \param p_instance libvlc instance
1017 * \param width new width for video output window
1018 * \param height new height for video output window
1019 * \param p_e an initialized exception pointer
1020 * \return the success status (boolean)
1022 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_player_t *, int, int, libvlc_exception_t *);
1025 * Change the parent for the current the video output.
1027 * \param p_instance libvlc instance
1028 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
1029 * \param p_e an initialized exception pointer
1030 * \return the success status (boolean)
1032 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
1035 * Tell windowless video output to redraw rectangular area (MacOS X only).
1037 * \param p_instance libvlc instance
1038 * \param area coordinates within video drawable
1039 * \param p_e an initialized exception pointer
1041 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_player_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
1044 * Set the default video output size.
1046 * This setting will be used as default for all video outputs.
1048 * \param p_instance libvlc instance
1049 * \param width new width for video drawable
1050 * \param height new height for video drawable
1051 * \param p_e an initialized exception pointer
1053 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
1056 * Set the default video output viewport for a windowless video output
1059 * This setting will be used as default for all video outputs.
1061 * \param p_instance libvlc instance
1062 * \param view coordinates within video drawable
1063 * \param clip coordinates within video drawable
1064 * \param p_e an initialized exception pointer
1066 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
1070 /** \defgroup libvlc_audio libvlc_audio
1071 * \ingroup libvlc_media_player
1072 * LibVLC Audio handling
1077 * Audio device types
1079 typedef enum libvlc_audio_output_device_types_t {
1080 libvlc_AudioOutputDevice_Error = -1,
1081 libvlc_AudioOutputDevice_Mono = 1,
1082 libvlc_AudioOutputDevice_Stereo = 2,
1083 libvlc_AudioOutputDevice_2F2R = 4,
1084 libvlc_AudioOutputDevice_3F2R = 5,
1085 libvlc_AudioOutputDevice_5_1 = 6,
1086 libvlc_AudioOutputDevice_6_1 = 7,
1087 libvlc_AudioOutputDevice_7_1 = 8,
1088 libvlc_AudioOutputDevice_SPDIF = 10
1089 } libvlc_audio_output_device_types_t;
1094 typedef enum libvlc_audio_output_channel_t {
1095 libvlc_AudioChannel_Error = -1,
1096 libvlc_AudioChannel_Stereo = 1,
1097 libvlc_AudioChannel_RStereo = 2,
1098 libvlc_AudioChannel_Left = 3,
1099 libvlc_AudioChannel_Right = 4,
1100 libvlc_AudioChannel_Dolbys = 5
1101 } libvlc_audio_output_channel_t;
1105 * Get the list of available audio outputs
1107 * \param p_instance libvlc instance
1108 * \param p_e an initialized exception pointer
1109 * \return list of available audio outputs, at the end free it with
1110 * \see libvlc_audio_output_list_release \see libvlc_audio_output_t
1112 VLC_PUBLIC_API libvlc_audio_output_t *
1113 libvlc_audio_output_list_get( libvlc_instance_t *,
1114 libvlc_exception_t * );
1117 * Free the list of available audio outputs
1119 * \param p_list list with audio outputs for release
1121 VLC_PUBLIC_API void libvlc_audio_output_list_release( libvlc_audio_output_t * );
1124 * Set the audio output.
1125 * Change will be applied after stop and play.
1127 * \param p_instance libvlc instance
1128 * \param psz_name name of audio output,
1129 * use psz_name of \see libvlc_audio_output_t
1130 * \return true if function succeded
1132 VLC_PUBLIC_API int libvlc_audio_output_set( libvlc_instance_t *,
1136 * Get count of devices for audio output, these devices are hardware oriented
1137 * like analor or digital output of sound card
1139 * \param p_instance libvlc instance
1140 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1141 * \return number of devices
1143 VLC_PUBLIC_API int libvlc_audio_output_device_count( libvlc_instance_t *,
1147 * Get long name of device, if not available short name given
1149 * \param p_instance libvlc instance
1150 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1151 * \param i_device device index
1152 * \return long name of device
1154 VLC_PUBLIC_API char * libvlc_audio_output_device_longname( libvlc_instance_t *,
1159 * Get id name of device
1161 * \param p_instance libvlc instance
1162 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1163 * \param i_device device index
1164 * \return id name of device, use for setting device, need to be free after use
1166 VLC_PUBLIC_API char * libvlc_audio_output_device_id( libvlc_instance_t *,
1171 * Set device for using
1173 * \param p_instance libvlc instance
1174 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1175 * \param psz_device_id device
1177 VLC_PUBLIC_API void libvlc_audio_output_device_set( libvlc_instance_t *,
1182 * Get current audio device type. Device type describes something like
1183 * character of output sound - stereo sound, 2.1, 5.1 etc
1185 * \param p_instance vlc instance
1186 * \param p_e an initialized exception pointer
1187 * \return the audio devices type \see libvlc_audio_output_device_types_t
1189 VLC_PUBLIC_API int libvlc_audio_output_get_device_type(
1190 libvlc_instance_t *, libvlc_exception_t * );
1193 * Set current audio device type.
1195 * \param p_instance vlc instance
1196 * \param device_type the audio device type,
1197 according to \see libvlc_audio_output_device_types_t
1198 * \param p_e an initialized exception pointer
1200 VLC_PUBLIC_API void libvlc_audio_output_set_device_type( libvlc_instance_t *,
1202 libvlc_exception_t * );
1206 * Toggle mute status.
1208 * \param p_instance libvlc instance
1209 * \param p_e an initialized exception pointer
1211 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
1214 * Get current mute status.
1216 * \param p_instance libvlc instance
1217 * \param p_e an initialized exception pointer
1218 * \return the mute status (boolean)
1220 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
1225 * \param p_instance libvlc instance
1226 * \param status If status is true then mute, otherwise unmute
1227 * \param p_e an initialized exception pointer
1229 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, int , libvlc_exception_t * );
1232 * Get current audio level.
1234 * \param p_instance libvlc instance
1235 * \param p_e an initialized exception pointer
1236 * \return the audio level (int)
1238 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
1241 * Set current audio level.
1243 * \param p_instance libvlc instance
1244 * \param i_volume the volume (int)
1245 * \param p_e an initialized exception pointer
1247 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
1250 * Get number of available audio tracks.
1252 * \param p_mi media player
1253 * \param p_e an initialized exception
1254 * \return the number of available audio tracks (int)
1256 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *, libvlc_exception_t * );
1259 * Get the description of available audio tracks.
1261 * \param p_mi media player
1262 * \param p_e an initialized exception
1263 * \return list with description of available audio tracks
1265 VLC_PUBLIC_API libvlc_track_description_t *
1266 libvlc_audio_get_track_description( libvlc_media_player_t *, libvlc_exception_t * );
1269 * Get current audio track.
1271 * \param p_mi media player
1272 * \param p_e an initialized exception pointer
1273 * \return the audio track (int)
1275 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *, libvlc_exception_t * );
1278 * Set current audio track.
1280 * \param p_mi media player
1281 * \param i_track the track (int)
1282 * \param p_e an initialized exception pointer
1284 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_player_t *, int, libvlc_exception_t * );
1287 * Get current audio channel.
1289 * \param p_instance vlc instance
1290 * \param p_e an initialized exception pointer
1291 * \return the audio channel \see libvlc_audio_output_channel_t
1294 libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
1297 * Set current audio channel.
1299 * \param p_instance vlc instance
1300 * \param channel the audio channel, \see libvlc_audio_output_channel_t
1301 * \param p_e an initialized exception pointer
1303 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *,
1305 libvlc_exception_t * );
1309 /** @} media_player */
1311 /*****************************************************************************
1313 *****************************************************************************/
1315 /** \defgroup libvlc_event libvlc_event
1316 * \ingroup libvlc_core
1322 * Register for an event notification.
1324 * \param p_event_manager the event manager to which you want to attach to.
1325 * Generally it is obtained by vlc_my_object_event_manager() where
1326 * my_object is the object you want to listen to.
1327 * \param i_event_type the desired event to which we want to listen
1328 * \param f_callback the function to call when i_event_type occurs
1329 * \param user_data user provided data to carry with the event
1330 * \param p_e an initialized exception pointer
1332 VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
1333 libvlc_event_type_t i_event_type,
1334 libvlc_callback_t f_callback,
1336 libvlc_exception_t *p_e );
1339 * Unregister an event notification.
1341 * \param p_event_manager the event manager
1342 * \param i_event_type the desired event to which we want to unregister
1343 * \param f_callback the function to call when i_event_type occurs
1344 * \param p_user_data user provided data to carry with the event
1345 * \param p_e an initialized exception pointer
1347 VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
1348 libvlc_event_type_t i_event_type,
1349 libvlc_callback_t f_callback,
1351 libvlc_exception_t *p_e );
1354 * Get an event's type name.
1356 * \param i_event_type the desired event
1358 VLC_PUBLIC_API const char * libvlc_event_type_name( libvlc_event_type_t event_type );
1362 /*****************************************************************************
1364 *****************************************************************************/
1365 /** \defgroup libvlc_media_library libvlc_media_library
1367 * LibVLC Media Library
1370 VLC_PUBLIC_API libvlc_media_library_t *
1371 libvlc_media_library_new( libvlc_instance_t * p_inst,
1372 libvlc_exception_t * p_e );
1375 * Release media library object. This functions decrements the
1376 * reference count of the media library object. If it reaches 0,
1377 * then the object will be released.
1379 * \param p_mlib media library object
1382 libvlc_media_library_release( libvlc_media_library_t * p_mlib );
1385 * Retain a reference to a media library object. This function will
1386 * increment the reference counting for this object. Use
1387 * libvlc_media_library_release() to decrement the reference count.
1389 * \param p_mlib media library object
1392 libvlc_media_library_retain( libvlc_media_library_t * p_mlib );
1395 * Load media library.
1397 * \param p_mlib media library object
1398 * \param p_e an initialized exception object.
1401 libvlc_media_library_load( libvlc_media_library_t * p_mlib,
1402 libvlc_exception_t * p_e );
1405 * Save media library.
1407 * \param p_mlib media library object
1408 * \param p_e an initialized exception object.
1411 libvlc_media_library_save( libvlc_media_library_t * p_mlib,
1412 libvlc_exception_t * p_e );
1415 * Get media library subitems.
1417 * \param p_mlib media library object
1418 * \param p_e an initialized exception object.
1419 * \return media list subitems
1421 VLC_PUBLIC_API libvlc_media_list_t *
1422 libvlc_media_library_media_list( libvlc_media_library_t * p_mlib,
1423 libvlc_exception_t * p_e );
1429 /*****************************************************************************
1430 * Services/Media Discovery
1431 *****************************************************************************/
1432 /** \defgroup libvlc_media_discoverer libvlc_media_discoverer
1434 * LibVLC Media Discoverer
1439 * Discover media service by name.
1441 * \param p_inst libvlc instance
1442 * \param psz_name service name
1443 * \param p_e an initialized exception object
1444 * \return media discover object
1446 VLC_PUBLIC_API libvlc_media_discoverer_t *
1447 libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
1448 const char * psz_name,
1449 libvlc_exception_t * p_e );
1452 * Release media discover object. If the reference count reaches 0, then
1453 * the object will be released.
1455 * \param p_mdis media service discover object
1457 VLC_PUBLIC_API void libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
1460 * Get media service discover object its localized name.
1462 * \param media discover object
1463 * \return localized name
1465 VLC_PUBLIC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
1468 * Get media service discover media list.
1470 * \param p_mdis media service discover object
1471 * \return list of media items
1473 VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis );
1476 * Get event manager from media service discover object.
1478 * \param p_mdis media service discover object
1479 * \return event manager object.
1481 VLC_PUBLIC_API libvlc_event_manager_t *
1482 libvlc_media_discoverer_event_manager( libvlc_media_discoverer_t * p_mdis );
1485 * Query if media service discover object is running.
1487 * \param p_mdis media service discover object
1488 * \return true if running, false if not
1491 libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis );
1496 /*****************************************************************************
1497 * Message log handling
1498 *****************************************************************************/
1500 /** \defgroup libvlc_log libvlc_log
1501 * \ingroup libvlc_core
1502 * LibVLC Message Logging
1507 * Return the VLC messaging verbosity level.
1509 * \param p_instance libvlc instance
1510 * \param p_e an initialized exception pointer
1511 * \return verbosity level for messages
1513 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
1514 libvlc_exception_t *p_e );
1517 * Set the VLC messaging verbosity level.
1519 * \param p_instance libvlc log instance
1520 * \param level log level
1521 * \param p_e an initialized exception pointer
1523 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
1524 libvlc_exception_t *p_e );
1527 * Open a VLC message log instance.
1529 * \param p_instance libvlc instance
1530 * \param p_e an initialized exception pointer
1531 * \return log message instance
1533 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( libvlc_instance_t *, libvlc_exception_t *);
1536 * Close a VLC message log instance.
1538 * \param p_log libvlc log instance
1539 * \param p_e an initialized exception pointer
1541 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
1544 * Returns the number of messages in a log instance.
1546 * \param p_log libvlc log instance
1547 * \param p_e an initialized exception pointer
1548 * \return number of log messages
1550 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
1553 * Clear a log instance.
1555 * All messages in the log are removed. The log should be cleared on a
1556 * regular basis to avoid clogging.
1558 * \param p_log libvlc log instance
1559 * \param p_e an initialized exception pointer
1561 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
1564 * Allocate and returns a new iterator to messages in log.
1566 * \param p_log libvlc log instance
1567 * \param p_e an initialized exception pointer
1568 * \return log iterator object
1570 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
1573 * Release a previoulsy allocated iterator.
1575 * \param p_iter libvlc log iterator
1576 * \param p_e an initialized exception pointer
1578 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1581 * Return whether log iterator has more messages.
1583 * \param p_iter libvlc log iterator
1584 * \param p_e an initialized exception pointer
1585 * \return true if iterator has more message objects, else false
1587 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1590 * Return the next log message.
1592 * The message contents must not be freed
1594 * \param p_iter libvlc log iterator
1595 * \param p_buffer log buffer
1596 * \param p_e an initialized exception pointer
1597 * \return log message object
1599 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
1600 libvlc_log_message_t *p_buffer,
1601 libvlc_exception_t *p_e );
1609 #endif /* <vlc/libvlc.h> */