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
225 VLC_PUBLIC_API void libvlc_media_player_set_agl ( libvlc_media_player_t *p_mi, uint32_t drawable );
228 * Get the agl handler previously set with libvlc_media_player_set_agl().
230 * \param p_mi the Media Player
231 * \return the agl handler or 0 if none where set
233 VLC_PUBLIC_API uint32_t libvlc_media_player_get_agl ( libvlc_media_player_t *p_mi );
236 * Set an X Window System drawable where the media player should render its
237 * video output. If LibVLC was built without X11 output support, then this has
240 * The specified identifier must correspond to an existing Input/Output class
241 * X11 window. Pixmaps are <b>not</b> supported. The caller shall ensure that
242 * the X11 server is the same as the one the VLC instance has been configured
244 * If XVideo is <b>not</b> used, it is assumed that the drawable has the
245 * following properties in common with the default X11 screen: depth, scan line
246 * pad, black pixel. This is a bug.
248 * \param p_mi the Media Player
249 * \param drawable the ID of the X window
251 VLC_PUBLIC_API void libvlc_media_player_set_xwindow ( libvlc_media_player_t *p_mi, uint32_t drawable );
254 * Get the X Window System window identifier previously set with
255 * libvlc_media_player_set_xwindow(). Note that this will return the identifier
256 * even if VLC is not currently using it (for instance if it is playing an
259 * \param p_mi the Media Player
260 * \return an X window ID, or 0 if none where set.
262 VLC_PUBLIC_API uint32_t libvlc_media_player_get_xwindow ( libvlc_media_player_t *p_mi );
265 * Set a Win32/Win64 API window handle (HWND) where the media player should
266 * render its video output. If LibVLC was built without Win32/Win64 API output
267 * support, then this has no effects.
269 * \param p_mi the Media Player
270 * \param drawable windows handle of the drawable
272 VLC_PUBLIC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi, void *drawable );
275 * Get the Windows API window handle (HWND) previously set with
276 * libvlc_media_player_set_hwnd(). The handle will be returned even if LibVLC
277 * is not currently outputting any video to it.
279 * \param p_mi the Media Player
280 * \return a window handle or NULL if there are none.
282 VLC_PUBLIC_API void *libvlc_media_player_get_hwnd ( libvlc_media_player_t *p_mi );
286 /** \bug This might go away ... to be replaced by a broader system */
289 * Get the current movie length (in ms).
291 * \param p_mi the Media Player
292 * \return the movie length (in ms), or -1 if there is no media.
294 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_length( libvlc_media_player_t * );
297 * Get the current movie time (in ms).
299 * \param p_mi the Media Player
300 * \return the movie time (in ms), or -1 if there is no media.
302 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_time( libvlc_media_player_t * );
305 * Set the movie time (in ms). This has no effect if no media is being played.
306 * Not all formats and protocols support this.
308 * \param p_mi the Media Player
309 * \param the movie time (in ms).
311 VLC_PUBLIC_API void libvlc_media_player_set_time( libvlc_media_player_t *, libvlc_time_t );
314 * Get movie position.
316 * \param p_mi the Media Player
317 * \return movie position, or -1. in case of error
319 VLC_PUBLIC_API float libvlc_media_player_get_position( libvlc_media_player_t * );
322 * Set movie position. This has no effect if playback is not enabled.
323 * This might not work depending on the underlying input format and protocol.
325 * \param p_mi the Media Player
326 * \param f_pos the position
328 VLC_PUBLIC_API void libvlc_media_player_set_position( libvlc_media_player_t *, float );
331 * Set movie chapter (if applicable).
333 * \param p_mi the Media Player
334 * \param i_chapter chapter number to play
336 VLC_PUBLIC_API void libvlc_media_player_set_chapter( libvlc_media_player_t *, int );
341 * \param p_mi the Media Player
342 * \return chapter number currently playing, or -1 if there is no media.
344 VLC_PUBLIC_API int libvlc_media_player_get_chapter( libvlc_media_player_t * );
347 * Get movie chapter count
349 * \param p_mi the Media Player
350 * \return number of chapters in movie, or -1.
352 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count( libvlc_media_player_t * );
355 * Is the player able to play
357 * \param p_mi the Media Player
360 VLC_PUBLIC_API int libvlc_media_player_will_play( libvlc_media_player_t * );
363 * Get title chapter count
365 * \param p_mi the Media Player
366 * \param i_title title
367 * \return number of chapters in title, or -1
369 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count_for_title(
370 libvlc_media_player_t *, int );
375 * \param p_mi the Media Player
376 * \param i_title title number to play
378 VLC_PUBLIC_API void libvlc_media_player_set_title( libvlc_media_player_t *, int );
383 * \param p_mi the Media Player
384 * \return title number currently playing, or -1
386 VLC_PUBLIC_API int libvlc_media_player_get_title( libvlc_media_player_t * );
389 * Get movie title count
391 * \param p_mi the Media Player
392 * \return title number count, or -1
394 VLC_PUBLIC_API int libvlc_media_player_get_title_count( libvlc_media_player_t * );
397 * Set previous chapter (if applicable)
399 * \param p_mi the Media Player
401 VLC_PUBLIC_API void libvlc_media_player_previous_chapter( libvlc_media_player_t * );
404 * Set next chapter (if applicable)
406 * \param p_mi the Media Player
408 VLC_PUBLIC_API void libvlc_media_player_next_chapter( libvlc_media_player_t * );
411 * Get movie play rate
413 * \param p_mi the Media Player
414 * \return movie play rate, or zero in case of error
416 VLC_PUBLIC_API float libvlc_media_player_get_rate( libvlc_media_player_t * );
419 * Set movie play rate
421 * \param p_mi the Media Player
422 * \param movie play rate to set
423 * \return -1 if an error was detected, 0 otherwise (but even then, it might
424 * not actually work depending on the underlying media protocol)
426 VLC_PUBLIC_API int libvlc_media_player_set_rate( libvlc_media_player_t *, float );
429 * Get current movie state
431 * \param p_mi the Media Player
433 VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *);
438 * \param p_mi the Media Player
439 * \return frames per second (fps) for this playing movie, or 0 if unspecified
441 VLC_PUBLIC_API float libvlc_media_player_get_fps( libvlc_media_player_t * );
446 * How many video outputs does this media player have?
448 * \param p_md the media player
449 * \return the number of video outputs
451 VLC_PUBLIC_API unsigned libvlc_media_player_has_vout( libvlc_media_player_t * );
454 * Is this media player seekable?
456 * \param p_input the input
458 VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi );
461 * Can this media player be paused?
463 * \param p_input the input
465 VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi );
469 * Display the next frame (if supported)
471 * \param p_input the libvlc_media_player_t instance
473 VLC_PUBLIC_API void libvlc_media_player_next_frame( libvlc_media_player_t *p_input );
478 * Release (free) libvlc_track_description_t
480 * \param p_track_description the structure to release
482 VLC_PUBLIC_API void libvlc_track_description_release( libvlc_track_description_t *p_track_description );
484 /** \defgroup libvlc_video libvlc_video
485 * \ingroup libvlc_media_player
486 * LibVLC Video handling
491 * Toggle fullscreen status on non-embedded video outputs.
493 * @warning The same limitations applies to this function
494 * as to libvlc_set_fullscreen().
496 * \param p_mediaplayer the media player
498 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t * );
501 * Enable or disable fullscreen on non-embedded video outputs.
503 * @warning With most window managers, only a top-level windows can switch to
504 * full-screen mode. Hence, this function will not operate properly if
505 * libvlc_media_player_set_xid() or libvlc_media_player_set_hwnd() was
506 * used to embed the video in a non-LibVLC widget. If you want to to render an
507 * embedded LibVLC video full-screen, the parent embedding widget must expanded
508 * to full screen (LibVLC cannot take care of that).
509 * LibVLC will then automatically resize the video as appropriate.
511 * \param p_mediaplayer the media player
512 * \param b_fullscreen boolean for fullscreen status
514 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *, int );
517 * Get current fullscreen status.
519 * \param p_mediaplayer the media player
520 * \return the fullscreen status (boolean)
522 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t * );
525 * Enable or disable key press events handling, according to the LibVLC hotkeys
526 * configuration. By default and for historical reasons, keyboard events are
527 * handled by the LibVLC video widget.
529 * \note On X11, there can be only one subscriber for key press and mouse
530 * click events per window. If your application has subscribed to those events
531 * for the X window ID of the video widget, then LibVLC will not be able to
532 * handle key presses and mouse clicks in any case.
534 * \warning This function is only implemented for X11 at the moment.
536 * \param mp the media player
537 * \param on true to handle key press events, false to ignore them.
540 void libvlc_video_set_key_input( libvlc_media_player_t *mp, unsigned on );
543 * Enable or disable mouse click events handling. By default, those events are
544 * handled. This is needed for DVD menus to work, as well as a few video
545 * filters such as "puzzle".
547 * \note See also \func libvlc_video_set_key_input().
549 * \warning This function is only implemented for X11 at the moment.
551 * \param mp the media player
552 * \param on true to handle mouse click events, false to ignore them.
555 void libvlc_video_set_mouse_input( libvlc_media_player_t *mp, unsigned on );
558 * Get the pixel dimensions of a video.
560 * \param mp media player
561 * \param num number of the video (starting from, and most commonly 0)
562 * \param px pointer to get the pixel width [OUT]
563 * \param py pointer to get the pixel height [OUT]
564 * \return 0 on success, -1 if the specified video does not exist
567 int libvlc_video_get_size( libvlc_media_player_t *mp, unsigned num,
568 unsigned *px, unsigned *py );
571 * Get current video height.
572 * You should use libvlc_video_get_size() instead.
574 * \param p_mediaplayer the media player
575 * \return the video pixel height or 0 if not applicable
578 int libvlc_video_get_height( libvlc_media_player_t * );
581 * Get current video width.
582 * You should use libvlc_video_get_size() instead.
584 * \param p_mediaplayer the media player
585 * \return the video pixel width or 0 if not applicable
588 int libvlc_video_get_width( libvlc_media_player_t * );
591 * Get the current video scaling factor.
592 * See also libvlc_video_set_scale().
594 * \param p_mediaplayer the media player
595 * \return the currently configured zoom factor, or 0. if the video is set
596 * to fit to the output window/drawable automatically.
598 VLC_PUBLIC_API float libvlc_video_get_scale( libvlc_media_player_t * );
601 * Set the video scaling factor. That is the ratio of the number of pixels on
602 * screen to the number of pixels in the original decoded video in each
603 * dimension. Zero is a special value; it will adjust the video to the output
604 * window/drawable (in windowed mode) or the entire screen.
606 * Note that not all video outputs support scaling.
608 * \param p_mediaplayer the media player
609 * \param i_factor the scaling factor, or zero
611 VLC_PUBLIC_API void libvlc_video_set_scale( libvlc_media_player_t *, float );
614 * Get current video aspect ratio.
616 * \param p_mediaplayer the media player
617 * \return the video aspect ratio or NULL if unspecified
618 * (the result must be released with free() or libvlc_free()).
620 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t * );
623 * Set new video aspect ratio.
625 * \param p_mediaplayer the media player
626 * \param psz_aspect new video aspect-ratio or NULL to reset to default
627 * \note Invalid aspect ratios are ignored.
629 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *, const char * );
632 * Get current video subtitle.
634 * \param p_mediaplayer the media player
635 * \return the video subtitle selected, or -1 if none
637 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t * );
640 * Get the number of available video subtitles.
642 * \param p_mediaplayer the media player
643 * \return the number of available video subtitles
645 VLC_PUBLIC_API int libvlc_video_get_spu_count( libvlc_media_player_t * );
648 * Get the description of available video subtitles.
650 * \param p_mediaplayer the media player
651 * \return list containing description of available video subtitles
653 VLC_PUBLIC_API libvlc_track_description_t *
654 libvlc_video_get_spu_description( libvlc_media_player_t * );
657 * Set new video subtitle.
659 * \param p_mediaplayer the media player
660 * \param i_spu new video subtitle to select
661 * \return 0 on success, -1 if out of range
663 VLC_PUBLIC_API int libvlc_video_set_spu( libvlc_media_player_t *, unsigned );
666 * Set new video subtitle file.
668 * \param p_mediaplayer the media player
669 * \param psz_subtitle new video subtitle file
670 * \return the success status (boolean)
672 VLC_PUBLIC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *, const char * );
675 * Get the description of available titles.
677 * \param p_mediaplayer the media player
678 * \return list containing description of available titles
680 VLC_PUBLIC_API libvlc_track_description_t *
681 libvlc_video_get_title_description( libvlc_media_player_t * );
684 * Get the description of available chapters for specific title.
686 * \param p_mediaplayer the media player
687 * \param i_title selected title
688 * \return list containing description of available chapter for title i_title
690 VLC_PUBLIC_API libvlc_track_description_t *
691 libvlc_video_get_chapter_description( libvlc_media_player_t *, int );
694 * Get current crop filter geometry.
696 * \param p_mediaplayer the media player
697 * \return the crop filter geometry or NULL if unset
699 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t * );
702 * Set new crop filter geometry.
704 * \param p_mediaplayer the media player
705 * \param psz_geometry new crop filter geometry (NULL to unset)
708 void libvlc_video_set_crop_geometry( libvlc_media_player_t *, const char * );
711 * Get current teletext page requested.
713 * \param p_mediaplayer the media player
714 * \return the current teletext page requested.
716 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t * );
719 * Set new teletext page to retrieve.
721 * \param p_mediaplayer the media player
722 * \param i_page teletex page number requested
724 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *, int );
727 * Toggle teletext transparent status on video output.
729 * \param p_mediaplayer the media player
731 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t * );
734 * Get number of available video tracks.
736 * \param p_mi media player
737 * \return the number of available video tracks (int)
739 VLC_PUBLIC_API int libvlc_video_get_track_count( libvlc_media_player_t * );
742 * Get the description of available video tracks.
744 * \param p_mi media player
745 * \return list with description of available video tracks, or NULL on error
747 VLC_PUBLIC_API libvlc_track_description_t *
748 libvlc_video_get_track_description( libvlc_media_player_t * );
751 * Get current video track.
753 * \param p_mi media player
754 * \return the video track (int) or -1 if none
756 VLC_PUBLIC_API int libvlc_video_get_track( libvlc_media_player_t * );
761 * \param p_mi media player
762 * \param i_track the track (int)
763 * \return 0 on success, -1 if out of range
766 int libvlc_video_set_track( libvlc_media_player_t *, int );
769 * Take a snapshot of the current video window.
771 * If i_width AND i_height is 0, original size is used.
772 * If i_width XOR i_height is 0, original aspect-ratio is preserved.
774 * \param p_mi media player instance
775 * \param num number of video output (typically 0 for the first/only one)
776 * \param psz_filepath the path where to save the screenshot to
777 * \param i_width the snapshot's width
778 * \param i_height the snapshot's height
779 * \return 0 on success, -1 if the video was not found
782 int libvlc_video_take_snapshot( libvlc_media_player_t *, unsigned num,
783 const char *,unsigned int, unsigned int );
786 * Enable or disable deinterlace filter
788 * \param p_mi libvlc media player
789 * \param psz_mode type of deinterlace filter, NULL to disable
791 VLC_PUBLIC_API void libvlc_video_set_deinterlace( libvlc_media_player_t *,
795 * Get an integer marquee option value
797 * \param p_mi libvlc media player
798 * \param option marq option to get \see libvlc_video_marquee_int_option_t
800 VLC_PUBLIC_API int libvlc_video_get_marquee_int( libvlc_media_player_t *,
804 * Get a string marquee option value
806 * \param p_mi libvlc media player
807 * \param option marq option to get \see libvlc_video_marquee_string_option_t
809 VLC_PUBLIC_API char *libvlc_video_get_marquee_string( libvlc_media_player_t *,
813 * Enable, disable or set an integer marquee option
815 * Setting libvlc_marquee_Enable has the side effect of enabling (arg !0)
816 * or disabling (arg 0) the marq filter.
818 * \param p_mi libvlc media player
819 * \param option marq option to set \see libvlc_video_marquee_int_option_t
820 * \param i_val marq option value
822 VLC_PUBLIC_API void libvlc_video_set_marquee_int( libvlc_media_player_t *,
826 * Set a marquee string option
828 * \param p_mi libvlc media player
829 * \param option marq option to set \see libvlc_video_marquee_string_option_t
830 * \param psz_text marq option value
832 VLC_PUBLIC_API void libvlc_video_set_marquee_string( libvlc_media_player_t *,
833 unsigned, const char * );
835 /** option values for libvlc_video_{get,set}_logo_{int,string} */
836 enum libvlc_video_logo_option_t {
838 libvlc_logo_file, /**< string argument, "file,d,t;file,d,t;..." */
844 libvlc_logo_position,
848 * Get integer logo option.
850 * \param p_mi libvlc media player instance
851 * \param option logo option to get, values of libvlc_video_logo_option_t
853 VLC_PUBLIC_API int libvlc_video_get_logo_int( libvlc_media_player_t *p_mi,
857 * Set logo option as integer. Options that take a different type value
859 * Passing libvlc_logo_enable as option value has the side effect of
860 * starting (arg !0) or stopping (arg 0) the logo filter.
862 * \param p_mi libvlc media player instance
863 * \param option logo option to set, values of libvlc_video_logo_option_t
864 * \param value logo option value
866 VLC_PUBLIC_API void libvlc_video_set_logo_int( libvlc_media_player_t *p_mi,
867 unsigned option, int value );
870 * Set logo option as string. Options that take a different type value
873 * \param p_mi libvlc media player instance
874 * \param option logo option to set, values of libvlc_video_logo_option_t
875 * \param psz_value logo option value
877 VLC_PUBLIC_API void libvlc_video_set_logo_string( libvlc_media_player_t *p_mi,
878 unsigned option, const char *psz_value );
883 /** \defgroup libvlc_audio libvlc_audio
884 * \ingroup libvlc_media_player
885 * LibVLC Audio handling
892 typedef enum libvlc_audio_output_device_types_t {
893 libvlc_AudioOutputDevice_Error = -1,
894 libvlc_AudioOutputDevice_Mono = 1,
895 libvlc_AudioOutputDevice_Stereo = 2,
896 libvlc_AudioOutputDevice_2F2R = 4,
897 libvlc_AudioOutputDevice_3F2R = 5,
898 libvlc_AudioOutputDevice_5_1 = 6,
899 libvlc_AudioOutputDevice_6_1 = 7,
900 libvlc_AudioOutputDevice_7_1 = 8,
901 libvlc_AudioOutputDevice_SPDIF = 10
902 } libvlc_audio_output_device_types_t;
907 typedef enum libvlc_audio_output_channel_t {
908 libvlc_AudioChannel_Error = -1,
909 libvlc_AudioChannel_Stereo = 1,
910 libvlc_AudioChannel_RStereo = 2,
911 libvlc_AudioChannel_Left = 3,
912 libvlc_AudioChannel_Right = 4,
913 libvlc_AudioChannel_Dolbys = 5
914 } libvlc_audio_output_channel_t;
918 * Get the list of available audio outputs
920 * \param p_instance libvlc instance
921 * \return list of available audio outputs. It must be freed it with
922 * \see libvlc_audio_output_list_release \see libvlc_audio_output_t .
923 * In case of error, NULL is returned.
925 VLC_PUBLIC_API libvlc_audio_output_t *
926 libvlc_audio_output_list_get( libvlc_instance_t * );
929 * Free the list of available audio outputs
931 * \param p_list list with audio outputs for release
933 VLC_PUBLIC_API void libvlc_audio_output_list_release( libvlc_audio_output_t * );
936 * Set the audio output.
937 * Change will be applied after stop and play.
939 * \param mp media player
940 * \param psz_name name of audio output,
941 * use psz_name of \see libvlc_audio_output_t
942 * \return true if function succeded
944 VLC_PUBLIC_API int libvlc_audio_output_set( libvlc_media_player_t *,
948 * Get count of devices for audio output, these devices are hardware oriented
949 * like analor or digital output of sound card
951 * \param p_instance libvlc instance
952 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
953 * \return number of devices
955 VLC_PUBLIC_API int libvlc_audio_output_device_count( libvlc_instance_t *,
959 * Get long name of device, if not available short name given
961 * \param p_instance libvlc instance
962 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
963 * \param i_device device index
964 * \return long name of device
966 VLC_PUBLIC_API char * libvlc_audio_output_device_longname( libvlc_instance_t *,
971 * Get id name of device
973 * \param p_instance libvlc instance
974 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
975 * \param i_device device index
976 * \return id name of device, use for setting device, need to be free after use
978 VLC_PUBLIC_API char * libvlc_audio_output_device_id( libvlc_instance_t *,
983 * Set audio output device. Changes are only effective after stop and play.
985 * \param mp media player
986 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
987 * \param psz_device_id device
989 VLC_PUBLIC_API void libvlc_audio_output_device_set( libvlc_media_player_t *,
994 * Get current audio device type. Device type describes something like
995 * character of output sound - stereo sound, 2.1, 5.1 etc
997 * \param mp media player
998 * \return the audio devices type \see libvlc_audio_output_device_types_t
1000 VLC_PUBLIC_API int libvlc_audio_output_get_device_type(
1001 libvlc_media_player_t * );
1004 * Set current audio device type.
1006 * \param mp vlc instance
1007 * \param device_type the audio device type,
1008 according to \see libvlc_audio_output_device_types_t
1010 VLC_PUBLIC_API void libvlc_audio_output_set_device_type( libvlc_media_player_t *,
1015 * Toggle mute status.
1017 * \param mp media player
1019 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_media_player_t * );
1022 * Get current mute status.
1024 * \param mp media player
1025 * \return the mute status (boolean)
1027 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_media_player_t * );
1032 * \param mp media player
1033 * \param status If status is true then mute, otherwise unmute
1035 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_media_player_t *, int );
1038 * Get current audio level.
1040 * \param mp media player
1041 * \return the audio level (int)
1043 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_media_player_t * );
1046 * Set current audio level.
1048 * \param mp media player
1049 * \param i_volume the volume (int)
1050 * \return 0 if the volume was set, -1 if it was out of range
1052 VLC_PUBLIC_API int libvlc_audio_set_volume( libvlc_media_player_t *, int );
1055 * Get number of available audio tracks.
1057 * \param p_mi media player
1058 * \return the number of available audio tracks (int), or -1 if unavailable
1060 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t * );
1063 * Get the description of available audio tracks.
1065 * \param p_mi media player
1066 * \return list with description of available audio tracks, or NULL
1068 VLC_PUBLIC_API libvlc_track_description_t *
1069 libvlc_audio_get_track_description( libvlc_media_player_t * );
1072 * Get current audio track.
1074 * \param p_mi media player
1075 * \return the audio track (int), or -1 if none.
1077 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t * );
1080 * Set current audio track.
1082 * \param p_mi media player
1083 * \param i_track the track (int)
1084 * \return 0 on success, -1 on error
1086 VLC_PUBLIC_API int libvlc_audio_set_track( libvlc_media_player_t *, int );
1089 * Get current audio channel.
1091 * \param mp media player
1092 * \return the audio channel \see libvlc_audio_output_channel_t
1094 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_media_player_t * );
1097 * Set current audio channel.
1099 * \param p_mi media player
1100 * \param channel the audio channel, \see libvlc_audio_output_channel_t
1101 * \return 0 on success, -1 on error
1103 VLC_PUBLIC_API int libvlc_audio_set_channel( libvlc_media_player_t *, int );
1107 /** @} media_player */
1113 #endif /* VLC_LIBVLC_MEDIA_PLAYER_H */