1 /*****************************************************************************
2 * libvlc_media_player.h: libvlc_media_player external API
3 *****************************************************************************
4 * Copyright (C) 1998-2010 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_media_player external API
31 #ifndef VLC_LIBVLC_MEDIA_PLAYER_H
32 #define VLC_LIBVLC_MEDIA_PLAYER_H 1
38 /*****************************************************************************
40 *****************************************************************************/
41 /** \defgroup libvlc_media_player libvlc_media_player
43 * LibVLC Media Player, object that let you play a media
44 * in a custom drawable
48 typedef struct libvlc_media_player_t libvlc_media_player_t;
51 * Description for video, audio tracks and subtitles. It contains
52 * id, name (description string) and pointer to next record.
54 typedef struct libvlc_track_description_t
58 struct libvlc_track_description_t *p_next;
60 } libvlc_track_description_t;
63 * Description for audio output. It contains
64 * name, description and pointer to next record.
66 typedef struct libvlc_audio_output_t
69 char *psz_description;
70 struct libvlc_audio_output_t *p_next;
72 } libvlc_audio_output_t;
75 * Rectangle type for video geometry
77 typedef struct libvlc_rectangle_t
84 * Marq options definition
86 typedef enum libvlc_video_marquee_option_t {
87 libvlc_marquee_Enable = 0,
88 libvlc_marquee_Text, /** string argument */
90 libvlc_marquee_Opacity,
91 libvlc_marquee_Position,
92 libvlc_marquee_Refresh,
94 libvlc_marquee_Timeout,
97 } libvlc_video_marquee_option_t;
100 * Create an empty Media Player object
102 * \param p_libvlc_instance the libvlc instance in which the Media Player
104 * \return a new media player object, or NULL on error.
106 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t * );
109 * Create a Media Player object from a Media
111 * \param p_md the media. Afterwards the p_md can be safely
113 * \return a new media player object, or NULL on error.
115 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new_from_media( libvlc_media_t * );
118 * Release a media_player after use
119 * Decrement the reference count of a media player object. If the
120 * reference count is 0, then libvlc_media_player_release() will
121 * release the media player object. If the media player object
122 * has been released, then it should not be used again.
124 * \param p_mi the Media Player to free
126 VLC_PUBLIC_API void libvlc_media_player_release( libvlc_media_player_t * );
129 * Retain a reference to a media player object. Use
130 * libvlc_media_player_release() to decrement reference count.
132 * \param p_mi media player object
134 VLC_PUBLIC_API void libvlc_media_player_retain( libvlc_media_player_t * );
137 * Set the media that will be used by the media_player. If any,
138 * previous md will be released.
140 * \param p_mi the Media Player
141 * \param p_md the Media. Afterwards the p_md can be safely
144 VLC_PUBLIC_API void libvlc_media_player_set_media( libvlc_media_player_t *, libvlc_media_t * );
147 * Get the media used by the media_player.
149 * \param p_mi the Media Player
150 * \return the media associated with p_mi, or NULL if no
151 * media is associated
153 VLC_PUBLIC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t * );
156 * Get the Event Manager from which the media player send event.
158 * \param p_mi the Media Player
159 * \return the event manager associated with p_mi
161 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t * );
166 * \param p_mi the Media Player
167 * \return 1 if the media player is playing, 0 otherwise
169 VLC_PUBLIC_API int libvlc_media_player_is_playing ( libvlc_media_player_t * );
174 * \param p_mi the Media Player
175 * \return 0 if playback started (and was already started), or -1 on error.
177 VLC_PUBLIC_API int libvlc_media_player_play ( libvlc_media_player_t * );
180 * Toggle pause (no effect if there is no media)
182 * \param p_mi the Media Player
184 VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t * );
187 * Stop (no effect if there is no media)
189 * \param p_mi the Media Player
191 VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t * );
194 * Set the NSView handler where the media player should render its video output.
196 * The object minimal_macosx expects is of kind NSObject and should
197 * respect the protocol:
199 * @protocol VLCOpenGLVideoViewEmbedding <NSObject>
200 * - (void)addVoutSubview:(NSView *)view;
201 * - (void)removeVoutSubview:(NSView *)view;
204 * You can find a live example in VLCVideoView in VLCKit.framework.
206 * \param p_mi the Media Player
207 * \param drawable the NSView handler
209 VLC_PUBLIC_API void libvlc_media_player_set_nsobject ( libvlc_media_player_t *p_mi, void * drawable );
212 * Get the NSView handler previously set with libvlc_media_player_set_nsobject().
214 * \param p_mi the Media Player
215 * \return the NSView handler or 0 if none where set
217 VLC_PUBLIC_API void * libvlc_media_player_get_nsobject ( libvlc_media_player_t *p_mi );
220 * Set the agl handler where the media player should render its video output.
222 * \param p_mi the Media Player
223 * \param drawable the agl handler
224 * \param p_e an initialized exception pointer
226 VLC_PUBLIC_API void libvlc_media_player_set_agl ( libvlc_media_player_t *p_mi, uint32_t drawable );
229 * Get the agl handler previously set with libvlc_media_player_set_agl().
231 * \param p_mi the Media Player
232 * \return the agl handler or 0 if none where set
234 VLC_PUBLIC_API uint32_t libvlc_media_player_get_agl ( libvlc_media_player_t *p_mi );
237 * Set an X Window System drawable where the media player should render its
238 * video output. If LibVLC was built without X11 output support, then this has
241 * The specified identifier must correspond to an existing Input/Output class
242 * X11 window. Pixmaps are <b>not</b> supported. The caller shall ensure that
243 * the X11 server is the same as the one the VLC instance has been configured
245 * If XVideo is <b>not</b> used, it is assumed that the drawable has the
246 * following properties in common with the default X11 screen: depth, scan line
247 * pad, black pixel. This is a bug.
249 * \param p_mi the Media Player
250 * \param drawable the ID of the X window
252 VLC_PUBLIC_API void libvlc_media_player_set_xwindow ( libvlc_media_player_t *p_mi, uint32_t drawable );
255 * Get the X Window System window identifier previously set with
256 * libvlc_media_player_set_xwindow(). Note that this will return the identifier
257 * even if VLC is not currently using it (for instance if it is playing an
260 * \param p_mi the Media Player
261 * \return an X window ID, or 0 if none where set.
263 VLC_PUBLIC_API uint32_t libvlc_media_player_get_xwindow ( libvlc_media_player_t *p_mi );
266 * Set a Win32/Win64 API window handle (HWND) where the media player should
267 * render its video output. If LibVLC was built without Win32/Win64 API output
268 * support, then this has no effects.
270 * \param p_mi the Media Player
271 * \param drawable windows handle of the drawable
273 VLC_PUBLIC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi, void *drawable );
276 * Get the Windows API window handle (HWND) previously set with
277 * libvlc_media_player_set_hwnd(). The handle will be returned even if LibVLC
278 * is not currently outputting any video to it.
280 * \param p_mi the Media Player
281 * \return a window handle or NULL if there are none.
283 VLC_PUBLIC_API void *libvlc_media_player_get_hwnd ( libvlc_media_player_t *p_mi );
287 /** \bug This might go away ... to be replaced by a broader system */
290 * Get the current movie length (in ms).
292 * \param p_mi the Media Player
293 * \return the movie length (in ms), or -1 if there is no media.
295 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_length( libvlc_media_player_t * );
298 * Get the current movie time (in ms).
300 * \param p_mi the Media Player
301 * \return the movie time (in ms), or -1 if there is no media.
303 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_time( libvlc_media_player_t * );
306 * Set the movie time (in ms). This has no effect if no media is being played.
307 * Not all formats and protocols support this.
309 * \param p_mi the Media Player
310 * \param the movie time (in ms).
312 VLC_PUBLIC_API void libvlc_media_player_set_time( libvlc_media_player_t *, libvlc_time_t );
315 * Get movie position.
317 * \param p_mi the Media Player
318 * \return movie position, or -1. in case of error
320 VLC_PUBLIC_API float libvlc_media_player_get_position( libvlc_media_player_t * );
323 * Set movie position. This has no effect if playback is not enabled.
324 * This might not work depending on the underlying input format and protocol.
326 * \param p_mi the Media Player
327 * \param f_pos the position
329 VLC_PUBLIC_API void libvlc_media_player_set_position( libvlc_media_player_t *, float );
332 * Set movie chapter (if applicable).
334 * \param p_mi the Media Player
335 * \param i_chapter chapter number to play
337 VLC_PUBLIC_API void libvlc_media_player_set_chapter( libvlc_media_player_t *, int );
342 * \param p_mi the Media Player
343 * \return chapter number currently playing, or -1 if there is no media.
345 VLC_PUBLIC_API int libvlc_media_player_get_chapter( libvlc_media_player_t * );
348 * Get movie chapter count
350 * \param p_mi the Media Player
351 * \return number of chapters in movie, or -1.
353 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count( libvlc_media_player_t * );
356 * Is the player able to play
358 * \param p_mi the Media Player
361 VLC_PUBLIC_API int libvlc_media_player_will_play( libvlc_media_player_t * );
364 * Get title chapter count
366 * \param p_mi the Media Player
367 * \param i_title title
368 * \return number of chapters in title, or -1
370 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count_for_title(
371 libvlc_media_player_t *, int );
376 * \param p_mi the Media Player
377 * \param i_title title number to play
379 VLC_PUBLIC_API void libvlc_media_player_set_title( libvlc_media_player_t *, int );
384 * \param p_mi the Media Player
385 * \return title number currently playing, or -1
387 VLC_PUBLIC_API int libvlc_media_player_get_title( libvlc_media_player_t * );
390 * Get movie title count
392 * \param p_mi the Media Player
393 * \return title number count, or -1
395 VLC_PUBLIC_API int libvlc_media_player_get_title_count( libvlc_media_player_t * );
398 * Set previous chapter (if applicable)
400 * \param p_mi the Media Player
402 VLC_PUBLIC_API void libvlc_media_player_previous_chapter( libvlc_media_player_t * );
405 * Set next chapter (if applicable)
407 * \param p_mi the Media Player
409 VLC_PUBLIC_API void libvlc_media_player_next_chapter( libvlc_media_player_t * );
412 * Get movie play rate
414 * \param p_mi the Media Player
415 * \return movie play rate, or zero in case of error
417 VLC_PUBLIC_API float libvlc_media_player_get_rate( libvlc_media_player_t * );
420 * Set movie play rate
422 * \param p_mi the Media Player
423 * \param movie play rate to set
424 * \return -1 if an error was detected, 0 otherwise (but even then, it might
425 * not actually work depending on the underlying media protocol)
427 VLC_PUBLIC_API int libvlc_media_player_set_rate( libvlc_media_player_t *, float );
430 * Get current movie state
432 * \param p_mi the Media Player
434 VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *);
439 * \param p_mi the Media Player
440 * \return frames per second (fps) for this playing movie, or 0 if unspecified
442 VLC_PUBLIC_API float libvlc_media_player_get_fps( libvlc_media_player_t * );
447 * How many video outputs does this media player have?
449 * \param p_md the media player
450 * \return the number of video outputs
452 VLC_PUBLIC_API unsigned libvlc_media_player_has_vout( libvlc_media_player_t * );
455 * Is this media player seekable?
457 * \param p_input the input
459 VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi );
462 * Can this media player be paused?
464 * \param p_input the input
466 VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi );
470 * Display the next frame (if supported)
472 * \param p_input the libvlc_media_player_t instance
474 VLC_PUBLIC_API void libvlc_media_player_next_frame( libvlc_media_player_t *p_input );
479 * Release (free) libvlc_track_description_t
481 * \param p_track_description the structure to release
483 VLC_PUBLIC_API void libvlc_track_description_release( libvlc_track_description_t *p_track_description );
485 /** \defgroup libvlc_video libvlc_video
486 * \ingroup libvlc_media_player
487 * LibVLC Video handling
492 * Toggle fullscreen status on non-embedded video outputs.
494 * @warning The same limitations applies to this function
495 * as to libvlc_set_fullscreen().
497 * \param p_mediaplayer the media player
499 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t * );
502 * Enable or disable fullscreen on non-embedded video outputs.
504 * @warning With most window managers, only a top-level windows can switch to
505 * full-screen mode. Hence, this function will not operate properly if
506 * libvlc_media_player_set_xid() or libvlc_media_player_set_hwnd() was
507 * used to embed the video in a non-LibVLC widget. If you want to to render an
508 * embedded LibVLC video full-screen, the parent embedding widget must expanded
509 * to full screen (LibVLC cannot take care of that).
510 * LibVLC will then automatically resize the video as appropriate.
512 * \param p_mediaplayer the media player
513 * \param b_fullscreen boolean for fullscreen status
515 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *, int );
518 * Get current fullscreen status.
520 * \param p_mediaplayer the media player
521 * \return the fullscreen status (boolean)
523 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t * );
526 * Enable or disable key press events handling, according to the LibVLC hotkeys
527 * configuration. By default and for historical reasons, keyboard events are
528 * handled by the LibVLC video widget.
530 * \note On X11, there can be only one subscriber for key press and mouse
531 * click events per window. If your application has subscribed to those events
532 * for the X window ID of the video widget, then LibVLC will not be able to
533 * handle key presses and mouse clicks in any case.
535 * \warning This function is only implemented for X11 at the moment.
537 * \param mp the media player
538 * \param on true to handle key press events, false to ignore them.
541 void libvlc_video_set_key_input( libvlc_media_player_t *mp, unsigned on );
544 * Enable or disable mouse click events handling. By default, those events are
545 * handled. This is needed for DVD menus to work, as well as a few video
546 * filters such as "puzzle".
548 * \note See also \func libvlc_video_set_key_input().
550 * \warning This function is only implemented for X11 at the moment.
552 * \param mp the media player
553 * \param on true to handle mouse click events, false to ignore them.
556 void libvlc_video_set_mouse_input( libvlc_media_player_t *mp, unsigned on );
559 * Get the pixel dimensions of a video.
561 * \param mp media player
562 * \param num number of the video (starting from, and most commonly 0)
563 * \param px pointer to get the pixel width [OUT]
564 * \param py pointer to get the pixel height [OUT]
565 * \return 0 on success, -1 if the specified video does not exist
568 int libvlc_video_get_size( libvlc_media_player_t *mp, unsigned num,
569 unsigned *px, unsigned *py );
572 * Get current video height.
573 * You should use libvlc_video_get_size() instead.
575 * \param p_mediaplayer the media player
576 * \return the video pixel height or 0 if not applicable
579 int libvlc_video_get_height( libvlc_media_player_t * );
582 * Get current video width.
583 * You should use libvlc_video_get_size() instead.
585 * \param p_mediaplayer the media player
586 * \return the video pixel width or 0 if not applicable
589 int libvlc_video_get_width( libvlc_media_player_t * );
592 * Get the current video scaling factor.
593 * See also libvlc_video_set_scale().
595 * \param p_mediaplayer the media player
596 * \return the currently configured zoom factor, or 0. if the video is set
597 * to fit to the output window/drawable automatically.
599 VLC_PUBLIC_API float libvlc_video_get_scale( libvlc_media_player_t * );
602 * Set the video scaling factor. That is the ratio of the number of pixels on
603 * screen to the number of pixels in the original decoded video in each
604 * dimension. Zero is a special value; it will adjust the video to the output
605 * window/drawable (in windowed mode) or the entire screen.
607 * Note that not all video outputs support scaling.
609 * \param p_mediaplayer the media player
610 * \param i_factor the scaling factor, or zero
612 VLC_PUBLIC_API void libvlc_video_set_scale( libvlc_media_player_t *, float );
615 * Get current video aspect ratio.
617 * \param p_mediaplayer the media player
618 * \return the video aspect ratio or NULL if unspecified
619 * (the result must be released with free() or libvlc_free()).
621 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t * );
624 * Set new video aspect ratio.
626 * \param p_mediaplayer the media player
627 * \param psz_aspect new video aspect-ratio or NULL to reset to default
628 * \note Invalid aspect ratios are ignored.
630 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *, const char * );
633 * Get current video subtitle.
635 * \param p_mediaplayer the media player
636 * \return the video subtitle selected, or -1 if none
638 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t * );
641 * Get the number of available video subtitles.
643 * \param p_mediaplayer the media player
644 * \return the number of available video subtitles
646 VLC_PUBLIC_API int libvlc_video_get_spu_count( libvlc_media_player_t * );
649 * Get the description of available video subtitles.
651 * \param p_mediaplayer the media player
652 * \param p_e an initialized exception pointer
653 * \return list containing description of available video subtitles
655 VLC_PUBLIC_API libvlc_track_description_t *
656 libvlc_video_get_spu_description( libvlc_media_player_t * );
659 * Set new video subtitle.
661 * \param p_mediaplayer the media player
662 * \param i_spu new video subtitle to select
663 * \return 0 on success, -1 if out of range
665 VLC_PUBLIC_API int libvlc_video_set_spu( libvlc_media_player_t *, unsigned );
668 * Set new video subtitle file.
670 * \param p_mediaplayer the media player
671 * \param psz_subtitle new video subtitle file
672 * \param p_e an initialized exception pointer
673 * \return the success status (boolean)
675 VLC_PUBLIC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *, const char * );
678 * Get the description of available titles.
680 * \param p_mediaplayer the media player
681 * \param p_e an initialized exception pointer
682 * \return list containing description of available titles
684 VLC_PUBLIC_API libvlc_track_description_t *
685 libvlc_video_get_title_description( libvlc_media_player_t * );
688 * Get the description of available chapters for specific title.
690 * \param p_mediaplayer the media player
691 * \param i_title selected title
692 * \param p_e an initialized exception pointer
693 * \return list containing description of available chapter for title i_title
695 VLC_PUBLIC_API libvlc_track_description_t *
696 libvlc_video_get_chapter_description( libvlc_media_player_t *, int );
699 * Get current crop filter geometry.
701 * \param p_mediaplayer the media player
702 * \return the crop filter geometry or NULL if unset
704 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t * );
707 * Set new crop filter geometry.
709 * \param p_mediaplayer the media player
710 * \param psz_geometry new crop filter geometry (NULL to unset)
713 void libvlc_video_set_crop_geometry( libvlc_media_player_t *, const char * );
716 * Get current teletext page requested.
718 * \param p_mediaplayer the media player
719 * \return the current teletext page requested.
721 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t * );
724 * Set new teletext page to retrieve.
726 * \param p_mediaplayer the media player
727 * \param i_page teletex page number requested
729 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *, int );
732 * Toggle teletext transparent status on video output.
734 * \param p_mediaplayer the media player
735 * \param p_e an initialized exception pointer
737 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t * );
740 * Get number of available video tracks.
742 * \param p_mi media player
743 * \return the number of available video tracks (int)
745 VLC_PUBLIC_API int libvlc_video_get_track_count( libvlc_media_player_t * );
748 * Get the description of available video tracks.
750 * \param p_mi media player
751 * \return list with description of available video tracks, or NULL on error
753 VLC_PUBLIC_API libvlc_track_description_t *
754 libvlc_video_get_track_description( libvlc_media_player_t * );
757 * Get current video track.
759 * \param p_mi media player
760 * \return the video track (int) or -1 if none
762 VLC_PUBLIC_API int libvlc_video_get_track( libvlc_media_player_t * );
767 * \param p_mi media player
768 * \param i_track the track (int)
769 * \return 0 on success, -1 if out of range
772 int libvlc_video_set_track( libvlc_media_player_t *, int );
775 * Take a snapshot of the current video window.
777 * If i_width AND i_height is 0, original size is used.
778 * If i_width XOR i_height is 0, original aspect-ratio is preserved.
780 * \param p_mi media player instance
781 * \param num number of video output (typically 0 for the first/only one)
782 * \param psz_filepath the path where to save the screenshot to
783 * \param i_width the snapshot's width
784 * \param i_height the snapshot's height
785 * \return 0 on success, -1 if the video was not found
788 int libvlc_video_take_snapshot( libvlc_media_player_t *, unsigned num,
789 const char *,unsigned int, unsigned int );
792 * Enable or disable deinterlace filter
794 * \param p_mi libvlc media player
795 * \param psz_mode type of deinterlace filter, NULL to disable
797 VLC_PUBLIC_API void libvlc_video_set_deinterlace( libvlc_media_player_t *,
801 * Get an integer marquee option value
803 * \param p_mi libvlc media player
804 * \param option marq option to get \see libvlc_video_marquee_int_option_t
805 * \param p_e an initialized exception pointer
807 VLC_PUBLIC_API int libvlc_video_get_marquee_int( libvlc_media_player_t *,
808 unsigned, libvlc_exception_t * );
811 * Get a string marquee option value
813 * \param p_mi libvlc media player
814 * \param option marq option to get \see libvlc_video_marquee_string_option_t
815 * \param p_e an initialized exception pointer
817 VLC_PUBLIC_API char *libvlc_video_get_marquee_string( libvlc_media_player_t *,
818 unsigned, libvlc_exception_t * );
821 * Enable, disable or set an integer marquee option
823 * Setting libvlc_marquee_Enable has the side effect of enabling (arg !0)
824 * or disabling (arg 0) the marq filter.
826 * \param p_mi libvlc media player
827 * \param option marq option to set \see libvlc_video_marquee_int_option_t
828 * \param i_val marq option value
829 * \param p_e an initialized exception pointer
831 VLC_PUBLIC_API void libvlc_video_set_marquee_int( libvlc_media_player_t *,
832 unsigned, int, libvlc_exception_t * );
835 * Set a marquee string option
837 * \param p_mi libvlc media player
838 * \param option marq option to set \see libvlc_video_marquee_string_option_t
839 * \param psz_text marq option value
840 * \param p_e an initialized exception pointer
842 VLC_PUBLIC_API void libvlc_video_set_marquee_string( libvlc_media_player_t *,
843 unsigned, const char *, libvlc_exception_t * );
845 /** option values for libvlc_video_{get,set}_logo_{int,string} */
846 enum libvlc_video_logo_option_t {
848 libvlc_logo_file, /**< string argument, "file,d,t;file,d,t;..." */
854 libvlc_logo_position,
858 * Get integer logo option.
860 * \param p_mi libvlc media player instance
861 * \param option logo option to get, values of libvlc_video_logo_option_t
862 * \param p_e an pointer to an initialized exception object
864 VLC_PUBLIC_API int libvlc_video_get_logo_int( libvlc_media_player_t *p_mi,
865 unsigned option, libvlc_exception_t *p_e );
868 * Set logo option as integer. Options that take a different type value
869 * cause an invalid argument exception.
870 * Passing libvlc_logo_enable as option value has the side effect of
871 * starting (arg !0) or stopping (arg 0) the logo filter.
873 * \param p_mi libvlc media player instance
874 * \param option logo option to set, values of libvlc_video_logo_option_t
875 * \param value logo option value
876 * \param p_e an pointer to an initialized exception object
878 VLC_PUBLIC_API void libvlc_video_set_logo_int( libvlc_media_player_t *p_mi,
879 unsigned option, int value, libvlc_exception_t *p_e );
882 * Set logo option as string. Options that take a different type value
883 * cause an invalid argument exception.
885 * \param p_mi libvlc media player instance
886 * \param option logo option to set, values of libvlc_video_logo_option_t
887 * \param psz_value logo option value
888 * \param p_e an pointer to an initialized exception object
890 VLC_PUBLIC_API void libvlc_video_set_logo_string( libvlc_media_player_t *p_mi,
891 unsigned option, const char *psz_value, libvlc_exception_t *p_e );
896 /** \defgroup libvlc_audio libvlc_audio
897 * \ingroup libvlc_media_player
898 * LibVLC Audio handling
905 typedef enum libvlc_audio_output_device_types_t {
906 libvlc_AudioOutputDevice_Error = -1,
907 libvlc_AudioOutputDevice_Mono = 1,
908 libvlc_AudioOutputDevice_Stereo = 2,
909 libvlc_AudioOutputDevice_2F2R = 4,
910 libvlc_AudioOutputDevice_3F2R = 5,
911 libvlc_AudioOutputDevice_5_1 = 6,
912 libvlc_AudioOutputDevice_6_1 = 7,
913 libvlc_AudioOutputDevice_7_1 = 8,
914 libvlc_AudioOutputDevice_SPDIF = 10
915 } libvlc_audio_output_device_types_t;
920 typedef enum libvlc_audio_output_channel_t {
921 libvlc_AudioChannel_Error = -1,
922 libvlc_AudioChannel_Stereo = 1,
923 libvlc_AudioChannel_RStereo = 2,
924 libvlc_AudioChannel_Left = 3,
925 libvlc_AudioChannel_Right = 4,
926 libvlc_AudioChannel_Dolbys = 5
927 } libvlc_audio_output_channel_t;
931 * Get the list of available audio outputs
933 * \param p_instance libvlc instance
934 * \return list of available audio outputs. It must be freed it with
935 * \see libvlc_audio_output_list_release \see libvlc_audio_output_t .
936 * In case of error, NULL is returned.
938 VLC_PUBLIC_API libvlc_audio_output_t *
939 libvlc_audio_output_list_get( libvlc_instance_t * );
942 * Free the list of available audio outputs
944 * \param p_list list with audio outputs for release
946 VLC_PUBLIC_API void libvlc_audio_output_list_release( libvlc_audio_output_t * );
949 * Set the audio output.
950 * Change will be applied after stop and play.
952 * \param mp media player
953 * \param psz_name name of audio output,
954 * use psz_name of \see libvlc_audio_output_t
955 * \return true if function succeded
957 VLC_PUBLIC_API int libvlc_audio_output_set( libvlc_media_player_t *,
961 * Get count of devices for audio output, these devices are hardware oriented
962 * like analor or digital output of sound card
964 * \param p_instance libvlc instance
965 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
966 * \return number of devices
968 VLC_PUBLIC_API int libvlc_audio_output_device_count( libvlc_instance_t *,
972 * Get long name of device, if not available short name given
974 * \param p_instance libvlc instance
975 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
976 * \param i_device device index
977 * \return long name of device
979 VLC_PUBLIC_API char * libvlc_audio_output_device_longname( libvlc_instance_t *,
984 * Get id name of device
986 * \param p_instance libvlc instance
987 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
988 * \param i_device device index
989 * \return id name of device, use for setting device, need to be free after use
991 VLC_PUBLIC_API char * libvlc_audio_output_device_id( libvlc_instance_t *,
996 * Set audio output device. Changes are only effective after stop and play.
998 * \param mp media player
999 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1000 * \param psz_device_id device
1002 VLC_PUBLIC_API void libvlc_audio_output_device_set( libvlc_media_player_t *,
1007 * Get current audio device type. Device type describes something like
1008 * character of output sound - stereo sound, 2.1, 5.1 etc
1010 * \param mp media player
1011 * \return the audio devices type \see libvlc_audio_output_device_types_t
1013 VLC_PUBLIC_API int libvlc_audio_output_get_device_type(
1014 libvlc_media_player_t * );
1017 * Set current audio device type.
1019 * \param mp vlc instance
1020 * \param device_type the audio device type,
1021 according to \see libvlc_audio_output_device_types_t
1022 * \param p_e an initialized exception pointer
1024 VLC_PUBLIC_API void libvlc_audio_output_set_device_type( libvlc_media_player_t *,
1029 * Toggle mute status.
1031 * \param mp media player
1033 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_media_player_t * );
1036 * Get current mute status.
1038 * \param mp media player
1039 * \return the mute status (boolean)
1041 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_media_player_t * );
1046 * \param mp media player
1047 * \param status If status is true then mute, otherwise unmute
1049 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_media_player_t *, int );
1052 * Get current audio level.
1054 * \param mp media player
1055 * \param p_e an initialized exception pointer
1056 * \return the audio level (int)
1058 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_media_player_t * );
1061 * Set current audio level.
1063 * \param mp media player
1064 * \param i_volume the volume (int)
1065 * \return 0 if the volume was set, -1 if it was out of range
1067 VLC_PUBLIC_API int libvlc_audio_set_volume( libvlc_media_player_t *, int );
1070 * Get number of available audio tracks.
1072 * \param p_mi media player
1073 * \return the number of available audio tracks (int), or -1 if unavailable
1075 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t * );
1078 * Get the description of available audio tracks.
1080 * \param p_mi media player
1081 * \return list with description of available audio tracks, or NULL
1083 VLC_PUBLIC_API libvlc_track_description_t *
1084 libvlc_audio_get_track_description( libvlc_media_player_t * );
1087 * Get current audio track.
1089 * \param p_mi media player
1090 * \return the audio track (int), or -1 if none.
1092 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t * );
1095 * Set current audio track.
1097 * \param p_mi media player
1098 * \param i_track the track (int)
1099 * \return 0 on success, -1 on error
1101 VLC_PUBLIC_API int libvlc_audio_set_track( libvlc_media_player_t *, int );
1104 * Get current audio channel.
1106 * \param mp media player
1107 * \return the audio channel \see libvlc_audio_output_channel_t
1109 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_media_player_t * );
1112 * Set current audio channel.
1114 * \param p_mi media player
1115 * \param channel the audio channel, \see libvlc_audio_output_channel_t
1116 * \return 0 on success, -1 on error
1118 VLC_PUBLIC_API int libvlc_audio_set_channel( libvlc_media_player_t *, int );
1122 /** @} media_player */
1128 #endif /* VLC_LIBVLC_MEDIA_PLAYER_H */