1 /*****************************************************************************
2 * libvlc_media_player.h: libvlc_media_player external API
3 *****************************************************************************
4 * Copyright (C) 1998-2010 VLC authors and VideoLAN
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 it
12 * under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with this program; if not, write to the Free Software Foundation,
23 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24 *****************************************************************************/
28 * This file defines libvlc_media_player external API
31 #ifndef VLC_LIBVLC_MEDIA_PLAYER_H
32 #define VLC_LIBVLC_MEDIA_PLAYER_H 1
40 /*****************************************************************************
42 *****************************************************************************/
43 /** \defgroup libvlc_media_player LibVLC media player
45 * A LibVLC media player plays one media (usually in a custom drawable).
49 typedef struct libvlc_media_player_t libvlc_media_player_t;
52 * Description for video, audio tracks and subtitles. It contains
53 * id, name (description string) and pointer to next record.
55 typedef struct libvlc_track_description_t
59 struct libvlc_track_description_t *p_next;
61 } libvlc_track_description_t;
64 * Description for audio output. It contains
65 * name, description and pointer to next record.
67 typedef struct libvlc_audio_output_t
70 char *psz_description;
71 struct libvlc_audio_output_t *p_next;
73 } libvlc_audio_output_t;
76 * Description for audio output device.
78 typedef struct libvlc_audio_output_device_t
80 struct libvlc_audio_output_device_t *p_next; /**< Next entry in list */
81 char *psz_device; /**< Device identifier string */
82 char *psz_description; /**< User-friendly device description */
83 /* More fields may be added here in later versions */
84 } libvlc_audio_output_device_t;
87 * Rectangle type for video geometry
89 typedef struct libvlc_rectangle_t
96 * Marq options definition
98 typedef enum libvlc_video_marquee_option_t {
99 libvlc_marquee_Enable = 0,
100 libvlc_marquee_Text, /** string argument */
101 libvlc_marquee_Color,
102 libvlc_marquee_Opacity,
103 libvlc_marquee_Position,
104 libvlc_marquee_Refresh,
106 libvlc_marquee_Timeout,
109 } libvlc_video_marquee_option_t;
114 typedef enum libvlc_navigate_mode_t
116 libvlc_navigate_activate = 0,
118 libvlc_navigate_down,
119 libvlc_navigate_left,
120 libvlc_navigate_right
121 } libvlc_navigate_mode_t;
124 * Create an empty Media Player object
126 * \param p_libvlc_instance the libvlc instance in which the Media Player
128 * \return a new media player object, or NULL on error.
130 LIBVLC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t *p_libvlc_instance );
133 * Create a Media Player object from a Media
135 * \param p_md the media. Afterwards the p_md can be safely
137 * \return a new media player object, or NULL on error.
139 LIBVLC_API libvlc_media_player_t * libvlc_media_player_new_from_media( libvlc_media_t *p_md );
142 * Release a media_player after use
143 * Decrement the reference count of a media player object. If the
144 * reference count is 0, then libvlc_media_player_release() will
145 * release the media player object. If the media player object
146 * has been released, then it should not be used again.
148 * \param p_mi the Media Player to free
150 LIBVLC_API void libvlc_media_player_release( libvlc_media_player_t *p_mi );
153 * Retain a reference to a media player object. Use
154 * libvlc_media_player_release() to decrement reference count.
156 * \param p_mi media player object
158 LIBVLC_API void libvlc_media_player_retain( libvlc_media_player_t *p_mi );
161 * Set the media that will be used by the media_player. If any,
162 * previous md will be released.
164 * \param p_mi the Media Player
165 * \param p_md the Media. Afterwards the p_md can be safely
168 LIBVLC_API void libvlc_media_player_set_media( libvlc_media_player_t *p_mi,
169 libvlc_media_t *p_md );
172 * Get the media used by the media_player.
174 * \param p_mi the Media Player
175 * \return the media associated with p_mi, or NULL if no
176 * media is associated
178 LIBVLC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t *p_mi );
181 * Get the Event Manager from which the media player send event.
183 * \param p_mi the Media Player
184 * \return the event manager associated with p_mi
186 LIBVLC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *p_mi );
191 * \param p_mi the Media Player
192 * \return 1 if the media player is playing, 0 otherwise
194 * \libvlc_return_bool
196 LIBVLC_API int libvlc_media_player_is_playing ( libvlc_media_player_t *p_mi );
201 * \param p_mi the Media Player
202 * \return 0 if playback started (and was already started), or -1 on error.
204 LIBVLC_API int libvlc_media_player_play ( libvlc_media_player_t *p_mi );
207 * Pause or resume (no effect if there is no media)
209 * \param mp the Media Player
210 * \param do_pause play/resume if zero, pause if non-zero
211 * \version LibVLC 1.1.1 or later
213 LIBVLC_API void libvlc_media_player_set_pause ( libvlc_media_player_t *mp,
217 * Toggle pause (no effect if there is no media)
219 * \param p_mi the Media Player
221 LIBVLC_API void libvlc_media_player_pause ( libvlc_media_player_t *p_mi );
224 * Stop (no effect if there is no media)
226 * \param p_mi the Media Player
228 LIBVLC_API void libvlc_media_player_stop ( libvlc_media_player_t *p_mi );
231 * Callback prototype to allocate and lock a picture buffer.
233 * Whenever a new video frame needs to be decoded, the lock callback is
234 * invoked. Depending on the video chroma, one or three pixel planes of
235 * adequate dimensions must be returned via the second parameter. Those
236 * planes must be aligned on 32-bytes boundaries.
238 * \param opaque private pointer as passed to libvlc_video_set_callbacks() [IN]
239 * \param planes start address of the pixel planes (LibVLC allocates the array
240 * of void pointers, this callback must initialize the array) [OUT]
241 * \return a private pointer for the display and unlock callbacks to identify
242 * the picture buffers
244 typedef void *(*libvlc_video_lock_cb)(void *opaque, void **planes);
247 * Callback prototype to unlock a picture buffer.
249 * When the video frame decoding is complete, the unlock callback is invoked.
250 * This callback might not be needed at all. It is only an indication that the
251 * application can now read the pixel values if it needs to.
253 * \warning A picture buffer is unlocked after the picture is decoded,
254 * but before the picture is displayed.
256 * \param opaque private pointer as passed to libvlc_video_set_callbacks() [IN]
257 * \param picture private pointer returned from the @ref libvlc_video_lock_cb
259 * \param planes pixel planes as defined by the @ref libvlc_video_lock_cb
260 * callback (this parameter is only for convenience) [IN]
262 typedef void (*libvlc_video_unlock_cb)(void *opaque, void *picture,
263 void *const *planes);
266 * Callback prototype to display a picture.
268 * When the video frame needs to be shown, as determined by the media playback
269 * clock, the display callback is invoked.
271 * \param opaque private pointer as passed to libvlc_video_set_callbacks() [IN]
272 * \param picture private pointer returned from the @ref libvlc_video_lock_cb
275 typedef void (*libvlc_video_display_cb)(void *opaque, void *picture);
278 * Callback prototype to configure picture buffers format.
279 * This callback gets the format of the video as output by the video decoder
280 * and the chain of video filters (if any). It can opt to change any parameter
281 * as it needs. In that case, LibVLC will attempt to convert the video format
282 * (rescaling and chroma conversion) but these operations can be CPU intensive.
284 * \param opaque pointer to the private pointer passed to
285 * libvlc_video_set_callbacks() [IN/OUT]
286 * \param chroma pointer to the 4 bytes video format identifier [IN/OUT]
287 * \param width pointer to the pixel width [IN/OUT]
288 * \param height pointer to the pixel height [IN/OUT]
289 * \param pitches table of scanline pitches in bytes for each pixel plane
290 * (the table is allocated by LibVLC) [OUT]
291 * \param lines table of scanlines count for each plane [OUT]
292 * \return the number of picture buffers allocated, 0 indicates failure
295 * For each pixels plane, the scanline pitch must be bigger than or equal to
296 * the number of bytes per pixel multiplied by the pixel width.
297 * Similarly, the number of scanlines must be bigger than of equal to
299 * Furthermore, we recommend that pitches and lines be multiple of 32
300 * to not break assumption that might be made by various optimizations
301 * in the video decoders, video filters and/or video converters.
303 typedef unsigned (*libvlc_video_format_cb)(void **opaque, char *chroma,
304 unsigned *width, unsigned *height,
309 * Callback prototype to configure picture buffers format.
311 * \param opaque private pointer as passed to libvlc_video_set_callbacks()
312 * (and possibly modified by @ref libvlc_video_format_cb) [IN]
314 typedef void (*libvlc_video_cleanup_cb)(void *opaque);
318 * Set callbacks and private data to render decoded video to a custom area
320 * Use libvlc_video_set_format() or libvlc_video_set_format_callbacks()
321 * to configure the decoded format.
323 * \param mp the media player
324 * \param lock callback to lock video memory (must not be NULL)
325 * \param unlock callback to unlock video memory (or NULL if not needed)
326 * \param display callback to display video (or NULL if not needed)
327 * \param opaque private pointer for the three callbacks (as first parameter)
328 * \version LibVLC 1.1.1 or later
331 void libvlc_video_set_callbacks( libvlc_media_player_t *mp,
332 libvlc_video_lock_cb lock,
333 libvlc_video_unlock_cb unlock,
334 libvlc_video_display_cb display,
338 * Set decoded video chroma and dimensions.
339 * This only works in combination with libvlc_video_set_callbacks(),
340 * and is mutually exclusive with libvlc_video_set_format_callbacks().
342 * \param mp the media player
343 * \param chroma a four-characters string identifying the chroma
344 * (e.g. "RV32" or "YUYV")
345 * \param width pixel width
346 * \param height pixel height
347 * \param pitch line pitch (in bytes)
348 * \version LibVLC 1.1.1 or later
349 * \bug All pixel planes are expected to have the same pitch.
350 * To use the YCbCr color space with chrominance subsampling,
351 * consider using libvlc_video_set_format_callbacks() instead.
354 void libvlc_video_set_format( libvlc_media_player_t *mp, const char *chroma,
355 unsigned width, unsigned height,
359 * Set decoded video chroma and dimensions. This only works in combination with
360 * libvlc_video_set_callbacks().
362 * \param mp the media player
363 * \param setup callback to select the video format (cannot be NULL)
364 * \param cleanup callback to release any allocated resources (or NULL)
365 * \version LibVLC 2.0.0 or later
368 void libvlc_video_set_format_callbacks( libvlc_media_player_t *mp,
369 libvlc_video_format_cb setup,
370 libvlc_video_cleanup_cb cleanup );
373 * Set the NSView handler where the media player should render its video output.
375 * Use the vout called "macosx".
377 * The drawable is an NSObject that follow the VLCOpenGLVideoViewEmbedding
381 * \@protocol VLCOpenGLVideoViewEmbedding <NSObject>
382 * - (void)addVoutSubview:(NSView *)view;
383 * - (void)removeVoutSubview:(NSView *)view;
387 * Or it can be an NSView object.
389 * If you want to use it along with Qt4 see the QMacCocoaViewContainer. Then
390 * the following code should work:
393 * NSView *video = [[NSView alloc] init];
394 * QMacCocoaViewContainer *container = new QMacCocoaViewContainer(video, parent);
395 * libvlc_media_player_set_nsobject(mp, video);
400 * You can find a live example in VLCVideoView in VLCKit.framework.
402 * \param p_mi the Media Player
403 * \param drawable the drawable that is either an NSView or an object following
404 * the VLCOpenGLVideoViewEmbedding protocol.
406 LIBVLC_API void libvlc_media_player_set_nsobject ( libvlc_media_player_t *p_mi, void * drawable );
409 * Get the NSView handler previously set with libvlc_media_player_set_nsobject().
411 * \param p_mi the Media Player
412 * \return the NSView handler or 0 if none where set
414 LIBVLC_API void * libvlc_media_player_get_nsobject ( libvlc_media_player_t *p_mi );
417 * Set the agl handler where the media player should render its video output.
419 * \param p_mi the Media Player
420 * \param drawable the agl handler
422 LIBVLC_API void libvlc_media_player_set_agl ( libvlc_media_player_t *p_mi, uint32_t drawable );
425 * Get the agl handler previously set with libvlc_media_player_set_agl().
427 * \param p_mi the Media Player
428 * \return the agl handler or 0 if none where set
430 LIBVLC_API uint32_t libvlc_media_player_get_agl ( libvlc_media_player_t *p_mi );
433 * Set an X Window System drawable where the media player should render its
434 * video output. If LibVLC was built without X11 output support, then this has
437 * The specified identifier must correspond to an existing Input/Output class
438 * X11 window. Pixmaps are <b>not</b> supported. The caller shall ensure that
439 * the X11 server is the same as the one the VLC instance has been configured
440 * with. This function must be called before video playback is started;
441 * otherwise it will only take effect after playback stop and restart.
443 * \param p_mi the Media Player
444 * \param drawable the ID of the X window
446 LIBVLC_API void libvlc_media_player_set_xwindow ( libvlc_media_player_t *p_mi, uint32_t drawable );
449 * Get the X Window System window identifier previously set with
450 * libvlc_media_player_set_xwindow(). Note that this will return the identifier
451 * even if VLC is not currently using it (for instance if it is playing an
454 * \param p_mi the Media Player
455 * \return an X window ID, or 0 if none where set.
457 LIBVLC_API uint32_t libvlc_media_player_get_xwindow ( libvlc_media_player_t *p_mi );
460 * Set a Win32/Win64 API window handle (HWND) where the media player should
461 * render its video output. If LibVLC was built without Win32/Win64 API output
462 * support, then this has no effects.
464 * \param p_mi the Media Player
465 * \param drawable windows handle of the drawable
467 LIBVLC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi, void *drawable );
470 * Get the Windows API window handle (HWND) previously set with
471 * libvlc_media_player_set_hwnd(). The handle will be returned even if LibVLC
472 * is not currently outputting any video to it.
474 * \param p_mi the Media Player
475 * \return a window handle or NULL if there are none.
477 LIBVLC_API void *libvlc_media_player_get_hwnd ( libvlc_media_player_t *p_mi );
480 * Callback prototype for audio playback.
481 * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
482 * \param samples pointer to the first audio sample to play back [IN]
483 * \param count number of audio samples to play back
484 * \param pts expected play time stamp (see libvlc_delay())
486 typedef void (*libvlc_audio_play_cb)(void *data, const void *samples,
487 unsigned count, int64_t pts);
490 * Callback prototype for audio pause.
491 * \note The pause callback is never called if the audio is already paused.
492 * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
493 * \param pts time stamp of the pause request (should be elapsed already)
495 typedef void (*libvlc_audio_pause_cb)(void *data, int64_t pts);
498 * Callback prototype for audio resumption (i.e. restart from pause).
499 * \note The resume callback is never called if the audio is not paused.
500 * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
501 * \param pts time stamp of the resumption request (should be elapsed already)
503 typedef void (*libvlc_audio_resume_cb)(void *data, int64_t pts);
506 * Callback prototype for audio buffer flush
507 * (i.e. discard all pending buffers and stop playback as soon as possible).
508 * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
510 typedef void (*libvlc_audio_flush_cb)(void *data, int64_t pts);
513 * Callback prototype for audio buffer drain
514 * (i.e. wait for pending buffers to be played).
515 * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
517 typedef void (*libvlc_audio_drain_cb)(void *data);
520 * Callback prototype for audio volume change.
521 * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
522 * \param volume software volume (1. = nominal, 0. = mute)
523 * \param mute muted flag
525 typedef void (*libvlc_audio_set_volume_cb)(void *data,
526 float volume, bool mute);
529 * Set callbacks and private data for decoded audio.
530 * Use libvlc_audio_set_format() or libvlc_audio_set_format_callbacks()
531 * to configure the decoded audio format.
533 * \param mp the media player
534 * \param play callback to play audio samples (must not be NULL)
535 * \param pause callback to pause playback (or NULL to ignore)
536 * \param resume callback to resume playback (or NULL to ignore)
537 * \param flush callback to flush audio buffers (or NULL to ignore)
538 * \param drain callback to drain audio buffers (or NULL to ignore)
539 * \param opaque private pointer for the audio callbacks (as first parameter)
540 * \version LibVLC 2.0.0 or later
543 void libvlc_audio_set_callbacks( libvlc_media_player_t *mp,
544 libvlc_audio_play_cb play,
545 libvlc_audio_pause_cb pause,
546 libvlc_audio_resume_cb resume,
547 libvlc_audio_flush_cb flush,
548 libvlc_audio_drain_cb drain,
552 * Set callbacks and private data for decoded audio.
553 * Use libvlc_audio_set_format() or libvlc_audio_set_format_callbacks()
554 * to configure the decoded audio format.
556 * \param mp the media player
557 * \param set_volume callback to apply audio volume,
558 * or NULL to apply volume in software
559 * \version LibVLC 2.0.0 or later
562 void libvlc_audio_set_volume_callback( libvlc_media_player_t *mp,
563 libvlc_audio_set_volume_cb set_volume );
566 * Callback prototype to setup the audio playback.
567 * This is called when the media player needs to create a new audio output.
568 * \param opaque pointer to the data pointer passed to
569 * libvlc_audio_set_callbacks() [IN/OUT]
570 * \param format 4 bytes sample format [IN/OUT]
571 * \param rate sample rate [IN/OUT]
572 * \param channels channels count [IN/OUT]
573 * \return 0 on success, anything else to skip audio playback
575 typedef int (*libvlc_audio_setup_cb)(void **data, char *format, unsigned *rate,
579 * Callback prototype for audio playback cleanup.
580 * This is called when the media player no longer needs an audio output.
581 * \param opaque data pointer as passed to libvlc_audio_set_callbacks() [IN]
583 typedef void (*libvlc_audio_cleanup_cb)(void *data);
586 * Set decoded audio format. This only works in combination with
587 * libvlc_audio_set_callbacks().
589 * \param mp the media player
590 * \param setup callback to select the audio format (cannot be NULL)
591 * \param cleanup callback to release any allocated resources (or NULL)
592 * \version LibVLC 2.0.0 or later
595 void libvlc_audio_set_format_callbacks( libvlc_media_player_t *mp,
596 libvlc_audio_setup_cb setup,
597 libvlc_audio_cleanup_cb cleanup );
600 * Set decoded audio format.
601 * This only works in combination with libvlc_audio_set_callbacks(),
602 * and is mutually exclusive with libvlc_audio_set_format_callbacks().
604 * \param mp the media player
605 * \param format a four-characters string identifying the sample format
606 * (e.g. "S16N" or "FL32")
607 * \param rate sample rate (expressed in Hz)
608 * \param channels channels count
609 * \version LibVLC 2.0.0 or later
612 void libvlc_audio_set_format( libvlc_media_player_t *mp, const char *format,
613 unsigned rate, unsigned channels );
615 /** \bug This might go away ... to be replaced by a broader system */
618 * Get the current movie length (in ms).
620 * \param p_mi the Media Player
621 * \return the movie length (in ms), or -1 if there is no media.
623 LIBVLC_API libvlc_time_t libvlc_media_player_get_length( libvlc_media_player_t *p_mi );
626 * Get the current movie time (in ms).
628 * \param p_mi the Media Player
629 * \return the movie time (in ms), or -1 if there is no media.
631 LIBVLC_API libvlc_time_t libvlc_media_player_get_time( libvlc_media_player_t *p_mi );
634 * Set the movie time (in ms). This has no effect if no media is being played.
635 * Not all formats and protocols support this.
637 * \param p_mi the Media Player
638 * \param i_time the movie time (in ms).
640 LIBVLC_API void libvlc_media_player_set_time( libvlc_media_player_t *p_mi, libvlc_time_t i_time );
643 * Get movie position as percentage between 0.0 and 1.0.
645 * \param p_mi the Media Player
646 * \return movie position, or -1. in case of error
648 LIBVLC_API float libvlc_media_player_get_position( libvlc_media_player_t *p_mi );
651 * Set movie position as percentage between 0.0 and 1.0.
652 * This has no effect if playback is not enabled.
653 * This might not work depending on the underlying input format and protocol.
655 * \param p_mi the Media Player
656 * \param f_pos the position
658 LIBVLC_API void libvlc_media_player_set_position( libvlc_media_player_t *p_mi, float f_pos );
661 * Set movie chapter (if applicable).
663 * \param p_mi the Media Player
664 * \param i_chapter chapter number to play
666 LIBVLC_API void libvlc_media_player_set_chapter( libvlc_media_player_t *p_mi, int i_chapter );
671 * \param p_mi the Media Player
672 * \return chapter number currently playing, or -1 if there is no media.
674 LIBVLC_API int libvlc_media_player_get_chapter( libvlc_media_player_t *p_mi );
677 * Get movie chapter count
679 * \param p_mi the Media Player
680 * \return number of chapters in movie, or -1.
682 LIBVLC_API int libvlc_media_player_get_chapter_count( libvlc_media_player_t *p_mi );
685 * Is the player able to play
687 * \param p_mi the Media Player
690 * \libvlc_return_bool
692 LIBVLC_API int libvlc_media_player_will_play( libvlc_media_player_t *p_mi );
695 * Get title chapter count
697 * \param p_mi the Media Player
698 * \param i_title title
699 * \return number of chapters in title, or -1
701 LIBVLC_API int libvlc_media_player_get_chapter_count_for_title(
702 libvlc_media_player_t *p_mi, int i_title );
707 * \param p_mi the Media Player
708 * \param i_title title number to play
710 LIBVLC_API void libvlc_media_player_set_title( libvlc_media_player_t *p_mi, int i_title );
715 * \param p_mi the Media Player
716 * \return title number currently playing, or -1
718 LIBVLC_API int libvlc_media_player_get_title( libvlc_media_player_t *p_mi );
721 * Get movie title count
723 * \param p_mi the Media Player
724 * \return title number count, or -1
726 LIBVLC_API int libvlc_media_player_get_title_count( libvlc_media_player_t *p_mi );
729 * Set previous chapter (if applicable)
731 * \param p_mi the Media Player
733 LIBVLC_API void libvlc_media_player_previous_chapter( libvlc_media_player_t *p_mi );
736 * Set next chapter (if applicable)
738 * \param p_mi the Media Player
740 LIBVLC_API void libvlc_media_player_next_chapter( libvlc_media_player_t *p_mi );
743 * Get the requested movie play rate.
744 * @warning Depending on the underlying media, the requested rate may be
745 * different from the real playback rate.
747 * \param p_mi the Media Player
748 * \return movie play rate
750 LIBVLC_API float libvlc_media_player_get_rate( libvlc_media_player_t *p_mi );
753 * Set movie play rate
755 * \param p_mi the Media Player
756 * \param rate movie play rate to set
757 * \return -1 if an error was detected, 0 otherwise (but even then, it might
758 * not actually work depending on the underlying media protocol)
760 LIBVLC_API int libvlc_media_player_set_rate( libvlc_media_player_t *p_mi, float rate );
763 * Get current movie state
765 * \param p_mi the Media Player
766 * \return the current state of the media player (playing, paused, ...) \see libvlc_state_t
768 LIBVLC_API libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *p_mi );
773 * \param p_mi the Media Player
774 * \return frames per second (fps) for this playing movie, or 0 if unspecified
776 LIBVLC_API float libvlc_media_player_get_fps( libvlc_media_player_t *p_mi );
781 * How many video outputs does this media player have?
783 * \param p_mi the media player
784 * \return the number of video outputs
786 LIBVLC_API unsigned libvlc_media_player_has_vout( libvlc_media_player_t *p_mi );
789 * Is this media player seekable?
791 * \param p_mi the media player
792 * \return true if the media player can seek
794 * \libvlc_return_bool
796 LIBVLC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi );
799 * Can this media player be paused?
801 * \param p_mi the media player
802 * \return true if the media player can pause
804 * \libvlc_return_bool
806 LIBVLC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi );
810 * Display the next frame (if supported)
812 * \param p_mi the media player
814 LIBVLC_API void libvlc_media_player_next_frame( libvlc_media_player_t *p_mi );
817 * Navigate through DVD Menu
819 * \param p_mi the Media Player
820 * \param navigate the Navigation mode
821 * \version libVLC 2.0.0 or later
823 LIBVLC_API void libvlc_media_player_navigate( libvlc_media_player_t* p_mi,
827 * Release (free) libvlc_track_description_t
829 * \param p_track_description the structure to release
831 LIBVLC_API void libvlc_track_description_list_release( libvlc_track_description_t *p_track_description );
834 * \deprecated Use libvlc_track_description_list_release instead
836 LIBVLC_DEPRECATED LIBVLC_API
837 void libvlc_track_description_release( libvlc_track_description_t *p_track_description );
839 /** \defgroup libvlc_video LibVLC video controls
844 * Toggle fullscreen status on non-embedded video outputs.
846 * @warning The same limitations applies to this function
847 * as to libvlc_set_fullscreen().
849 * \param p_mi the media player
851 LIBVLC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *p_mi );
854 * Enable or disable fullscreen.
856 * @warning With most window managers, only a top-level windows can be in
857 * full-screen mode. Hence, this function will not operate properly if
858 * libvlc_media_player_set_xwindow() was used to embed the video in a
859 * non-top-level window. In that case, the embedding window must be reparented
860 * to the root window <b>before</b> fullscreen mode is enabled. You will want
861 * to reparent it back to its normal parent when disabling fullscreen.
863 * \param p_mi the media player
864 * \param b_fullscreen boolean for fullscreen status
866 LIBVLC_API void libvlc_set_fullscreen( libvlc_media_player_t *p_mi, int b_fullscreen );
869 * Get current fullscreen status.
871 * \param p_mi the media player
872 * \return the fullscreen status (boolean)
874 * \libvlc_return_bool
876 LIBVLC_API int libvlc_get_fullscreen( libvlc_media_player_t *p_mi );
879 * Enable or disable key press events handling, according to the LibVLC hotkeys
880 * configuration. By default and for historical reasons, keyboard events are
881 * handled by the LibVLC video widget.
883 * \note On X11, there can be only one subscriber for key press and mouse
884 * click events per window. If your application has subscribed to those events
885 * for the X window ID of the video widget, then LibVLC will not be able to
886 * handle key presses and mouse clicks in any case.
888 * \warning This function is only implemented for X11 and Win32 at the moment.
890 * \param p_mi the media player
891 * \param on true to handle key press events, false to ignore them.
894 void libvlc_video_set_key_input( libvlc_media_player_t *p_mi, unsigned on );
897 * Enable or disable mouse click events handling. By default, those events are
898 * handled. This is needed for DVD menus to work, as well as a few video
899 * filters such as "puzzle".
901 * \see libvlc_video_set_key_input().
903 * \warning This function is only implemented for X11 and Win32 at the moment.
905 * \param p_mi the media player
906 * \param on true to handle mouse click events, false to ignore them.
909 void libvlc_video_set_mouse_input( libvlc_media_player_t *p_mi, unsigned on );
912 * Get the pixel dimensions of a video.
914 * \param p_mi media player
915 * \param num number of the video (starting from, and most commonly 0)
916 * \param px pointer to get the pixel width [OUT]
917 * \param py pointer to get the pixel height [OUT]
918 * \return 0 on success, -1 if the specified video does not exist
921 int libvlc_video_get_size( libvlc_media_player_t *p_mi, unsigned num,
922 unsigned *px, unsigned *py );
925 * Get current video height.
926 * \deprecated Use libvlc_video_get_size() instead.
928 * \param p_mi the media player
929 * \return the video pixel height or 0 if not applicable
931 LIBVLC_DEPRECATED LIBVLC_API
932 int libvlc_video_get_height( libvlc_media_player_t *p_mi );
935 * Get current video width.
936 * \deprecated Use libvlc_video_get_size() instead.
938 * \param p_mi the media player
939 * \return the video pixel width or 0 if not applicable
941 LIBVLC_DEPRECATED LIBVLC_API
942 int libvlc_video_get_width( libvlc_media_player_t *p_mi );
945 * Get the mouse pointer coordinates over a video.
946 * Coordinates are expressed in terms of the decoded video resolution,
947 * <b>not</b> in terms of pixels on the screen/viewport (to get the latter,
948 * you can query your windowing system directly).
950 * Either of the coordinates may be negative or larger than the corresponding
951 * dimension of the video, if the cursor is outside the rendering area.
953 * @warning The coordinates may be out-of-date if the pointer is not located
954 * on the video rendering area. LibVLC does not track the pointer if it is
955 * outside of the video widget.
957 * @note LibVLC does not support multiple pointers (it does of course support
958 * multiple input devices sharing the same pointer) at the moment.
960 * \param p_mi media player
961 * \param num number of the video (starting from, and most commonly 0)
962 * \param px pointer to get the abscissa [OUT]
963 * \param py pointer to get the ordinate [OUT]
964 * \return 0 on success, -1 if the specified video does not exist
967 int libvlc_video_get_cursor( libvlc_media_player_t *p_mi, unsigned num,
971 * Get the current video scaling factor.
972 * See also libvlc_video_set_scale().
974 * \param p_mi the media player
975 * \return the currently configured zoom factor, or 0. if the video is set
976 * to fit to the output window/drawable automatically.
978 LIBVLC_API float libvlc_video_get_scale( libvlc_media_player_t *p_mi );
981 * Set the video scaling factor. That is the ratio of the number of pixels on
982 * screen to the number of pixels in the original decoded video in each
983 * dimension. Zero is a special value; it will adjust the video to the output
984 * window/drawable (in windowed mode) or the entire screen.
986 * Note that not all video outputs support scaling.
988 * \param p_mi the media player
989 * \param f_factor the scaling factor, or zero
991 LIBVLC_API void libvlc_video_set_scale( libvlc_media_player_t *p_mi, float f_factor );
994 * Get current video aspect ratio.
996 * \param p_mi the media player
997 * \return the video aspect ratio or NULL if unspecified
998 * (the result must be released with free() or libvlc_free()).
1000 LIBVLC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *p_mi );
1003 * Set new video aspect ratio.
1005 * \param p_mi the media player
1006 * \param psz_aspect new video aspect-ratio or NULL to reset to default
1007 * \note Invalid aspect ratios are ignored.
1009 LIBVLC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *p_mi, const char *psz_aspect );
1012 * Get current video subtitle.
1014 * \param p_mi the media player
1015 * \return the video subtitle selected, or -1 if none
1017 LIBVLC_API int libvlc_video_get_spu( libvlc_media_player_t *p_mi );
1020 * Get the number of available video subtitles.
1022 * \param p_mi the media player
1023 * \return the number of available video subtitles
1025 LIBVLC_API int libvlc_video_get_spu_count( libvlc_media_player_t *p_mi );
1028 * Get the description of available video subtitles.
1030 * \param p_mi the media player
1031 * \return list containing description of available video subtitles
1033 LIBVLC_API libvlc_track_description_t *
1034 libvlc_video_get_spu_description( libvlc_media_player_t *p_mi );
1037 * Set new video subtitle.
1039 * \param p_mi the media player
1040 * \param i_spu new video subtitle to select
1041 * \return 0 on success, -1 if out of range
1043 LIBVLC_API int libvlc_video_set_spu( libvlc_media_player_t *p_mi, unsigned i_spu );
1046 * Set new video subtitle file.
1048 * \param p_mi the media player
1049 * \param psz_subtitle new video subtitle file
1050 * \return the success status (boolean)
1052 LIBVLC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *p_mi, const char *psz_subtitle );
1055 * Get the current subtitle delay. Positive values means subtitles are being
1056 * displayed later, negative values earlier.
1058 * \param p_mi media player
1059 * \return time (in microseconds) the display of subtitles is being delayed
1060 * \version LibVLC 2.0.0 or later
1062 LIBVLC_API int64_t libvlc_video_get_spu_delay( libvlc_media_player_t *p_mi );
1065 * Set the subtitle delay. This affects the timing of when the subtitle will
1066 * be displayed. Positive values result in subtitles being displayed later,
1067 * while negative values will result in subtitles being displayed earlier.
1069 * The subtitle delay will be reset to zero each time the media changes.
1071 * \param p_mi media player
1072 * \param i_delay time (in microseconds) the display of subtitles should be delayed
1073 * \return 0 on success, -1 on error
1074 * \version LibVLC 2.0.0 or later
1076 LIBVLC_API int libvlc_video_set_spu_delay( libvlc_media_player_t *p_mi, int64_t i_delay );
1079 * Get the description of available titles.
1081 * \param p_mi the media player
1082 * \return list containing description of available titles
1084 LIBVLC_API libvlc_track_description_t *
1085 libvlc_video_get_title_description( libvlc_media_player_t *p_mi );
1088 * Get the description of available chapters for specific title.
1090 * \param p_mi the media player
1091 * \param i_title selected title
1092 * \return list containing description of available chapter for title i_title
1094 LIBVLC_API libvlc_track_description_t *
1095 libvlc_video_get_chapter_description( libvlc_media_player_t *p_mi, int i_title );
1098 * Get current crop filter geometry.
1100 * \param p_mi the media player
1101 * \return the crop filter geometry or NULL if unset
1103 LIBVLC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *p_mi );
1106 * Set new crop filter geometry.
1108 * \param p_mi the media player
1109 * \param psz_geometry new crop filter geometry (NULL to unset)
1112 void libvlc_video_set_crop_geometry( libvlc_media_player_t *p_mi, const char *psz_geometry );
1115 * Get current teletext page requested.
1117 * \param p_mi the media player
1118 * \return the current teletext page requested.
1120 LIBVLC_API int libvlc_video_get_teletext( libvlc_media_player_t *p_mi );
1123 * Set new teletext page to retrieve.
1125 * \param p_mi the media player
1126 * \param i_page teletex page number requested
1128 LIBVLC_API void libvlc_video_set_teletext( libvlc_media_player_t *p_mi, int i_page );
1131 * Toggle teletext transparent status on video output.
1133 * \param p_mi the media player
1135 LIBVLC_API void libvlc_toggle_teletext( libvlc_media_player_t *p_mi );
1138 * Get number of available video tracks.
1140 * \param p_mi media player
1141 * \return the number of available video tracks (int)
1143 LIBVLC_API int libvlc_video_get_track_count( libvlc_media_player_t *p_mi );
1146 * Get the description of available video tracks.
1148 * \param p_mi media player
1149 * \return list with description of available video tracks, or NULL on error
1151 LIBVLC_API libvlc_track_description_t *
1152 libvlc_video_get_track_description( libvlc_media_player_t *p_mi );
1155 * Get current video track.
1157 * \param p_mi media player
1158 * \return the video track ID (int) or -1 if no active input
1160 LIBVLC_API int libvlc_video_get_track( libvlc_media_player_t *p_mi );
1165 * \param p_mi media player
1166 * \param i_track the track ID (i_id field from track description)
1167 * \return 0 on success, -1 if out of range
1170 int libvlc_video_set_track( libvlc_media_player_t *p_mi, int i_track );
1173 * Take a snapshot of the current video window.
1175 * If i_width AND i_height is 0, original size is used.
1176 * If i_width XOR i_height is 0, original aspect-ratio is preserved.
1178 * \param p_mi media player instance
1179 * \param num number of video output (typically 0 for the first/only one)
1180 * \param psz_filepath the path where to save the screenshot to
1181 * \param i_width the snapshot's width
1182 * \param i_height the snapshot's height
1183 * \return 0 on success, -1 if the video was not found
1186 int libvlc_video_take_snapshot( libvlc_media_player_t *p_mi, unsigned num,
1187 const char *psz_filepath, unsigned int i_width,
1188 unsigned int i_height );
1191 * Enable or disable deinterlace filter
1193 * \param p_mi libvlc media player
1194 * \param psz_mode type of deinterlace filter, NULL to disable
1196 LIBVLC_API void libvlc_video_set_deinterlace( libvlc_media_player_t *p_mi,
1197 const char *psz_mode );
1200 * Get an integer marquee option value
1202 * \param p_mi libvlc media player
1203 * \param option marq option to get \see libvlc_video_marquee_int_option_t
1205 LIBVLC_API int libvlc_video_get_marquee_int( libvlc_media_player_t *p_mi,
1209 * Get a string marquee option value
1211 * \param p_mi libvlc media player
1212 * \param option marq option to get \see libvlc_video_marquee_string_option_t
1214 LIBVLC_API char *libvlc_video_get_marquee_string( libvlc_media_player_t *p_mi,
1218 * Enable, disable or set an integer marquee option
1220 * Setting libvlc_marquee_Enable has the side effect of enabling (arg !0)
1221 * or disabling (arg 0) the marq filter.
1223 * \param p_mi libvlc media player
1224 * \param option marq option to set \see libvlc_video_marquee_int_option_t
1225 * \param i_val marq option value
1227 LIBVLC_API void libvlc_video_set_marquee_int( libvlc_media_player_t *p_mi,
1228 unsigned option, int i_val );
1231 * Set a marquee string option
1233 * \param p_mi libvlc media player
1234 * \param option marq option to set \see libvlc_video_marquee_string_option_t
1235 * \param psz_text marq option value
1237 LIBVLC_API void libvlc_video_set_marquee_string( libvlc_media_player_t *p_mi,
1238 unsigned option, const char *psz_text );
1240 /** option values for libvlc_video_{get,set}_logo_{int,string} */
1241 enum libvlc_video_logo_option_t {
1243 libvlc_logo_file, /**< string argument, "file,d,t;file,d,t;..." */
1248 libvlc_logo_opacity,
1249 libvlc_logo_position
1253 * Get integer logo option.
1255 * \param p_mi libvlc media player instance
1256 * \param option logo option to get, values of libvlc_video_logo_option_t
1258 LIBVLC_API int libvlc_video_get_logo_int( libvlc_media_player_t *p_mi,
1262 * Set logo option as integer. Options that take a different type value
1264 * Passing libvlc_logo_enable as option value has the side effect of
1265 * starting (arg !0) or stopping (arg 0) the logo filter.
1267 * \param p_mi libvlc media player instance
1268 * \param option logo option to set, values of libvlc_video_logo_option_t
1269 * \param value logo option value
1271 LIBVLC_API void libvlc_video_set_logo_int( libvlc_media_player_t *p_mi,
1272 unsigned option, int value );
1275 * Set logo option as string. Options that take a different type value
1278 * \param p_mi libvlc media player instance
1279 * \param option logo option to set, values of libvlc_video_logo_option_t
1280 * \param psz_value logo option value
1282 LIBVLC_API void libvlc_video_set_logo_string( libvlc_media_player_t *p_mi,
1283 unsigned option, const char *psz_value );
1286 /** option values for libvlc_video_{get,set}_adjust_{int,float,bool} */
1287 enum libvlc_video_adjust_option_t {
1288 libvlc_adjust_Enable = 0,
1289 libvlc_adjust_Contrast,
1290 libvlc_adjust_Brightness,
1292 libvlc_adjust_Saturation,
1297 * Get integer adjust option.
1299 * \param p_mi libvlc media player instance
1300 * \param option adjust option to get, values of libvlc_video_adjust_option_t
1301 * \version LibVLC 1.1.1 and later.
1303 LIBVLC_API int libvlc_video_get_adjust_int( libvlc_media_player_t *p_mi,
1307 * Set adjust option as integer. Options that take a different type value
1309 * Passing libvlc_adjust_enable as option value has the side effect of
1310 * starting (arg !0) or stopping (arg 0) the adjust filter.
1312 * \param p_mi libvlc media player instance
1313 * \param option adust option to set, values of libvlc_video_adjust_option_t
1314 * \param value adjust option value
1315 * \version LibVLC 1.1.1 and later.
1317 LIBVLC_API void libvlc_video_set_adjust_int( libvlc_media_player_t *p_mi,
1318 unsigned option, int value );
1321 * Get float adjust option.
1323 * \param p_mi libvlc media player instance
1324 * \param option adjust option to get, values of libvlc_video_adjust_option_t
1325 * \version LibVLC 1.1.1 and later.
1327 LIBVLC_API float libvlc_video_get_adjust_float( libvlc_media_player_t *p_mi,
1331 * Set adjust option as float. Options that take a different type value
1334 * \param p_mi libvlc media player instance
1335 * \param option adust option to set, values of libvlc_video_adjust_option_t
1336 * \param value adjust option value
1337 * \version LibVLC 1.1.1 and later.
1339 LIBVLC_API void libvlc_video_set_adjust_float( libvlc_media_player_t *p_mi,
1340 unsigned option, float value );
1344 /** \defgroup libvlc_audio LibVLC audio controls
1349 * Audio device types
1351 typedef enum libvlc_audio_output_device_types_t {
1352 libvlc_AudioOutputDevice_Error = -1,
1353 libvlc_AudioOutputDevice_Mono = 1,
1354 libvlc_AudioOutputDevice_Stereo = 2,
1355 libvlc_AudioOutputDevice_2F2R = 4,
1356 libvlc_AudioOutputDevice_3F2R = 5,
1357 libvlc_AudioOutputDevice_5_1 = 6,
1358 libvlc_AudioOutputDevice_6_1 = 7,
1359 libvlc_AudioOutputDevice_7_1 = 8,
1360 libvlc_AudioOutputDevice_SPDIF = 10
1361 } libvlc_audio_output_device_types_t;
1366 typedef enum libvlc_audio_output_channel_t {
1367 libvlc_AudioChannel_Error = -1,
1368 libvlc_AudioChannel_Stereo = 1,
1369 libvlc_AudioChannel_RStereo = 2,
1370 libvlc_AudioChannel_Left = 3,
1371 libvlc_AudioChannel_Right = 4,
1372 libvlc_AudioChannel_Dolbys = 5
1373 } libvlc_audio_output_channel_t;
1377 * Gets the list of available audio outputs
1379 * \param p_instance libvlc instance
1380 * \return list of available audio outputs. It must be freed it with
1381 * \see libvlc_audio_output_list_release \see libvlc_audio_output_t .
1382 * In case of error, NULL is returned.
1384 LIBVLC_API libvlc_audio_output_t *
1385 libvlc_audio_output_list_get( libvlc_instance_t *p_instance );
1388 * Frees the list of available audio outputs
1390 * \param p_list list with audio outputs for release
1393 void libvlc_audio_output_list_release( libvlc_audio_output_t *p_list );
1396 * Sets the audio output.
1397 * \note Any change will take be effect only after playback is stopped and
1398 * restarted. Audio output cannot be changed while playing.
1400 * \param p_mi media player
1401 * \param psz_name name of audio output,
1402 * use psz_name of \see libvlc_audio_output_t
1403 * \return 0 if function succeded, -1 on error
1405 LIBVLC_API int libvlc_audio_output_set( libvlc_media_player_t *p_mi,
1406 const char *psz_name );
1409 * Backward compatibility stub. Do not use in new code.
1410 * Use libvlc_audio_output_device_list_get() instead.
1413 LIBVLC_DEPRECATED LIBVLC_API
1414 int libvlc_audio_output_device_count( libvlc_instance_t *, const char * );
1417 * Backward compatibility stub. Do not use in new code.
1418 * Use libvlc_audio_output_device_list_get() instead.
1419 * \return always NULL.
1421 LIBVLC_DEPRECATED LIBVLC_API
1422 char *libvlc_audio_output_device_longname( libvlc_instance_t *, const char *,
1426 * Backward compatibility stub. Do not use in new code.
1427 * Use libvlc_audio_output_device_list_get() instead.
1428 * \return always NULL.
1430 LIBVLC_DEPRECATED LIBVLC_API
1431 char *libvlc_audio_output_device_id( libvlc_instance_t *, const char *, int );
1434 * Gets a list of audio output devices for a given audio output.
1435 * \see libvlc_audio_output_device_set().
1437 * \note Not all audio outputs support this. In particular, an empty (NULL)
1438 * list of devices does <b>not</b> imply that the specified audio output does
1441 * \note The list might not be exhaustive.
1443 * \warning Some audio output devices in the list might not actually work in
1444 * some circumstances. By default, it is recommended to not specify any
1445 * explicit audio device.
1447 * \param p_instance libvlc instance
1448 * \param psz_aout audio output name
1449 * (as returned by libvlc_audio_output_list_get())
1450 * \return A NULL-terminated linked list of potential audio output devices.
1451 * It must be freed it with libvlc_audio_output_device_list_release()
1452 * \version LibVLC 2.1.0 or later.
1454 LIBVLC_API libvlc_audio_output_device_t *
1455 libvlc_audio_output_device_list_get( libvlc_instance_t *p_instance,
1459 * Frees a list of available audio output devices.
1461 * \param p_list list with audio outputs for release
1462 * \version LibVLC 2.1.0 or later.
1464 LIBVLC_API void libvlc_audio_output_device_list_release(
1465 libvlc_audio_output_device_t *p_list );
1468 * Configures an explicit audio output device for a given audio output plugin.
1469 * A list of possible devices can be obtained with
1470 * libvlc_audio_output_device_list_get().
1472 * \note This function does not select the specified audio output plugin.
1473 * libvlc_audio_output_set() is used for that purpose.
1475 * \warning The syntax for the device parameter depends on the audio output.
1476 * This is not portable. Only use this function if you know what you are doing.
1477 * Some audio outputs do not support this function (e.g. PulseAudio, WASAPI).
1478 * Some audio outputs require further parameters (e.g. ALSA: channels map).
1480 * \param p_mi media player
1481 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1482 * \param psz_device_id device
1483 * \return Nothing. Errors are ignored.
1485 LIBVLC_API void libvlc_audio_output_device_set( libvlc_media_player_t *p_mi,
1486 const char *psz_audio_output,
1487 const char *psz_device_id );
1490 * Stub for backward compatibility.
1491 * \return always -1.
1494 LIBVLC_API int libvlc_audio_output_get_device_type( libvlc_media_player_t *p_mi );
1497 * Stub for backward compatibility.
1500 LIBVLC_API void libvlc_audio_output_set_device_type( libvlc_media_player_t *,
1505 * Toggle mute status.
1507 * \param p_mi media player
1508 * \warning Toggling mute atomically is not always possible: On some platforms,
1509 * other processes can mute the VLC audio playback stream asynchronously. Thus,
1510 * there is a small race condition where toggling will not work.
1511 * See also the limitations of libvlc_audio_set_mute().
1513 LIBVLC_API void libvlc_audio_toggle_mute( libvlc_media_player_t *p_mi );
1516 * Get current mute status.
1518 * \param p_mi media player
1519 * \return the mute status (boolean) if defined, -1 if undefined/unapplicable
1521 LIBVLC_API int libvlc_audio_get_mute( libvlc_media_player_t *p_mi );
1526 * \param p_mi media player
1527 * \param status If status is true then mute, otherwise unmute
1528 * \warning This function does not always work. If there are no active audio
1529 * playback stream, the mute status might not be available. If digital
1530 * pass-through (S/PDIF, HDMI...) is in use, muting may be unapplicable. Also
1531 * some audio output plugins do not support muting at all.
1532 * \note To force silent playback, disable all audio tracks. This is more
1533 * efficient and reliable than mute.
1535 LIBVLC_API void libvlc_audio_set_mute( libvlc_media_player_t *p_mi, int status );
1538 * Get current software audio volume.
1540 * \param p_mi media player
1541 * \return the software volume in percents
1542 * (0 = mute, 100 = nominal / 0dB)
1544 LIBVLC_API int libvlc_audio_get_volume( libvlc_media_player_t *p_mi );
1547 * Set current software audio volume.
1549 * \param p_mi media player
1550 * \param i_volume the volume in percents (0 = mute, 100 = 0dB)
1551 * \return 0 if the volume was set, -1 if it was out of range
1553 LIBVLC_API int libvlc_audio_set_volume( libvlc_media_player_t *p_mi, int i_volume );
1556 * Get number of available audio tracks.
1558 * \param p_mi media player
1559 * \return the number of available audio tracks (int), or -1 if unavailable
1561 LIBVLC_API int libvlc_audio_get_track_count( libvlc_media_player_t *p_mi );
1564 * Get the description of available audio tracks.
1566 * \param p_mi media player
1567 * \return list with description of available audio tracks, or NULL
1569 LIBVLC_API libvlc_track_description_t *
1570 libvlc_audio_get_track_description( libvlc_media_player_t *p_mi );
1573 * Get current audio track.
1575 * \param p_mi media player
1576 * \return the audio track ID or -1 if no active input.
1578 LIBVLC_API int libvlc_audio_get_track( libvlc_media_player_t *p_mi );
1581 * Set current audio track.
1583 * \param p_mi media player
1584 * \param i_track the track ID (i_id field from track description)
1585 * \return 0 on success, -1 on error
1587 LIBVLC_API int libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track );
1590 * Get current audio channel.
1592 * \param p_mi media player
1593 * \return the audio channel \see libvlc_audio_output_channel_t
1595 LIBVLC_API int libvlc_audio_get_channel( libvlc_media_player_t *p_mi );
1598 * Set current audio channel.
1600 * \param p_mi media player
1601 * \param channel the audio channel, \see libvlc_audio_output_channel_t
1602 * \return 0 on success, -1 on error
1604 LIBVLC_API int libvlc_audio_set_channel( libvlc_media_player_t *p_mi, int channel );
1607 * Get current audio delay.
1609 * \param p_mi media player
1610 * \return the audio delay (microseconds)
1611 * \version LibVLC 1.1.1 or later
1613 LIBVLC_API int64_t libvlc_audio_get_delay( libvlc_media_player_t *p_mi );
1616 * Set current audio delay. The audio delay will be reset to zero each time the media changes.
1618 * \param p_mi media player
1619 * \param i_delay the audio delay (microseconds)
1620 * \return 0 on success, -1 on error
1621 * \version LibVLC 1.1.1 or later
1623 LIBVLC_API int libvlc_audio_set_delay( libvlc_media_player_t *p_mi, int64_t i_delay );
1627 /** @} media_player */
1633 #endif /* VLC_LIBVLC_MEDIA_PLAYER_H */