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);
216 /*****************************************************************************
218 *****************************************************************************/
219 /** \defgroup libvlc_media libvlc_media
226 * Create a media with the given MRL.
228 * \param p_instance the instance
229 * \param psz_mrl the MRL to read
230 * \param p_e an initialized exception pointer
231 * \return the newly created media
233 VLC_PUBLIC_API libvlc_media_t * libvlc_media_new(
234 libvlc_instance_t *p_instance,
235 const char * psz_mrl,
236 libvlc_exception_t *p_e );
239 * Create a media as an empty node with the passed name.
241 * \param p_instance the instance
242 * \param psz_name the name of the node
243 * \param p_e an initialized exception pointer
244 * \return the new empty media
246 VLC_PUBLIC_API libvlc_media_t * libvlc_media_new_as_node(
247 libvlc_instance_t *p_instance,
248 const char * psz_name,
249 libvlc_exception_t *p_e );
252 * Add an option to the media.
254 * This option will be used to determine how the media_player will
255 * read the media. This allows to use VLC's advanced
256 * reading/streaming options on a per-media basis.
258 * The options are detailed in vlc --long-help, for instance "--sout-all"
260 * \param p_instance the instance
261 * \param ppsz_options the options (as a string)
262 * \param p_e an initialized exception pointer
264 VLC_PUBLIC_API void libvlc_media_add_option(
265 libvlc_media_t * p_md,
266 const char * ppsz_options,
267 libvlc_exception_t * p_e );
270 * Retain a reference to a media descriptor object (libvlc_media_t). Use
271 * libvlc_media_release() to decrement the reference count of a
272 * media descriptor object.
274 * \param p_meta_desc a media descriptor object.
276 VLC_PUBLIC_API void libvlc_media_retain(
277 libvlc_media_t *p_meta_desc );
280 * Decrement the reference count of a media descriptor object. If the
281 * reference count is 0, then libvlc_media_release() will release the
282 * media descriptor object. It will send out an libvlc_MediaFreed event
283 * to all listeners. If the media descriptor object has been released it
284 * should not be used again.
286 * \param p_meta_desc a media descriptor object.
288 VLC_PUBLIC_API void libvlc_media_release(
289 libvlc_media_t *p_meta_desc );
293 * Get the media resource locator (mrl) from a media descriptor object
295 * \param p_md a media descriptor object
296 * \param p_e an initialized exception object
297 * \return string with mrl of media descriptor object
299 VLC_PUBLIC_API char * libvlc_media_get_mrl( libvlc_media_t * p_md,
300 libvlc_exception_t * p_e );
303 * Duplicate a media descriptor object.
305 * \param p_meta_desc a media descriptor object.
307 VLC_PUBLIC_API libvlc_media_t * libvlc_media_duplicate( libvlc_media_t * );
310 * Read the meta of the media.
312 * \param p_meta_desc the media to read
313 * \param e_meta_desc the meta to read
314 * \param p_e an initialized exception pointer
315 * \return the media's meta
317 VLC_PUBLIC_API char * libvlc_media_get_meta(
318 libvlc_media_t *p_meta_desc,
319 libvlc_meta_t e_meta,
320 libvlc_exception_t *p_e );
322 * Get current state of media descriptor object. Possible media states
323 * are defined in libvlc_structures.c ( libvlc_NothingSpecial=0,
324 * libvlc_Opening, libvlc_Buffering, libvlc_Playing, libvlc_Paused,
325 * libvlc_Stopped, libvlc_Forward, libvlc_Backward, libvlc_Ended,
328 * @see libvlc_state_t
329 * \param p_meta_desc a media descriptor object
330 * \param p_e an initialized exception object
331 * \return state of media descriptor object
333 VLC_PUBLIC_API libvlc_state_t libvlc_media_get_state(
334 libvlc_media_t *p_meta_desc,
335 libvlc_exception_t *p_e );
338 * Get subitems of media descriptor object. This will increment
339 * the reference count of supplied media descriptor object. Use
340 * libvlc_media_list_release() to decrement the reference counting.
342 * \param p_md media descriptor object
343 * \param p_e initalized exception object
344 * \return list of media descriptor subitems or NULL
346 VLC_PUBLIC_API libvlc_media_list_t *
347 libvlc_media_subitems( libvlc_media_t *p_md,
348 libvlc_exception_t *p_e );
350 * Get event manager from media descriptor object.
351 * NOTE: this function doesn't increment reference counting.
353 * \param p_md a media descriptor object
354 * \param p_e an initialized exception object
355 * \return event manager object
357 VLC_PUBLIC_API libvlc_event_manager_t *
358 libvlc_media_event_manager( libvlc_media_t * p_md,
359 libvlc_exception_t * p_e );
362 * Get duration of media descriptor object item.
364 * \param p_md media descriptor object
365 * \param p_e an initialized exception object
366 * \return duration of media item
368 VLC_PUBLIC_API libvlc_time_t
369 libvlc_media_get_duration( libvlc_media_t * p_md,
370 libvlc_exception_t * p_e );
373 * Get preparsed status for media descriptor object.
375 * \param p_md media descriptor object
376 * \param p_e an initialized exception object
377 * \return true if media object has been preparsed otherwise it returns false
380 libvlc_media_is_preparsed( libvlc_media_t * p_md,
381 libvlc_exception_t * p_e );
384 * Sets media descriptor's user_data. user_data is specialized data
385 * accessed by the host application, VLC.framework uses it as a pointer to
386 * an native object that references a libvlc_media_t pointer
388 * \param p_md media descriptor object
389 * \param p_new_user_data pointer to user data
390 * \param p_e an initialized exception object
393 libvlc_media_set_user_data( libvlc_media_t * p_md,
394 void * p_new_user_data,
395 libvlc_exception_t * p_e);
398 * Get media descriptor's user_data. user_data is specialized data
399 * accessed by the host application, VLC.framework uses it as a pointer to
400 * an native object that references a libvlc_media_t pointer
402 * \param p_md media descriptor object
403 * \param p_e an initialized exception object
405 VLC_PUBLIC_API void *
406 libvlc_media_get_user_data( libvlc_media_t * p_md,
407 libvlc_exception_t * p_e);
411 /*****************************************************************************
413 *****************************************************************************/
414 /** \defgroup libvlc_media_player libvlc_media_player
416 * LibVLC Media Player, object that let you play a media
417 * in a libvlc_drawable_t
422 * Create an empty Media Player object
424 * \param p_libvlc_instance the libvlc instance in which the Media Player
426 * \param p_e an initialized exception pointer
428 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t *, libvlc_exception_t * );
431 * Create a Media Player object from a Media
433 * \param p_md the media. Afterwards the p_md can be safely
435 * \param p_e an initialized exception pointer
437 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new_from_media( libvlc_media_t *, libvlc_exception_t * );
440 * Release a media_player after use
441 * Decrement the reference count of a media player object. If the
442 * reference count is 0, then libvlc_media_player_release() will
443 * release the media player object. If the media player object
444 * has been released, then it should not be used again.
446 * \param p_mi the Media Player to free
448 VLC_PUBLIC_API void libvlc_media_player_release( libvlc_media_player_t * );
451 * Retain a reference to a media player object. Use
452 * libvlc_media_player_release() to decrement reference count.
454 * \param p_mi media player object
456 VLC_PUBLIC_API void libvlc_media_player_retain( libvlc_media_player_t * );
459 * Set the media that will be used by the media_player. If any,
460 * previous md will be released.
462 * \param p_mi the Media Player
463 * \param p_md the Media. Afterwards the p_md can be safely
465 * \param p_e an initialized exception pointer
467 VLC_PUBLIC_API void libvlc_media_player_set_media( libvlc_media_player_t *, libvlc_media_t *, libvlc_exception_t * );
470 * Get the media used by the media_player.
472 * \param p_mi the Media Player
473 * \param p_e an initialized exception pointer
474 * \return the media associated with p_mi, or NULL if no
475 * media is associated
477 VLC_PUBLIC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t *, libvlc_exception_t * );
480 * Get the Event Manager from which the media player send event.
482 * \param p_mi the Media Player
483 * \param p_e an initialized exception pointer
484 * \return the event manager associated with p_mi
486 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *, libvlc_exception_t * );
491 * \param p_mi the Media Player
492 * \param p_e an initialized exception pointer
494 VLC_PUBLIC_API void libvlc_media_player_play ( libvlc_media_player_t *, libvlc_exception_t * );
499 * \param p_mi the Media Player
500 * \param p_e an initialized exception pointer
502 VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *, libvlc_exception_t * );
507 * \param p_mi the Media Player
508 * \param p_e an initialized exception pointer
510 VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *, libvlc_exception_t * );
513 * Set the drawable where the media player should render its video output
515 * \param p_mi the Media Player
516 * \param drawable the libvlc_drawable_t where the media player
517 * should render its video
518 * \param p_e an initialized exception pointer
520 VLC_PUBLIC_API void libvlc_media_player_set_drawable ( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
523 * Get the drawable where the media player should render its video output
525 * \param p_mi the Media Player
526 * \param p_e an initialized exception pointer
527 * \return the libvlc_drawable_t where the media player
528 * should render its video
530 VLC_PUBLIC_API libvlc_drawable_t
531 libvlc_media_player_get_drawable ( libvlc_media_player_t *, libvlc_exception_t * );
533 /** \bug This might go away ... to be replaced by a broader system */
536 * Get the current movie length (in ms).
538 * \param p_mi the Media Player
539 * \param p_e an initialized exception pointer
540 * \return the movie length (in ms).
542 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_length( libvlc_media_player_t *, libvlc_exception_t *);
545 * Get the current movie time (in ms).
547 * \param p_mi the Media Player
548 * \param p_e an initialized exception pointer
549 * \return the movie time (in ms).
551 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_time( libvlc_media_player_t *, libvlc_exception_t *);
554 * Set the movie time (in ms).
556 * \param p_mi the Media Player
557 * \param the movie time (in ms).
558 * \param p_e an initialized exception pointer
560 VLC_PUBLIC_API void libvlc_media_player_set_time( libvlc_media_player_t *, libvlc_time_t, libvlc_exception_t *);
563 * Get movie position.
565 * \param p_mi the Media Player
566 * \param p_e an initialized exception pointer
567 * \return movie position
569 VLC_PUBLIC_API float libvlc_media_player_get_position( libvlc_media_player_t *, libvlc_exception_t *);
572 * Set movie position.
574 * \param p_mi the Media Player
575 * \param p_e an initialized exception pointer
576 * \return movie position
578 VLC_PUBLIC_API void libvlc_media_player_set_position( libvlc_media_player_t *, float, libvlc_exception_t *);
583 * \param p_mi the Media Player
584 * \param i_chapter chapter number to play
585 * \param p_e an initialized exception pointer
587 VLC_PUBLIC_API void libvlc_media_player_set_chapter( libvlc_media_player_t *, int, libvlc_exception_t *);
592 * \param p_mi the Media Player
593 * \param p_e an initialized exception pointer
594 * \return chapter number currently playing
596 VLC_PUBLIC_API int libvlc_media_player_get_chapter( libvlc_media_player_t *, libvlc_exception_t * );
599 * Get movie chapter count
601 * \param p_mi the Media Player
602 * \param p_e an initialized exception pointer
603 * \return number of chapters in movie
605 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count( libvlc_media_player_t *, libvlc_exception_t *);
606 VLC_PUBLIC_API int libvlc_media_player_will_play ( libvlc_media_player_t *, libvlc_exception_t *);
609 * Get title chapter count
611 * \param p_mi the Media Player
612 * \param i_title title
613 * \param p_e an initialized exception pointer
614 * \return number of chapters in title
616 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count_for_title(
617 libvlc_media_player_t *, int, libvlc_exception_t *);
622 * \param p_mi the Media Player
623 * \param i_title title number to play
624 * \param p_e an initialized exception pointer
626 VLC_PUBLIC_API void libvlc_media_player_set_title( libvlc_media_player_t *, int, libvlc_exception_t *);
631 * \param p_mi the Media Player
632 * \param p_e an initialized exception pointer
633 * \return title number currently playing
635 VLC_PUBLIC_API int libvlc_media_player_get_title( libvlc_media_player_t *, libvlc_exception_t *);
638 * Get movie title count
640 * \param p_mi the Media Player
641 * \param p_e an initialized exception pointer
642 * \return title number count
644 VLC_PUBLIC_API int libvlc_media_player_get_title_count( libvlc_media_player_t *, libvlc_exception_t *);
647 * Set previous chapter
649 * \param p_mi the Media Player
650 * \param p_e an initialized exception pointer
652 VLC_PUBLIC_API void libvlc_media_player_previous_chapter( libvlc_media_player_t *, libvlc_exception_t *);
657 * \param p_mi the Media Player
658 * \param p_e an initialized exception pointer
660 VLC_PUBLIC_API void libvlc_media_player_next_chapter( libvlc_media_player_t *, libvlc_exception_t *);
663 * Get movie play rate
665 * \param p_mi the Media Player
666 * \param p_e an initialized exception pointer
667 * \return movie play rate
669 VLC_PUBLIC_API float libvlc_media_player_get_rate( libvlc_media_player_t *, libvlc_exception_t *);
672 * Set movie play rate
674 * \param p_mi the Media Player
675 * \param movie play rate to set
676 * \param p_e an initialized exception pointer
678 VLC_PUBLIC_API void libvlc_media_player_set_rate( libvlc_media_player_t *, float, libvlc_exception_t *);
681 * Get current movie state
683 * \param p_mi the Media Player
684 * \param p_e an initialized exception pointer
685 * \return current movie state as libvlc_state_t
687 VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *, libvlc_exception_t *);
692 * \param p_mi the Media Player
693 * \param p_e an initialized exception pointer
694 * \return frames per second (fps) for this playing movie
696 VLC_PUBLIC_API float libvlc_media_player_get_fps( libvlc_media_player_t *, libvlc_exception_t *);
701 * Does this media player have a video output?
703 * \param p_md the media player
704 * \param p_e an initialized exception pointer
706 VLC_PUBLIC_API int libvlc_media_player_has_vout( libvlc_media_player_t *, libvlc_exception_t *);
709 * Is this media player seekable?
711 * \param p_input the input
712 * \param p_e an initialized exception pointer
714 VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
717 * Can this media player be paused?
719 * \param p_input the input
720 * \param p_e an initialized exception pointer
722 VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
724 /** \defgroup libvlc_video libvlc_video
725 * \ingroup libvlc_media_player
726 * LibVLC Video handling
731 * Toggle fullscreen status on video output.
733 * \param p_mediaplayer the media player
734 * \param p_e an initialized exception pointer
736 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
739 * Enable or disable fullscreen on a video output.
741 * \param p_mediaplayer the media player
742 * \param b_fullscreen boolean for fullscreen status
743 * \param p_e an initialized exception pointer
745 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *, int, libvlc_exception_t * );
748 * Get current fullscreen status.
750 * \param p_mediaplayer the media player
751 * \param p_e an initialized exception pointer
752 * \return the fullscreen status (boolean)
754 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
757 * Get current video height.
759 * \param p_mediaplayer the media player
760 * \param p_e an initialized exception pointer
761 * \return the video height
763 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_player_t *, libvlc_exception_t * );
766 * Get current video width.
768 * \param p_mediaplayer the media player
769 * \param p_e an initialized exception pointer
770 * \return the video width
772 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_player_t *, libvlc_exception_t * );
775 * Get current video aspect ratio.
777 * \param p_mediaplayer the media player
778 * \param p_e an initialized exception pointer
779 * \return the video aspect ratio
781 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *, libvlc_exception_t * );
784 * Set new video aspect ratio.
786 * \param p_mediaplayer the media player
787 * \param psz_aspect new video aspect-ratio
788 * \param p_e an initialized exception pointer
790 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *, char *, libvlc_exception_t * );
793 * Get current video subtitle.
795 * \param p_mediaplayer the media player
796 * \param p_e an initialized exception pointer
797 * \return the video subtitle selected
799 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *, libvlc_exception_t * );
802 * Set new video subtitle.
804 * \param p_mediaplayer the media player
805 * \param i_spu new video subtitle to select
806 * \param p_e an initialized exception pointer
808 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_player_t *, int , libvlc_exception_t * );
811 * Set new video subtitle file.
813 * \param p_mediaplayer the media player
814 * \param psz_subtitle new video subtitle file
815 * \param p_e an initialized exception pointer
816 * \return the success status (boolean)
818 VLC_PUBLIC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *, char *, libvlc_exception_t * );
821 * Get current crop filter geometry.
823 * \param p_mediaplayer the media player
824 * \param p_e an initialized exception pointer
825 * \return the crop filter geometry
827 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *, libvlc_exception_t * );
830 * Set new crop filter geometry.
832 * \param p_mediaplayer the media player
833 * \param psz_geometry new crop filter geometry
834 * \param p_e an initialized exception pointer
836 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_player_t *, char *, libvlc_exception_t * );
839 * Toggle teletext transparent status on video output.
841 * \param p_mediaplayer the media player
842 * \param p_e an initialized exception pointer
844 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *, libvlc_exception_t * );
847 * Get current teletext page requested.
849 * \param p_mediaplayer the media player
850 * \param p_e an initialized exception pointer
851 * \return the current teletext page requested.
853 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t *, libvlc_exception_t * );
856 * Set new teletext page to retrieve.
858 * \param p_mediaplayer the media player
859 * \param i_page teletex page number requested
860 * \param p_e an initialized exception pointer
862 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *, int, libvlc_exception_t * );
865 * Take a snapshot of the current video window.
867 * If i_width AND i_height is 0, original size is used.
868 * If i_width XOR i_height is 0, original aspect-ratio is preserved.
870 * \param p_mediaplayer the media player
871 * \param psz_filepath the path where to save the screenshot to
872 * \param i_width the snapshot's width
873 * \param i_height the snapshot's height
874 * \param p_e an initialized exception pointer
876 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_player_t *, char *,unsigned int, unsigned int, libvlc_exception_t * );
879 * Resize the current video output window.
881 * \param p_instance libvlc instance
882 * \param width new width for video output window
883 * \param height new height for video output window
884 * \param p_e an initialized exception pointer
885 * \return the success status (boolean)
887 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_player_t *, int, int, libvlc_exception_t *);
890 * Change the parent for the current the video output.
892 * \param p_instance libvlc instance
893 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
894 * \param p_e an initialized exception pointer
895 * \return the success status (boolean)
897 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
900 * Tell windowless video output to redraw rectangular area (MacOS X only).
902 * \param p_instance libvlc instance
903 * \param area coordinates within video drawable
904 * \param p_e an initialized exception pointer
906 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_player_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
909 * Set the default video output size.
911 * This setting will be used as default for all video outputs.
913 * \param p_instance libvlc instance
914 * \param width new width for video drawable
915 * \param height new height for video drawable
916 * \param p_e an initialized exception pointer
918 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
921 * Set the default video output viewport for a windowless video output
924 * This setting will be used as default for all video outputs.
926 * \param p_instance libvlc instance
927 * \param view coordinates within video drawable
928 * \param clip coordinates within video drawable
929 * \param p_e an initialized exception pointer
931 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
935 /** \defgroup libvlc_audio libvlc_audio
936 * \ingroup libvlc_media_player
937 * LibVLC Audio handling
942 * Toggle mute status.
944 * \param p_instance libvlc instance
945 * \param p_e an initialized exception pointer
947 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
950 * Get current mute status.
952 * \param p_instance libvlc instance
953 * \param p_e an initialized exception pointer
954 * \return the mute status (boolean)
956 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
961 * \param p_instance libvlc instance
962 * \param status If status is true then mute, otherwise unmute
963 * \param p_e an initialized exception pointer
965 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, int , libvlc_exception_t * );
968 * Get current audio level.
970 * \param p_instance libvlc instance
971 * \param p_e an initialized exception pointer
972 * \return the audio level (int)
974 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
977 * Set current audio level.
979 * \param p_instance libvlc instance
980 * \param i_volume the volume (int)
981 * \param p_e an initialized exception pointer
983 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
986 * Get number of available audio tracks.
988 * \param p_mi media player
989 * \param p_e an initialized exception
990 * \return the number of available audio tracks (int)
992 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *, libvlc_exception_t * );
995 * Get current audio track.
997 * \param p_mi media player
998 * \param p_e an initialized exception pointer
999 * \return the audio track (int)
1001 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *, libvlc_exception_t * );
1004 * Set current audio track.
1006 * \param p_mi media player
1007 * \param i_track the track (int)
1008 * \param p_e an initialized exception pointer
1010 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_player_t *, int, libvlc_exception_t * );
1013 * Get current audio channel.
1015 * \param p_instance vlc instance
1016 * \param p_e an initialized exception pointer
1017 * \return the audio channel (int)
1019 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
1022 * Set current audio channel.
1024 * \param p_instance vlc instance
1025 * \param i_channel the audio channel (int)
1026 * \param p_e an initialized exception pointer
1028 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
1032 /** @} media_player */
1034 /*****************************************************************************
1036 *****************************************************************************/
1038 /** \defgroup libvlc_event libvlc_event
1039 * \ingroup libvlc_core
1045 * Register for an event notification.
1047 * \param p_event_manager the event manager to which you want to attach to.
1048 * Generally it is obtained by vlc_my_object_event_manager() where
1049 * my_object is the object you want to listen to.
1050 * \param i_event_type the desired event to which we want to listen
1051 * \param f_callback the function to call when i_event_type occurs
1052 * \param user_data user provided data to carry with the event
1053 * \param p_e an initialized exception pointer
1055 VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
1056 libvlc_event_type_t i_event_type,
1057 libvlc_callback_t f_callback,
1059 libvlc_exception_t *p_e );
1062 * Unregister an event notification.
1064 * \param p_event_manager the event manager
1065 * \param i_event_type the desired event to which we want to unregister
1066 * \param f_callback the function to call when i_event_type occurs
1067 * \param p_user_data user provided data to carry with the event
1068 * \param p_e an initialized exception pointer
1070 VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
1071 libvlc_event_type_t i_event_type,
1072 libvlc_callback_t f_callback,
1074 libvlc_exception_t *p_e );
1077 * Get an event's type name.
1079 * \param i_event_type the desired event
1081 VLC_PUBLIC_API const char * libvlc_event_type_name( libvlc_event_type_t event_type );
1085 /*****************************************************************************
1087 *****************************************************************************/
1088 /** \defgroup libvlc_media_library libvlc_media_library
1090 * LibVLC Media Library
1093 VLC_PUBLIC_API libvlc_media_library_t *
1094 libvlc_media_library_new( libvlc_instance_t * p_inst,
1095 libvlc_exception_t * p_e );
1098 * Release media library object. This functions decrements the
1099 * reference count of the media library object. If it reaches 0,
1100 * then the object will be released.
1102 * \param p_mlib media library object
1105 libvlc_media_library_release( libvlc_media_library_t * p_mlib );
1108 * Retain a reference to a media library object. This function will
1109 * increment the reference counting for this object. Use
1110 * libvlc_media_library_release() to decrement the reference count.
1112 * \param p_mlib media library object
1115 libvlc_media_library_retain( libvlc_media_library_t * p_mlib );
1118 * Load media library.
1120 * \param p_mlib media library object
1121 * \param p_e an initialized exception object.
1124 libvlc_media_library_load( libvlc_media_library_t * p_mlib,
1125 libvlc_exception_t * p_e );
1128 * Save media library.
1130 * \param p_mlib media library object
1131 * \param p_e an initialized exception object.
1134 libvlc_media_library_save( libvlc_media_library_t * p_mlib,
1135 libvlc_exception_t * p_e );
1138 * Get media library subitems.
1140 * \param p_mlib media library object
1141 * \param p_e an initialized exception object.
1142 * \return media list subitems
1144 VLC_PUBLIC_API libvlc_media_list_t *
1145 libvlc_media_library_media_list( libvlc_media_library_t * p_mlib,
1146 libvlc_exception_t * p_e );
1152 /*****************************************************************************
1153 * Services/Media Discovery
1154 *****************************************************************************/
1155 /** \defgroup libvlc_media_discoverer libvlc_media_discoverer
1157 * LibVLC Media Discoverer
1162 * Discover media service by name.
1164 * \param p_inst libvlc instance
1165 * \param psz_name service name
1166 * \param p_e an initialized exception object
1167 * \return media discover object
1169 VLC_PUBLIC_API libvlc_media_discoverer_t *
1170 libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
1171 const char * psz_name,
1172 libvlc_exception_t * p_e );
1175 * Release media discover object. If the reference count reaches 0, then
1176 * the object will be released.
1178 * \param p_mdis media service discover object
1180 VLC_PUBLIC_API void libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
1183 * Get media service discover object its localized name.
1185 * \param media discover object
1186 * \return localized name
1188 VLC_PUBLIC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
1191 * Get media service discover media list.
1193 * \param p_mdis media service discover object
1194 * \return list of media items
1196 VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis );
1199 * Get event manager from media service discover object.
1201 * \param p_mdis media service discover object
1202 * \return event manager object.
1204 VLC_PUBLIC_API libvlc_event_manager_t *
1205 libvlc_media_discoverer_event_manager( libvlc_media_discoverer_t * p_mdis );
1208 * Query if media service discover object is running.
1210 * \param p_mdis media service discover object
1211 * \return true if running, false if not
1214 libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis );
1219 /*****************************************************************************
1220 * Message log handling
1221 *****************************************************************************/
1223 /** \defgroup libvlc_log libvlc_log
1224 * \ingroup libvlc_core
1225 * LibVLC Message Logging
1230 * Return the VLC messaging verbosity level.
1232 * \param p_instance libvlc instance
1233 * \param p_e an initialized exception pointer
1234 * \return verbosity level for messages
1236 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
1237 libvlc_exception_t *p_e );
1240 * Set the VLC messaging verbosity level.
1242 * \param p_instance libvlc log instance
1243 * \param level log level
1244 * \param p_e an initialized exception pointer
1246 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
1247 libvlc_exception_t *p_e );
1250 * Open a VLC message log instance.
1252 * \param p_instance libvlc instance
1253 * \param p_e an initialized exception pointer
1254 * \return log message instance
1256 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( libvlc_instance_t *, libvlc_exception_t *);
1259 * Close a VLC message log instance.
1261 * \param p_log libvlc log instance
1262 * \param p_e an initialized exception pointer
1264 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
1267 * Returns the number of messages in a log instance.
1269 * \param p_log libvlc log instance
1270 * \param p_e an initialized exception pointer
1271 * \return number of log messages
1273 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
1276 * Clear a log instance.
1278 * All messages in the log are removed. The log should be cleared on a
1279 * regular basis to avoid clogging.
1281 * \param p_log libvlc log instance
1282 * \param p_e an initialized exception pointer
1284 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
1287 * Allocate and returns a new iterator to messages in log.
1289 * \param p_log libvlc log instance
1290 * \param p_e an initialized exception pointer
1291 * \return log iterator object
1293 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
1296 * Release a previoulsy allocated iterator.
1298 * \param p_iter libvlc log iterator
1299 * \param p_e an initialized exception pointer
1301 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1304 * Return whether log iterator has more messages.
1306 * \param p_iter libvlc log iterator
1307 * \param p_e an initialized exception pointer
1308 * \return true if iterator has more message objects, else false
1310 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1313 * Return the next log message.
1315 * The message contents must not be freed
1317 * \param p_iter libvlc log iterator
1318 * \param p_buffer log buffer
1319 * \param p_e an initialized exception pointer
1320 * \return log message object
1322 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
1323 libvlc_log_message_t *p_buffer,
1324 libvlc_exception_t *p_e );
1332 #endif /* <vlc/libvlc.h> */