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.
169 * \param p_instance the instance
170 * \param name interface name, or NULL for default
171 * \param p_exception an initialized exception pointer
174 void libvlc_add_intf( libvlc_instance_t *p_instance, const char *name,
175 libvlc_exception_t *p_exception );
178 * Waits until an interface causes the instance to exit.
179 * You should start at least one interface first, using libvlc_add_intf().
181 * \param p_instance the instance
184 void libvlc_wait( libvlc_instance_t *p_instance );
187 * Retrieve libvlc version.
189 * Example: "0.9.0-git Grishenko"
191 * \return a string containing the libvlc version
193 VLC_PUBLIC_API const char * libvlc_get_version(void);
196 * Retrieve libvlc compiler version.
198 * Example: "gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu6)"
200 * \return a string containing the libvlc compiler version
202 VLC_PUBLIC_API const char * libvlc_get_compiler(void);
205 * Retrieve libvlc changeset.
207 * Example: "aa9bce0bc4"
209 * \return a string containing the libvlc changeset
211 VLC_PUBLIC_API const char * libvlc_get_changeset(void);
216 * Return the libvlc internal object, the main object that all other depend on.
217 * Any of of this function should be considered an ugly hack and avoided at all
218 * cost. E.g. you need to expose some functionality that is not provided by the
219 * libvlc API directly with libvlccore.
220 * Remember to release the object with vlc_object_release( obj* )
222 * \param p_instance the libvlc instance
224 VLC_PUBLIC_API struct vlc_object_t *libvlc_get_vlc_instance(libvlc_instance_t *);
227 * Frees an heap allocation (char *) returned by a LibVLC API.
228 * If you know you're using the same underlying C run-time as the LibVLC
229 * implementation, then you can call ANSI C free() directly instead.
231 VLC_PUBLIC_API void libvlc_free( void *ptr );
235 /*****************************************************************************
237 *****************************************************************************/
238 /** \defgroup libvlc_media libvlc_media
245 * Create a media with the given MRL.
247 * \param p_instance the instance
248 * \param psz_mrl the MRL to read
249 * \param p_e an initialized exception pointer
250 * \return the newly created media
252 VLC_PUBLIC_API libvlc_media_t * libvlc_media_new(
253 libvlc_instance_t *p_instance,
254 const char * psz_mrl,
255 libvlc_exception_t *p_e );
258 * Create a media as an empty node with the passed name.
260 * \param p_instance the instance
261 * \param psz_name the name of the node
262 * \param p_e an initialized exception pointer
263 * \return the new empty media
265 VLC_PUBLIC_API libvlc_media_t * libvlc_media_new_as_node(
266 libvlc_instance_t *p_instance,
267 const char * psz_name,
268 libvlc_exception_t *p_e );
271 * Add an option to the media.
273 * This option will be used to determine how the media_player will
274 * read the media. This allows to use VLC's advanced
275 * reading/streaming options on a per-media basis.
277 * The options are detailed in vlc --long-help, for instance "--sout-all"
279 * \param p_instance the instance
280 * \param ppsz_options the options (as a string)
281 * \param p_e an initialized exception pointer
283 VLC_PUBLIC_API void libvlc_media_add_option(
284 libvlc_media_t * p_md,
285 const char * ppsz_options,
286 libvlc_exception_t * p_e );
288 * Add an option to the media from an untrusted source.
290 * This option will be used to determine how the media_player will
291 * read the media. This allows to use VLC's advanced
292 * reading/streaming options on a per-media basis.
294 * The options are detailed in vlc --long-help, for instance "--sout-all"
296 * \param p_instance the instance
297 * \param ppsz_options the options (as a string)
298 * \param p_e an initialized exception pointer
300 VLC_PUBLIC_API void libvlc_media_add_option_untrusted(
301 libvlc_media_t * p_md,
302 const char * ppsz_options,
303 libvlc_exception_t * p_e );
307 * Retain a reference to a media descriptor object (libvlc_media_t). Use
308 * libvlc_media_release() to decrement the reference count of a
309 * media descriptor object.
311 * \param p_meta_desc a media descriptor object.
313 VLC_PUBLIC_API void libvlc_media_retain(
314 libvlc_media_t *p_meta_desc );
317 * Decrement the reference count of a media descriptor object. If the
318 * reference count is 0, then libvlc_media_release() will release the
319 * media descriptor object. It will send out an libvlc_MediaFreed event
320 * to all listeners. If the media descriptor object has been released it
321 * should not be used again.
323 * \param p_meta_desc a media descriptor object.
325 VLC_PUBLIC_API void libvlc_media_release(
326 libvlc_media_t *p_meta_desc );
330 * Get the media resource locator (mrl) from a media descriptor object
332 * \param p_md a media descriptor object
333 * \param p_e an initialized exception object
334 * \return string with mrl of media descriptor object
336 VLC_PUBLIC_API char * libvlc_media_get_mrl( libvlc_media_t * p_md,
337 libvlc_exception_t * p_e );
340 * Duplicate a media descriptor object.
342 * \param p_meta_desc a media descriptor object.
344 VLC_PUBLIC_API libvlc_media_t * libvlc_media_duplicate( libvlc_media_t * );
347 * Read the meta of the media.
349 * \param p_meta_desc the media to read
350 * \param e_meta_desc the meta to read
351 * \param p_e an initialized exception pointer
352 * \return the media's meta
354 VLC_PUBLIC_API char * libvlc_media_get_meta(
355 libvlc_media_t *p_meta_desc,
356 libvlc_meta_t e_meta,
357 libvlc_exception_t *p_e );
359 * Get current state of media descriptor object. Possible media states
360 * are defined in libvlc_structures.c ( libvlc_NothingSpecial=0,
361 * libvlc_Opening, libvlc_Buffering, libvlc_Playing, libvlc_Paused,
362 * libvlc_Stopped, libvlc_Ended,
365 * @see libvlc_state_t
366 * \param p_meta_desc a media descriptor object
367 * \param p_e an initialized exception object
368 * \return state of media descriptor object
370 VLC_PUBLIC_API libvlc_state_t libvlc_media_get_state(
371 libvlc_media_t *p_meta_desc,
372 libvlc_exception_t *p_e );
375 * Get subitems of media descriptor object. This will increment
376 * the reference count of supplied media descriptor object. Use
377 * libvlc_media_list_release() to decrement the reference counting.
379 * \param p_md media descriptor object
380 * \param p_e initalized exception object
381 * \return list of media descriptor subitems or NULL
383 VLC_PUBLIC_API libvlc_media_list_t *
384 libvlc_media_subitems( libvlc_media_t *p_md,
385 libvlc_exception_t *p_e );
387 * Get event manager from media descriptor object.
388 * NOTE: this function doesn't increment reference counting.
390 * \param p_md a media descriptor object
391 * \param p_e an initialized exception object
392 * \return event manager object
394 VLC_PUBLIC_API libvlc_event_manager_t *
395 libvlc_media_event_manager( libvlc_media_t * p_md,
396 libvlc_exception_t * p_e );
399 * Get duration of media descriptor object item.
401 * \param p_md media descriptor object
402 * \param p_e an initialized exception object
403 * \return duration of media item
405 VLC_PUBLIC_API libvlc_time_t
406 libvlc_media_get_duration( libvlc_media_t * p_md,
407 libvlc_exception_t * p_e );
410 * Get preparsed status for media descriptor object.
412 * \param p_md media descriptor object
413 * \param p_e an initialized exception object
414 * \return true if media object has been preparsed otherwise it returns false
417 libvlc_media_is_preparsed( libvlc_media_t * p_md,
418 libvlc_exception_t * p_e );
421 * Sets media descriptor's user_data. user_data is specialized data
422 * accessed by the host application, VLC.framework uses it as a pointer to
423 * an native object that references a libvlc_media_t pointer
425 * \param p_md media descriptor object
426 * \param p_new_user_data pointer to user data
427 * \param p_e an initialized exception object
430 libvlc_media_set_user_data( libvlc_media_t * p_md,
431 void * p_new_user_data,
432 libvlc_exception_t * p_e);
435 * Get media descriptor's user_data. user_data is specialized data
436 * accessed by the host application, VLC.framework uses it as a pointer to
437 * an native object that references a libvlc_media_t pointer
439 * \param p_md media descriptor object
440 * \param p_e an initialized exception object
442 VLC_PUBLIC_API void *
443 libvlc_media_get_user_data( libvlc_media_t * p_md,
444 libvlc_exception_t * p_e);
448 /*****************************************************************************
450 *****************************************************************************/
451 /** \defgroup libvlc_media_player libvlc_media_player
453 * LibVLC Media Player, object that let you play a media
454 * in a custom drawable
459 * Create an empty Media Player object
461 * \param p_libvlc_instance the libvlc instance in which the Media Player
463 * \param p_e an initialized exception pointer
465 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t *, libvlc_exception_t * );
468 * Create a Media Player object from a Media
470 * \param p_md the media. Afterwards the p_md can be safely
472 * \param p_e an initialized exception pointer
474 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new_from_media( libvlc_media_t *, libvlc_exception_t * );
477 * Release a media_player after use
478 * Decrement the reference count of a media player object. If the
479 * reference count is 0, then libvlc_media_player_release() will
480 * release the media player object. If the media player object
481 * has been released, then it should not be used again.
483 * \param p_mi the Media Player to free
485 VLC_PUBLIC_API void libvlc_media_player_release( libvlc_media_player_t * );
488 * Retain a reference to a media player object. Use
489 * libvlc_media_player_release() to decrement reference count.
491 * \param p_mi media player object
493 VLC_PUBLIC_API void libvlc_media_player_retain( libvlc_media_player_t * );
496 * Set the media that will be used by the media_player. If any,
497 * previous md will be released.
499 * \param p_mi the Media Player
500 * \param p_md the Media. Afterwards the p_md can be safely
502 * \param p_e an initialized exception pointer
504 VLC_PUBLIC_API void libvlc_media_player_set_media( libvlc_media_player_t *, libvlc_media_t *, libvlc_exception_t * );
507 * Get the media used by the media_player.
509 * \param p_mi the Media Player
510 * \param p_e an initialized exception pointer
511 * \return the media associated with p_mi, or NULL if no
512 * media is associated
514 VLC_PUBLIC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t *, libvlc_exception_t * );
517 * Get the Event Manager from which the media player send event.
519 * \param p_mi the Media Player
520 * \param p_e an initialized exception pointer
521 * \return the event manager associated with p_mi
523 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *, libvlc_exception_t * );
528 * \param p_mi the Media Player
529 * \param p_e an initialized exception pointer
530 * \return 1 if the media player is playing, 0 otherwise
532 VLC_PUBLIC_API int libvlc_media_player_is_playing ( libvlc_media_player_t *, libvlc_exception_t * );
537 * \param p_mi the Media Player
538 * \param p_e an initialized exception pointer
540 VLC_PUBLIC_API void libvlc_media_player_play ( libvlc_media_player_t *, libvlc_exception_t * );
545 * \param p_mi the Media Player
546 * \param p_e an initialized exception pointer
548 VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *, libvlc_exception_t * );
553 * \param p_mi the Media Player
554 * \param p_e an initialized exception pointer
556 VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *, libvlc_exception_t * );
559 * Set the agl handler where the media player should render its video output.
561 * \param p_mi the Media Player
562 * \param drawable the agl handler
563 * \param p_e an initialized exception pointer
565 VLC_PUBLIC_API void libvlc_media_player_set_agl ( libvlc_media_player_t *p_mi, uint32_t drawable, libvlc_exception_t *p_e );
568 * Get the agl handler previously set with libvlc_media_player_set_agl().
570 * \return the agl handler or 0 if none where set
572 VLC_PUBLIC_API uint32_t libvlc_media_player_get_agl ( libvlc_media_player_t *p_mi );
575 * Set an X Window System drawable where the media player should render its
576 * video output. If LibVLC was built without X11 output support, then this has
579 * The specified identifier must correspond to an existing Input/Output class
580 * X11 window. Pixmaps are <b>not</b> supported. The caller shall ensure that
581 * the X11 server is the same as the one the VLC instance has been configured
583 * If XVideo is <b>not</b> used, it is assumed that the drawable has the
584 * following properties in common with the default X11 screen: depth, scan line
585 * pad, black pixel. This is a bug.
587 * \param p_mi the Media Player
588 * \param drawable the ID of the X window
589 * \param p_e an initialized exception pointer
591 VLC_PUBLIC_API void libvlc_media_player_set_xwindow ( libvlc_media_player_t *p_mi, uint32_t drawable, libvlc_exception_t *p_e );
594 * Get the X Window System window identifier previously set with
595 * libvlc_media_player_set_xwindow(). Note that this will return the identifier
596 * even if VLC is not currently using it (for instance if it is playing an
599 * \return an X window ID, or 0 if none where set.
601 VLC_PUBLIC_API uint32_t libvlc_media_player_get_xwindow ( libvlc_media_player_t *p_mi );
604 * Set a Win32/Win64 API window handle (HWND) where the media player should
605 * render its video output. If LibVLC was built without Win32/Win64 API output
606 * support, then this has no effects.
608 * \param p_mi the Media Player
609 * \param drawable windows handle of the drawable
610 * \param p_e an initialized exception pointer
612 VLC_PUBLIC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi, void *drawable, libvlc_exception_t *p_e );
615 * Get the Windows API window handle (HWND) previously set with
616 * libvlc_media_player_set_hwnd(). The handle will be returned even if LibVLC
617 * is not currently outputting any video to it.
619 * \return a window handle or NULL if there are none.
621 VLC_PUBLIC_API void *libvlc_media_player_get_hwnd ( libvlc_media_player_t *p_mi );
625 /** \bug This might go away ... to be replaced by a broader system */
628 * Get the current movie length (in ms).
630 * \param p_mi the Media Player
631 * \param p_e an initialized exception pointer
632 * \return the movie length (in ms).
634 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_length( libvlc_media_player_t *, libvlc_exception_t *);
637 * Get the current movie time (in ms).
639 * \param p_mi the Media Player
640 * \param p_e an initialized exception pointer
641 * \return the movie time (in ms).
643 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_time( libvlc_media_player_t *, libvlc_exception_t *);
646 * Set the movie time (in ms).
648 * \param p_mi the Media Player
649 * \param the movie time (in ms).
650 * \param p_e an initialized exception pointer
652 VLC_PUBLIC_API void libvlc_media_player_set_time( libvlc_media_player_t *, libvlc_time_t, libvlc_exception_t *);
655 * Get movie position.
657 * \param p_mi the Media Player
658 * \param p_e an initialized exception pointer
659 * \return movie position
661 VLC_PUBLIC_API float libvlc_media_player_get_position( libvlc_media_player_t *, libvlc_exception_t *);
664 * Set movie position.
666 * \param p_mi the Media Player
667 * \param p_e an initialized exception pointer
668 * \return movie position
670 VLC_PUBLIC_API void libvlc_media_player_set_position( libvlc_media_player_t *, float, libvlc_exception_t *);
675 * \param p_mi the Media Player
676 * \param i_chapter chapter number to play
677 * \param p_e an initialized exception pointer
679 VLC_PUBLIC_API void libvlc_media_player_set_chapter( libvlc_media_player_t *, int, libvlc_exception_t *);
684 * \param p_mi the Media Player
685 * \param p_e an initialized exception pointer
686 * \return chapter number currently playing
688 VLC_PUBLIC_API int libvlc_media_player_get_chapter( libvlc_media_player_t *, libvlc_exception_t * );
691 * Get movie chapter count
693 * \param p_mi the Media Player
694 * \param p_e an initialized exception pointer
695 * \return number of chapters in movie
697 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count( libvlc_media_player_t *, libvlc_exception_t *);
698 VLC_PUBLIC_API int libvlc_media_player_will_play ( libvlc_media_player_t *, libvlc_exception_t *);
701 * Get title chapter count
703 * \param p_mi the Media Player
704 * \param i_title title
705 * \param p_e an initialized exception pointer
706 * \return number of chapters in title
708 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count_for_title(
709 libvlc_media_player_t *, int, libvlc_exception_t *);
714 * \param p_mi the Media Player
715 * \param i_title title number to play
716 * \param p_e an initialized exception pointer
718 VLC_PUBLIC_API void libvlc_media_player_set_title( libvlc_media_player_t *, int, libvlc_exception_t *);
723 * \param p_mi the Media Player
724 * \param p_e an initialized exception pointer
725 * \return title number currently playing
727 VLC_PUBLIC_API int libvlc_media_player_get_title( libvlc_media_player_t *, libvlc_exception_t *);
730 * Get movie title count
732 * \param p_mi the Media Player
733 * \param p_e an initialized exception pointer
734 * \return title number count
736 VLC_PUBLIC_API int libvlc_media_player_get_title_count( libvlc_media_player_t *, libvlc_exception_t *);
739 * Set previous chapter
741 * \param p_mi the Media Player
742 * \param p_e an initialized exception pointer
744 VLC_PUBLIC_API void libvlc_media_player_previous_chapter( libvlc_media_player_t *, libvlc_exception_t *);
749 * \param p_mi the Media Player
750 * \param p_e an initialized exception pointer
752 VLC_PUBLIC_API void libvlc_media_player_next_chapter( libvlc_media_player_t *, libvlc_exception_t *);
755 * Get movie play rate
757 * \param p_mi the Media Player
758 * \param p_e an initialized exception pointer
759 * \return movie play rate
761 VLC_PUBLIC_API float libvlc_media_player_get_rate( libvlc_media_player_t *, libvlc_exception_t *);
764 * Set movie play rate
766 * \param p_mi the Media Player
767 * \param movie play rate to set
768 * \param p_e an initialized exception pointer
770 VLC_PUBLIC_API void libvlc_media_player_set_rate( libvlc_media_player_t *, float, libvlc_exception_t *);
773 * Get current movie state
775 * \param p_mi the Media Player
776 * \param p_e an initialized exception pointer
777 * \return current movie state as libvlc_state_t
779 VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *, libvlc_exception_t *);
784 * \param p_mi the Media Player
785 * \param p_e an initialized exception pointer
786 * \return frames per second (fps) for this playing movie
788 VLC_PUBLIC_API float libvlc_media_player_get_fps( libvlc_media_player_t *, libvlc_exception_t *);
793 * Does this media player have a video output?
795 * \param p_md the media player
796 * \param p_e an initialized exception pointer
798 VLC_PUBLIC_API int libvlc_media_player_has_vout( libvlc_media_player_t *, libvlc_exception_t *);
801 * Is this media player seekable?
803 * \param p_input the input
804 * \param p_e an initialized exception pointer
806 VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
809 * Can this media player be paused?
811 * \param p_input the input
812 * \param p_e an initialized exception pointer
814 VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
817 * Release (free) libvlc_track_description_t
819 * \param p_track_description the structure to release
821 VLC_PUBLIC_API void libvlc_track_description_release( libvlc_track_description_t *p_track_description );
823 /** \defgroup libvlc_video libvlc_video
824 * \ingroup libvlc_media_player
825 * LibVLC Video handling
830 * Toggle fullscreen status on video output.
832 * \param p_mediaplayer the media player
833 * \param p_e an initialized exception pointer
835 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
838 * Enable or disable fullscreen on a video output.
840 * \param p_mediaplayer the media player
841 * \param b_fullscreen boolean for fullscreen status
842 * \param p_e an initialized exception pointer
844 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *, int, libvlc_exception_t * );
847 * Get current fullscreen status.
849 * \param p_mediaplayer the media player
850 * \param p_e an initialized exception pointer
851 * \return the fullscreen status (boolean)
853 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
856 * Get current video height.
858 * \param p_mediaplayer the media player
859 * \param p_e an initialized exception pointer
860 * \return the video height
862 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_player_t *, libvlc_exception_t * );
865 * Get current video width.
867 * \param p_mediaplayer the media player
868 * \param p_e an initialized exception pointer
869 * \return the video width
871 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_player_t *, libvlc_exception_t * );
874 * Get current video aspect ratio.
876 * \param p_mediaplayer the media player
877 * \param p_e an initialized exception pointer
878 * \return the video aspect ratio
880 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *, libvlc_exception_t * );
883 * Set new video aspect ratio.
885 * \param p_mediaplayer the media player
886 * \param psz_aspect new video aspect-ratio
887 * \param p_e an initialized exception pointer
889 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *, char *, libvlc_exception_t * );
892 * Get current video subtitle.
894 * \param p_mediaplayer the media player
895 * \param p_e an initialized exception pointer
896 * \return the video subtitle selected
898 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *, libvlc_exception_t * );
901 * Get the number of available video subtitles.
903 * \param p_mediaplayer the media player
904 * \param p_e an initialized exception pointer
905 * \return the number of available video subtitles
907 VLC_PUBLIC_API int libvlc_video_get_spu_count( libvlc_media_player_t *, libvlc_exception_t * );
910 * Get the description of available video subtitles.
912 * \param p_mediaplayer the media player
913 * \param p_e an initialized exception pointer
914 * \return list containing description of available video subtitles
916 VLC_PUBLIC_API libvlc_track_description_t *
917 libvlc_video_get_spu_description( libvlc_media_player_t *, libvlc_exception_t * );
920 * Set new video subtitle.
922 * \param p_mediaplayer the media player
923 * \param i_spu new video subtitle to select
924 * \param p_e an initialized exception pointer
926 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_player_t *, int , libvlc_exception_t * );
929 * Set new video subtitle file.
931 * \param p_mediaplayer the media player
932 * \param psz_subtitle new video subtitle file
933 * \param p_e an initialized exception pointer
934 * \return the success status (boolean)
936 VLC_PUBLIC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *, char *, libvlc_exception_t * );
939 * Get the description of available titles.
941 * \param p_mediaplayer the media player
942 * \param p_e an initialized exception pointer
943 * \return list containing description of available titles
945 VLC_PUBLIC_API libvlc_track_description_t *
946 libvlc_video_get_title_description( libvlc_media_player_t *, libvlc_exception_t * );
949 * Get the description of available chapters for specific title.
951 * \param p_mediaplayer the media player
952 * \param i_title selected title
953 * \param p_e an initialized exception pointer
954 * \return list containing description of available chapter for title i_title
956 VLC_PUBLIC_API libvlc_track_description_t *
957 libvlc_video_get_chapter_description( libvlc_media_player_t *, int, libvlc_exception_t * );
960 * Get current crop filter geometry.
962 * \param p_mediaplayer the media player
963 * \param p_e an initialized exception pointer
964 * \return the crop filter geometry
966 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *, libvlc_exception_t * );
969 * Set new crop filter geometry.
971 * \param p_mediaplayer the media player
972 * \param psz_geometry new crop filter geometry
973 * \param p_e an initialized exception pointer
975 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_player_t *, char *, libvlc_exception_t * );
978 * Toggle teletext transparent status on video output.
980 * \param p_mediaplayer the media player
981 * \param p_e an initialized exception pointer
983 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *, libvlc_exception_t * );
986 * Get current teletext page requested.
988 * \param p_mediaplayer the media player
989 * \param p_e an initialized exception pointer
990 * \return the current teletext page requested.
992 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t *, libvlc_exception_t * );
995 * Set new teletext page to retrieve.
997 * \param p_mediaplayer the media player
998 * \param i_page teletex page number requested
999 * \param p_e an initialized exception pointer
1001 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *, int, libvlc_exception_t * );
1004 * Get number of available video tracks.
1006 * \param p_mi media player
1007 * \param p_e an initialized exception
1008 * \return the number of available video tracks (int)
1010 VLC_PUBLIC_API int libvlc_video_get_track_count( libvlc_media_player_t *, libvlc_exception_t * );
1013 * Get the description of available video tracks.
1015 * \param p_mi media player
1016 * \param p_e an initialized exception
1017 * \return list with description of available video tracks
1019 VLC_PUBLIC_API libvlc_track_description_t *
1020 libvlc_video_get_track_description( libvlc_media_player_t *, libvlc_exception_t * );
1023 * Get current video track.
1025 * \param p_mi media player
1026 * \param p_e an initialized exception pointer
1027 * \return the video track (int)
1029 VLC_PUBLIC_API int libvlc_video_get_track( libvlc_media_player_t *, libvlc_exception_t * );
1034 * \param p_mi media player
1035 * \param i_track the track (int)
1036 * \param p_e an initialized exception pointer
1038 VLC_PUBLIC_API void libvlc_video_set_track( libvlc_media_player_t *, int, libvlc_exception_t * );
1041 * Take a snapshot of the current video window.
1043 * If i_width AND i_height is 0, original size is used.
1044 * If i_width XOR i_height is 0, original aspect-ratio is preserved.
1046 * \param p_mediaplayer the media player
1047 * \param psz_filepath the path where to save the screenshot to
1048 * \param i_width the snapshot's width
1049 * \param i_height the snapshot's height
1050 * \param p_e an initialized exception pointer
1052 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_player_t *, char *,unsigned int, unsigned int, libvlc_exception_t * );
1055 * Resize the current video output window.
1057 * \param p_instance libvlc instance
1058 * \param width new width for video output window
1059 * \param height new height for video output window
1060 * \param p_e an initialized exception pointer
1061 * \return the success status (boolean)
1063 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_player_t *, int, int, libvlc_exception_t *);
1066 * Tell windowless video output to redraw rectangular area (MacOS X only).
1068 * \param p_instance libvlc instance
1069 * \param area coordinates within video drawable
1070 * \param p_e an initialized exception pointer
1072 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_player_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
1075 * Set the default video output size.
1077 * This setting will be used as default for all video outputs.
1079 * \param p_instance libvlc instance
1080 * \param width new width for video drawable
1081 * \param height new height for video drawable
1082 * \param p_e an initialized exception pointer
1084 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
1087 * Set the default video output viewport for a windowless video output
1090 * This setting will be used as default for all video outputs.
1092 * \param p_instance libvlc instance
1093 * \param view coordinates within video drawable
1094 * \param clip coordinates within video drawable
1095 * \param p_e an initialized exception pointer
1097 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
1101 /** \defgroup libvlc_audio libvlc_audio
1102 * \ingroup libvlc_media_player
1103 * LibVLC Audio handling
1108 * Audio device types
1110 typedef enum libvlc_audio_output_device_types_t {
1111 libvlc_AudioOutputDevice_Error = -1,
1112 libvlc_AudioOutputDevice_Mono = 1,
1113 libvlc_AudioOutputDevice_Stereo = 2,
1114 libvlc_AudioOutputDevice_2F2R = 4,
1115 libvlc_AudioOutputDevice_3F2R = 5,
1116 libvlc_AudioOutputDevice_5_1 = 6,
1117 libvlc_AudioOutputDevice_6_1 = 7,
1118 libvlc_AudioOutputDevice_7_1 = 8,
1119 libvlc_AudioOutputDevice_SPDIF = 10
1120 } libvlc_audio_output_device_types_t;
1125 typedef enum libvlc_audio_output_channel_t {
1126 libvlc_AudioChannel_Error = -1,
1127 libvlc_AudioChannel_Stereo = 1,
1128 libvlc_AudioChannel_RStereo = 2,
1129 libvlc_AudioChannel_Left = 3,
1130 libvlc_AudioChannel_Right = 4,
1131 libvlc_AudioChannel_Dolbys = 5
1132 } libvlc_audio_output_channel_t;
1136 * Get the list of available audio outputs
1138 * \param p_instance libvlc instance
1139 * \param p_e an initialized exception pointer
1140 * \return list of available audio outputs, at the end free it with
1141 * \see libvlc_audio_output_list_release \see libvlc_audio_output_t
1143 VLC_PUBLIC_API libvlc_audio_output_t *
1144 libvlc_audio_output_list_get( libvlc_instance_t *,
1145 libvlc_exception_t * );
1148 * Free the list of available audio outputs
1150 * \param p_list list with audio outputs for release
1152 VLC_PUBLIC_API void libvlc_audio_output_list_release( libvlc_audio_output_t * );
1155 * Set the audio output.
1156 * Change will be applied after stop and play.
1158 * \param p_instance libvlc instance
1159 * \param psz_name name of audio output,
1160 * use psz_name of \see libvlc_audio_output_t
1161 * \return true if function succeded
1163 VLC_PUBLIC_API int libvlc_audio_output_set( libvlc_instance_t *,
1167 * Get count of devices for audio output, these devices are hardware oriented
1168 * like analor or digital output of sound card
1170 * \param p_instance libvlc instance
1171 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1172 * \return number of devices
1174 VLC_PUBLIC_API int libvlc_audio_output_device_count( libvlc_instance_t *,
1178 * Get long name of device, if not available short name given
1180 * \param p_instance libvlc instance
1181 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1182 * \param i_device device index
1183 * \return long name of device
1185 VLC_PUBLIC_API char * libvlc_audio_output_device_longname( libvlc_instance_t *,
1190 * Get id name of device
1192 * \param p_instance libvlc instance
1193 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1194 * \param i_device device index
1195 * \return id name of device, use for setting device, need to be free after use
1197 VLC_PUBLIC_API char * libvlc_audio_output_device_id( libvlc_instance_t *,
1202 * Set device for using
1204 * \param p_instance libvlc instance
1205 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1206 * \param psz_device_id device
1208 VLC_PUBLIC_API void libvlc_audio_output_device_set( libvlc_instance_t *,
1213 * Get current audio device type. Device type describes something like
1214 * character of output sound - stereo sound, 2.1, 5.1 etc
1216 * \param p_instance vlc instance
1217 * \param p_e an initialized exception pointer
1218 * \return the audio devices type \see libvlc_audio_output_device_types_t
1220 VLC_PUBLIC_API int libvlc_audio_output_get_device_type(
1221 libvlc_instance_t *, libvlc_exception_t * );
1224 * Set current audio device type.
1226 * \param p_instance vlc instance
1227 * \param device_type the audio device type,
1228 according to \see libvlc_audio_output_device_types_t
1229 * \param p_e an initialized exception pointer
1231 VLC_PUBLIC_API void libvlc_audio_output_set_device_type( libvlc_instance_t *,
1233 libvlc_exception_t * );
1237 * Toggle mute status.
1239 * \param p_instance libvlc instance
1240 * \param p_e an initialized exception pointer
1242 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
1245 * Get current mute status.
1247 * \param p_instance libvlc instance
1248 * \param p_e an initialized exception pointer
1249 * \return the mute status (boolean)
1251 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
1256 * \param p_instance libvlc instance
1257 * \param status If status is true then mute, otherwise unmute
1258 * \param p_e an initialized exception pointer
1260 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, int , libvlc_exception_t * );
1263 * Get current audio level.
1265 * \param p_instance libvlc instance
1266 * \param p_e an initialized exception pointer
1267 * \return the audio level (int)
1269 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
1272 * Set current audio level.
1274 * \param p_instance libvlc instance
1275 * \param i_volume the volume (int)
1276 * \param p_e an initialized exception pointer
1278 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
1281 * Get number of available audio tracks.
1283 * \param p_mi media player
1284 * \param p_e an initialized exception
1285 * \return the number of available audio tracks (int)
1287 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *, libvlc_exception_t * );
1290 * Get the description of available audio tracks.
1292 * \param p_mi media player
1293 * \param p_e an initialized exception
1294 * \return list with description of available audio tracks
1296 VLC_PUBLIC_API libvlc_track_description_t *
1297 libvlc_audio_get_track_description( libvlc_media_player_t *, libvlc_exception_t * );
1300 * Get current audio track.
1302 * \param p_mi media player
1303 * \param p_e an initialized exception pointer
1304 * \return the audio track (int)
1306 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *, libvlc_exception_t * );
1309 * Set current audio track.
1311 * \param p_mi media player
1312 * \param i_track the track (int)
1313 * \param p_e an initialized exception pointer
1315 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_player_t *, int, libvlc_exception_t * );
1318 * Get current audio channel.
1320 * \param p_instance vlc instance
1321 * \param p_e an initialized exception pointer
1322 * \return the audio channel \see libvlc_audio_output_channel_t
1325 libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
1328 * Set current audio channel.
1330 * \param p_instance vlc instance
1331 * \param channel the audio channel, \see libvlc_audio_output_channel_t
1332 * \param p_e an initialized exception pointer
1334 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *,
1336 libvlc_exception_t * );
1340 /** @} media_player */
1342 /*****************************************************************************
1344 *****************************************************************************/
1346 /** \defgroup libvlc_event libvlc_event
1347 * \ingroup libvlc_core
1353 * Register for an event notification.
1355 * \param p_event_manager the event manager to which you want to attach to.
1356 * Generally it is obtained by vlc_my_object_event_manager() where
1357 * my_object is the object you want to listen to.
1358 * \param i_event_type the desired event to which we want to listen
1359 * \param f_callback the function to call when i_event_type occurs
1360 * \param user_data user provided data to carry with the event
1361 * \param p_e an initialized exception pointer
1363 VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
1364 libvlc_event_type_t i_event_type,
1365 libvlc_callback_t f_callback,
1367 libvlc_exception_t *p_e );
1370 * Unregister an event notification.
1372 * \param p_event_manager the event manager
1373 * \param i_event_type the desired event to which we want to unregister
1374 * \param f_callback the function to call when i_event_type occurs
1375 * \param p_user_data user provided data to carry with the event
1376 * \param p_e an initialized exception pointer
1378 VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
1379 libvlc_event_type_t i_event_type,
1380 libvlc_callback_t f_callback,
1382 libvlc_exception_t *p_e );
1385 * Get an event's type name.
1387 * \param i_event_type the desired event
1389 VLC_PUBLIC_API const char * libvlc_event_type_name( libvlc_event_type_t event_type );
1393 /*****************************************************************************
1395 *****************************************************************************/
1396 /** \defgroup libvlc_media_library libvlc_media_library
1398 * LibVLC Media Library
1401 VLC_PUBLIC_API libvlc_media_library_t *
1402 libvlc_media_library_new( libvlc_instance_t * p_inst,
1403 libvlc_exception_t * p_e );
1406 * Release media library object. This functions decrements the
1407 * reference count of the media library object. If it reaches 0,
1408 * then the object will be released.
1410 * \param p_mlib media library object
1413 libvlc_media_library_release( libvlc_media_library_t * p_mlib );
1416 * Retain a reference to a media library object. This function will
1417 * increment the reference counting for this object. Use
1418 * libvlc_media_library_release() to decrement the reference count.
1420 * \param p_mlib media library object
1423 libvlc_media_library_retain( libvlc_media_library_t * p_mlib );
1426 * Load media library.
1428 * \param p_mlib media library object
1429 * \param p_e an initialized exception object.
1432 libvlc_media_library_load( libvlc_media_library_t * p_mlib,
1433 libvlc_exception_t * p_e );
1436 * Save media library.
1438 * \param p_mlib media library object
1439 * \param p_e an initialized exception object.
1442 libvlc_media_library_save( libvlc_media_library_t * p_mlib,
1443 libvlc_exception_t * p_e );
1446 * Get media library subitems.
1448 * \param p_mlib media library object
1449 * \param p_e an initialized exception object.
1450 * \return media list subitems
1452 VLC_PUBLIC_API libvlc_media_list_t *
1453 libvlc_media_library_media_list( libvlc_media_library_t * p_mlib,
1454 libvlc_exception_t * p_e );
1460 /*****************************************************************************
1461 * Services/Media Discovery
1462 *****************************************************************************/
1463 /** \defgroup libvlc_media_discoverer libvlc_media_discoverer
1465 * LibVLC Media Discoverer
1470 * Discover media service by name.
1472 * \param p_inst libvlc instance
1473 * \param psz_name service name
1474 * \param p_e an initialized exception object
1475 * \return media discover object
1477 VLC_PUBLIC_API libvlc_media_discoverer_t *
1478 libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
1479 const char * psz_name,
1480 libvlc_exception_t * p_e );
1483 * Release media discover object. If the reference count reaches 0, then
1484 * the object will be released.
1486 * \param p_mdis media service discover object
1488 VLC_PUBLIC_API void libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
1491 * Get media service discover object its localized name.
1493 * \param media discover object
1494 * \return localized name
1496 VLC_PUBLIC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
1499 * Get media service discover media list.
1501 * \param p_mdis media service discover object
1502 * \return list of media items
1504 VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis );
1507 * Get event manager from media service discover object.
1509 * \param p_mdis media service discover object
1510 * \return event manager object.
1512 VLC_PUBLIC_API libvlc_event_manager_t *
1513 libvlc_media_discoverer_event_manager( libvlc_media_discoverer_t * p_mdis );
1516 * Query if media service discover object is running.
1518 * \param p_mdis media service discover object
1519 * \return true if running, false if not
1522 libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis );
1527 /*****************************************************************************
1528 * Message log handling
1529 *****************************************************************************/
1531 /** \defgroup libvlc_log libvlc_log
1532 * \ingroup libvlc_core
1533 * LibVLC Message Logging
1538 * Return the VLC messaging verbosity level.
1540 * \param p_instance libvlc instance
1541 * \param p_e an initialized exception pointer
1542 * \return verbosity level for messages
1544 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
1545 libvlc_exception_t *p_e );
1548 * Set the VLC messaging verbosity level.
1550 * \param p_instance libvlc log instance
1551 * \param level log level
1552 * \param p_e an initialized exception pointer
1554 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
1555 libvlc_exception_t *p_e );
1558 * Open a VLC message log instance.
1560 * \param p_instance libvlc instance
1561 * \param p_e an initialized exception pointer
1562 * \return log message instance
1564 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( libvlc_instance_t *, libvlc_exception_t *);
1567 * Close a VLC message log instance.
1569 * \param p_log libvlc log instance
1570 * \param p_e an initialized exception pointer
1572 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
1575 * Returns the number of messages in a log instance.
1577 * \param p_log libvlc log instance
1578 * \param p_e an initialized exception pointer
1579 * \return number of log messages
1581 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
1584 * Clear a log instance.
1586 * All messages in the log are removed. The log should be cleared on a
1587 * regular basis to avoid clogging.
1589 * \param p_log libvlc log instance
1590 * \param p_e an initialized exception pointer
1592 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
1595 * Allocate and returns a new iterator to messages in log.
1597 * \param p_log libvlc log instance
1598 * \param p_e an initialized exception pointer
1599 * \return log iterator object
1601 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
1604 * Release a previoulsy allocated iterator.
1606 * \param p_iter libvlc log iterator
1607 * \param p_e an initialized exception pointer
1609 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1612 * Return whether log iterator has more messages.
1614 * \param p_iter libvlc log iterator
1615 * \param p_e an initialized exception pointer
1616 * \return true if iterator has more message objects, else false
1618 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1621 * Return the next log message.
1623 * The message contents must not be freed
1625 * \param p_iter libvlc log iterator
1626 * \param p_buffer log buffer
1627 * \param p_e an initialized exception pointer
1628 * \return log message object
1630 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
1631 libvlc_log_message_t *p_buffer,
1632 libvlc_exception_t *p_e );
1640 #endif /* <vlc/libvlc.h> */