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 *p_libvlc_instance );
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 *p_md );
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 *p_mi );
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 *p_mi );
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 *p_mi,
145 libvlc_media_t *p_md );
148 * Get the media used by the media_player.
150 * \param p_mi the Media Player
151 * \return the media associated with p_mi, or NULL if no
152 * media is associated
154 VLC_PUBLIC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t *p_mi );
157 * Get the Event Manager from which the media player send event.
159 * \param p_mi the Media Player
160 * \return the event manager associated with p_mi
162 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *p_mi );
167 * \param p_mi the Media Player
168 * \return 1 if the media player is playing, 0 otherwise
170 VLC_PUBLIC_API int libvlc_media_player_is_playing ( libvlc_media_player_t *p_mi );
175 * \param p_mi the Media Player
176 * \return 0 if playback started (and was already started), or -1 on error.
178 VLC_PUBLIC_API int libvlc_media_player_play ( libvlc_media_player_t *p_mi );
181 * Toggle pause (no effect if there is no media)
183 * \param p_mi the Media Player
185 VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *p_mi );
188 * Stop (no effect if there is no media)
190 * \param p_mi the Media Player
192 VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *p_mi );
195 * Set the NSView handler where the media player should render its video output.
197 * The object minimal_macosx expects is of kind NSObject and should
198 * respect the protocol:
200 * @protocol VLCOpenGLVideoViewEmbedding <NSObject>
201 * - (void)addVoutSubview:(NSView *)view;
202 * - (void)removeVoutSubview:(NSView *)view;
205 * You can find a live example in VLCVideoView in VLCKit.framework.
207 * \param p_mi the Media Player
208 * \param drawable the NSView handler
210 VLC_PUBLIC_API void libvlc_media_player_set_nsobject ( libvlc_media_player_t *p_mi, void * drawable );
213 * Get the NSView handler previously set with libvlc_media_player_set_nsobject().
215 * \param p_mi the Media Player
216 * \return the NSView handler or 0 if none where set
218 VLC_PUBLIC_API void * libvlc_media_player_get_nsobject ( libvlc_media_player_t *p_mi );
221 * Set the agl handler where the media player should render its video output.
223 * \param p_mi the Media Player
224 * \param drawable the agl handler
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 *p_mi );
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 *p_mi );
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 i_time the movie time (in ms).
312 VLC_PUBLIC_API void libvlc_media_player_set_time( libvlc_media_player_t *p_mi, libvlc_time_t i_time );
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 *p_mi );
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 *p_mi, float f_pos );
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 *p_mi, int i_chapter );
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 *p_mi );
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 *p_mi );
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 *p_mi );
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 *p_mi, int i_title );
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 *p_mi, int i_title );
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 *p_mi );
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 *p_mi );
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 *p_mi );
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 *p_mi );
412 * Get the requested movie play rate.
413 * @warning Depending on the underlying media, the requested rate may be
414 * different from the real playback rate.
416 * \param p_mi the Media Player
417 * \return movie play rate
419 VLC_PUBLIC_API float libvlc_media_player_get_rate( libvlc_media_player_t *p_mi );
422 * Set movie play rate
424 * \param p_mi the Media Player
425 * \param rate movie play rate to set
426 * \return -1 if an error was detected, 0 otherwise (but even then, it might
427 * not actually work depending on the underlying media protocol)
429 VLC_PUBLIC_API int libvlc_media_player_set_rate( libvlc_media_player_t *p_mi, float rate );
432 * Get current movie state
434 * \param p_mi the Media Player
436 VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *p_mi );
441 * \param p_mi the Media Player
442 * \return frames per second (fps) for this playing movie, or 0 if unspecified
444 VLC_PUBLIC_API float libvlc_media_player_get_fps( libvlc_media_player_t *p_mi );
449 * How many video outputs does this media player have?
451 * \param p_mi the media player
452 * \return the number of video outputs
454 VLC_PUBLIC_API unsigned libvlc_media_player_has_vout( libvlc_media_player_t *p_mi );
457 * Is this media player seekable?
459 * \param p_mi the media player
461 VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi );
464 * Can this media player be paused?
466 * \param p_mi the media player
468 VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi );
472 * Display the next frame (if supported)
474 * \param p_mi the media player
476 VLC_PUBLIC_API void libvlc_media_player_next_frame( libvlc_media_player_t *p_mi );
481 * Release (free) libvlc_track_description_t
483 * \param p_track_description the structure to release
485 VLC_PUBLIC_API void libvlc_track_description_release( libvlc_track_description_t *p_track_description );
487 /** \defgroup libvlc_video libvlc_video
488 * \ingroup libvlc_media_player
489 * LibVLC Video handling
494 * Toggle fullscreen status on non-embedded video outputs.
496 * @warning The same limitations applies to this function
497 * as to libvlc_set_fullscreen().
499 * \param p_mi the media player
501 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *p_mi );
504 * Enable or disable fullscreen on non-embedded video outputs.
506 * @warning With most window managers, only a top-level windows can switch to
507 * full-screen mode. Hence, this function will not operate properly if
508 * libvlc_media_player_set_xid() or libvlc_media_player_set_hwnd() was
509 * used to embed the video in a non-LibVLC widget. If you want to to render an
510 * embedded LibVLC video full-screen, the parent embedding widget must expanded
511 * to full screen (LibVLC cannot take care of that).
512 * LibVLC will then automatically resize the video as appropriate.
514 * \param p_mi the media player
515 * \param b_fullscreen boolean for fullscreen status
517 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *p_mi, int b_fullscreen );
520 * Get current fullscreen status.
522 * \param p_mi the media player
523 * \return the fullscreen status (boolean)
525 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t *p_mi );
528 * Enable or disable key press events handling, according to the LibVLC hotkeys
529 * configuration. By default and for historical reasons, keyboard events are
530 * handled by the LibVLC video widget.
532 * \note On X11, there can be only one subscriber for key press and mouse
533 * click events per window. If your application has subscribed to those events
534 * for the X window ID of the video widget, then LibVLC will not be able to
535 * handle key presses and mouse clicks in any case.
537 * \warning This function is only implemented for X11 at the moment.
539 * \param p_mi the media player
540 * \param on true to handle key press events, false to ignore them.
543 void libvlc_video_set_key_input( libvlc_media_player_t *p_mi, unsigned on );
546 * Enable or disable mouse click events handling. By default, those events are
547 * handled. This is needed for DVD menus to work, as well as a few video
548 * filters such as "puzzle".
550 * \note See also libvlc_video_set_key_input().
552 * \warning This function is only implemented for X11 at the moment.
554 * \param p_mi the media player
555 * \param on true to handle mouse click events, false to ignore them.
558 void libvlc_video_set_mouse_input( libvlc_media_player_t *p_mi, unsigned on );
561 * Get the pixel dimensions of a video.
563 * \param p_mi media player
564 * \param num number of the video (starting from, and most commonly 0)
565 * \param px pointer to get the pixel width [OUT]
566 * \param py pointer to get the pixel height [OUT]
567 * \return 0 on success, -1 if the specified video does not exist
570 int libvlc_video_get_size( libvlc_media_player_t *p_mi, unsigned num,
571 unsigned *px, unsigned *py );
574 * Get current video height.
575 * You should use libvlc_video_get_size() instead.
577 * \param p_mi the media player
578 * \return the video pixel height or 0 if not applicable
581 int libvlc_video_get_height( libvlc_media_player_t *p_mi );
584 * Get current video width.
585 * You should use libvlc_video_get_size() instead.
587 * \param p_mi the media player
588 * \return the video pixel width or 0 if not applicable
591 int libvlc_video_get_width( libvlc_media_player_t *p_mi );
594 * Get the mouse pointer coordinates over a video.
595 * Coordinates are expressed in terms of the decoded video resolution,
596 * <b>not</b> in terms of pixels on the screen/viewport (to get the latter,
597 * you can query your windowing system directly).
599 * Either of the coordinates may be negative or larger than the corresponding
600 * dimension of the video, if the cursor is outside the rendering area.
602 * @warning The coordinates may be out-of-date if the pointer is not located
603 * on the video rendering area. LibVLC does not track the pointer if it is
604 * outside of the video widget.
606 * @note LibVLC does not support multiple pointers (it does of course support
607 * multiple input devices sharing the same pointer) at the moment.
609 * \param p_mi media player
610 * \param num number of the video (starting from, and most commonly 0)
611 * \param px pointer to get the abscissa [OUT]
612 * \param py pointer to get the ordinate [OUT]
613 * \return 0 on success, -1 if the specified video does not exist
616 int libvlc_video_get_cursor( libvlc_media_player_t *p_mi, unsigned num,
620 * Get the current video scaling factor.
621 * See also libvlc_video_set_scale().
623 * \param p_mi the media player
624 * \return the currently configured zoom factor, or 0. if the video is set
625 * to fit to the output window/drawable automatically.
627 VLC_PUBLIC_API float libvlc_video_get_scale( libvlc_media_player_t *p_mi );
630 * Set the video scaling factor. That is the ratio of the number of pixels on
631 * screen to the number of pixels in the original decoded video in each
632 * dimension. Zero is a special value; it will adjust the video to the output
633 * window/drawable (in windowed mode) or the entire screen.
635 * Note that not all video outputs support scaling.
637 * \param p_mi the media player
638 * \param f_factor the scaling factor, or zero
640 VLC_PUBLIC_API void libvlc_video_set_scale( libvlc_media_player_t *p_mi, float f_factor );
643 * Get current video aspect ratio.
645 * \param p_mi the media player
646 * \return the video aspect ratio or NULL if unspecified
647 * (the result must be released with free()).
649 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *p_mi );
652 * Set new video aspect ratio.
654 * \param p_mi the media player
655 * \param psz_aspect new video aspect-ratio or NULL to reset to default
656 * \note Invalid aspect ratios are ignored.
658 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *p_mi, const char *psz_aspect );
661 * Get current video subtitle.
663 * \param p_mi the media player
664 * \return the video subtitle selected, or -1 if none
666 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *p_mi );
669 * Get the number of available video subtitles.
671 * \param p_mi the media player
672 * \return the number of available video subtitles
674 VLC_PUBLIC_API int libvlc_video_get_spu_count( libvlc_media_player_t *p_mi );
677 * Get the description of available video subtitles.
679 * \param p_mi the media player
680 * \return list containing description of available video subtitles
682 VLC_PUBLIC_API libvlc_track_description_t *
683 libvlc_video_get_spu_description( libvlc_media_player_t *p_mi );
686 * Set new video subtitle.
688 * \param p_mi the media player
689 * \param i_spu new video subtitle to select
690 * \return 0 on success, -1 if out of range
692 VLC_PUBLIC_API int libvlc_video_set_spu( libvlc_media_player_t *p_mi, unsigned i_spu );
695 * Set new video subtitle file.
697 * \param p_mi the media player
698 * \param psz_subtitle new video subtitle file
699 * \return the success status (boolean)
701 VLC_PUBLIC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *p_mi, const char *psz_subtitle );
704 * Get the description of available titles.
706 * \param p_mi the media player
707 * \return list containing description of available titles
709 VLC_PUBLIC_API libvlc_track_description_t *
710 libvlc_video_get_title_description( libvlc_media_player_t *p_mi );
713 * Get the description of available chapters for specific title.
715 * \param p_mi the media player
716 * \param i_title selected title
717 * \return list containing description of available chapter for title i_title
719 VLC_PUBLIC_API libvlc_track_description_t *
720 libvlc_video_get_chapter_description( libvlc_media_player_t *p_mi, int i_title );
723 * Get current crop filter geometry.
725 * \param p_mi the media player
726 * \return the crop filter geometry or NULL if unset
728 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *p_mi );
731 * Set new crop filter geometry.
733 * \param p_mi the media player
734 * \param psz_geometry new crop filter geometry (NULL to unset)
737 void libvlc_video_set_crop_geometry( libvlc_media_player_t *p_mi, const char *psz_geometry );
740 * Get current teletext page requested.
742 * \param p_mi the media player
743 * \return the current teletext page requested.
745 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t *p_mi );
748 * Set new teletext page to retrieve.
750 * \param p_mi the media player
751 * \param i_page teletex page number requested
753 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *p_mi, int i_page );
756 * Toggle teletext transparent status on video output.
758 * \param p_mi the media player
760 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *p_mi );
763 * Get number of available video tracks.
765 * \param p_mi media player
766 * \return the number of available video tracks (int)
768 VLC_PUBLIC_API int libvlc_video_get_track_count( libvlc_media_player_t *p_mi );
771 * Get the description of available video tracks.
773 * \param p_mi media player
774 * \return list with description of available video tracks, or NULL on error
776 VLC_PUBLIC_API libvlc_track_description_t *
777 libvlc_video_get_track_description( libvlc_media_player_t *p_mi );
780 * Get current video track.
782 * \param p_mi media player
783 * \return the video track (int) or -1 if none
785 VLC_PUBLIC_API int libvlc_video_get_track( libvlc_media_player_t *p_mi );
790 * \param p_mi media player
791 * \param i_track the track (int)
792 * \return 0 on success, -1 if out of range
795 int libvlc_video_set_track( libvlc_media_player_t *p_mi, int i_track );
798 * Take a snapshot of the current video window.
800 * If i_width AND i_height is 0, original size is used.
801 * If i_width XOR i_height is 0, original aspect-ratio is preserved.
803 * \param p_mi media player instance
804 * \param num number of video output (typically 0 for the first/only one)
805 * \param psz_filepath the path where to save the screenshot to
806 * \param i_width the snapshot's width
807 * \param i_height the snapshot's height
808 * \return 0 on success, -1 if the video was not found
811 int libvlc_video_take_snapshot( libvlc_media_player_t *p_mi, unsigned num,
812 const char *psz_filepath, unsigned int i_width,
813 unsigned int i_height );
816 * Enable or disable deinterlace filter
818 * \param p_mi libvlc media player
819 * \param psz_mode type of deinterlace filter, NULL to disable
821 VLC_PUBLIC_API void libvlc_video_set_deinterlace( libvlc_media_player_t *p_mi,
822 const char *psz_mode );
825 * Get an integer marquee option value
827 * \param p_mi libvlc media player
828 * \param option marq option to get \see libvlc_video_marquee_int_option_t
830 VLC_PUBLIC_API int libvlc_video_get_marquee_int( libvlc_media_player_t *p_mi,
834 * Get a string marquee option value
836 * \param p_mi libvlc media player
837 * \param option marq option to get \see libvlc_video_marquee_string_option_t
839 VLC_PUBLIC_API char *libvlc_video_get_marquee_string( libvlc_media_player_t *p_mi,
843 * Enable, disable or set an integer marquee option
845 * Setting libvlc_marquee_Enable has the side effect of enabling (arg !0)
846 * or disabling (arg 0) the marq filter.
848 * \param p_mi libvlc media player
849 * \param option marq option to set \see libvlc_video_marquee_int_option_t
850 * \param i_val marq option value
852 VLC_PUBLIC_API void libvlc_video_set_marquee_int( libvlc_media_player_t *p_mi,
853 unsigned option, int i_val );
856 * Set a marquee string option
858 * \param p_mi libvlc media player
859 * \param option marq option to set \see libvlc_video_marquee_string_option_t
860 * \param psz_text marq option value
862 VLC_PUBLIC_API void libvlc_video_set_marquee_string( libvlc_media_player_t *p_mi,
863 unsigned option, const char *psz_text );
865 /** option values for libvlc_video_{get,set}_logo_{int,string} */
866 enum libvlc_video_logo_option_t {
868 libvlc_logo_file, /**< string argument, "file,d,t;file,d,t;..." */
874 libvlc_logo_position,
878 * Get integer logo option.
880 * \param p_mi libvlc media player instance
881 * \param option logo option to get, values of libvlc_video_logo_option_t
883 VLC_PUBLIC_API int libvlc_video_get_logo_int( libvlc_media_player_t *p_mi,
887 * Set logo option as integer. Options that take a different type value
889 * Passing libvlc_logo_enable as option value has the side effect of
890 * starting (arg !0) or stopping (arg 0) the logo filter.
892 * \param p_mi libvlc media player instance
893 * \param option logo option to set, values of libvlc_video_logo_option_t
894 * \param value logo option value
896 VLC_PUBLIC_API void libvlc_video_set_logo_int( libvlc_media_player_t *p_mi,
897 unsigned option, int value );
900 * Set logo option as string. Options that take a different type value
903 * \param p_mi libvlc media player instance
904 * \param option logo option to set, values of libvlc_video_logo_option_t
905 * \param psz_value logo option value
907 VLC_PUBLIC_API void libvlc_video_set_logo_string( libvlc_media_player_t *p_mi,
908 unsigned option, const char *psz_value );
913 /** \defgroup libvlc_audio libvlc_audio
914 * \ingroup libvlc_media_player
915 * LibVLC Audio handling
922 typedef enum libvlc_audio_output_device_types_t {
923 libvlc_AudioOutputDevice_Error = -1,
924 libvlc_AudioOutputDevice_Mono = 1,
925 libvlc_AudioOutputDevice_Stereo = 2,
926 libvlc_AudioOutputDevice_2F2R = 4,
927 libvlc_AudioOutputDevice_3F2R = 5,
928 libvlc_AudioOutputDevice_5_1 = 6,
929 libvlc_AudioOutputDevice_6_1 = 7,
930 libvlc_AudioOutputDevice_7_1 = 8,
931 libvlc_AudioOutputDevice_SPDIF = 10
932 } libvlc_audio_output_device_types_t;
937 typedef enum libvlc_audio_output_channel_t {
938 libvlc_AudioChannel_Error = -1,
939 libvlc_AudioChannel_Stereo = 1,
940 libvlc_AudioChannel_RStereo = 2,
941 libvlc_AudioChannel_Left = 3,
942 libvlc_AudioChannel_Right = 4,
943 libvlc_AudioChannel_Dolbys = 5
944 } libvlc_audio_output_channel_t;
948 * Get the list of available audio outputs
950 * \param p_instance libvlc instance
951 * \return list of available audio outputs. It must be freed it with
952 * \see libvlc_audio_output_list_release \see libvlc_audio_output_t .
953 * In case of error, NULL is returned.
955 VLC_PUBLIC_API libvlc_audio_output_t *
956 libvlc_audio_output_list_get( libvlc_instance_t *p_instance );
959 * Free the list of available audio outputs
961 * \param p_list list with audio outputs for release
963 VLC_PUBLIC_API void libvlc_audio_output_list_release( libvlc_audio_output_t *p_list );
966 * Set the audio output.
967 * Change will be applied after stop and play.
969 * \param p_mi media player
970 * \param psz_name name of audio output,
971 * use psz_name of \see libvlc_audio_output_t
972 * \return true if function succeded
974 VLC_PUBLIC_API int libvlc_audio_output_set( libvlc_media_player_t *p_mi,
975 const char *psz_name );
978 * Get count of devices for audio output, these devices are hardware oriented
979 * like analor or digital output of sound card
981 * \param p_instance libvlc instance
982 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
983 * \return number of devices
985 VLC_PUBLIC_API int libvlc_audio_output_device_count( libvlc_instance_t *p_instance,
986 const char *psz_audio_output );
989 * Get long name of device, if not available short name given
991 * \param p_instance libvlc instance
992 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
993 * \param i_device device index
994 * \return long name of device
996 VLC_PUBLIC_API char * libvlc_audio_output_device_longname( libvlc_instance_t *p_instance,
997 const char *psz_audio_output,
1001 * Get id name of device
1003 * \param p_instance libvlc instance
1004 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1005 * \param i_device device index
1006 * \return id name of device, use for setting device, need to be free after use
1008 VLC_PUBLIC_API char * libvlc_audio_output_device_id( libvlc_instance_t *p_instance,
1009 const char *psz_audio_output,
1013 * Set audio output device. Changes are only effective after stop and play.
1015 * \param p_mi media player
1016 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1017 * \param psz_device_id device
1019 VLC_PUBLIC_API void libvlc_audio_output_device_set( libvlc_media_player_t *p_mi,
1020 const char *psz_audio_output,
1021 const char *psz_device_id );
1024 * Get current audio device type. Device type describes something like
1025 * character of output sound - stereo sound, 2.1, 5.1 etc
1027 * \param p_mi media player
1028 * \return the audio devices type \see libvlc_audio_output_device_types_t
1030 VLC_PUBLIC_API int libvlc_audio_output_get_device_type( libvlc_media_player_t *p_mi );
1033 * Set current audio device type.
1035 * \param p_mi vlc instance
1036 * \param device_type the audio device type,
1037 according to \see libvlc_audio_output_device_types_t
1039 VLC_PUBLIC_API void libvlc_audio_output_set_device_type( libvlc_media_player_t *p_mi,
1044 * Toggle mute status.
1046 * \param p_mi media player
1048 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_media_player_t *p_mi );
1051 * Get current mute status.
1053 * \param p_mi media player
1054 * \return the mute status (boolean)
1056 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_media_player_t *p_mi );
1061 * \param p_mi media player
1062 * \param status If status is true then mute, otherwise unmute
1064 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_media_player_t *p_mi, int status );
1067 * Get current audio level.
1069 * \param p_mi media player
1070 * \return the audio level (int)
1072 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_media_player_t *p_mi );
1075 * Set current audio level.
1077 * \param p_mi media player
1078 * \param i_volume the volume (int)
1079 * \return 0 if the volume was set, -1 if it was out of range
1081 VLC_PUBLIC_API int libvlc_audio_set_volume( libvlc_media_player_t *p_mi, int i_volume );
1084 * Get number of available audio tracks.
1086 * \param p_mi media player
1087 * \return the number of available audio tracks (int), or -1 if unavailable
1089 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *p_mi );
1092 * Get the description of available audio tracks.
1094 * \param p_mi media player
1095 * \return list with description of available audio tracks, or NULL
1097 VLC_PUBLIC_API libvlc_track_description_t *
1098 libvlc_audio_get_track_description( libvlc_media_player_t *p_mi );
1101 * Get current audio track.
1103 * \param p_mi media player
1104 * \return the audio track (int), or -1 if none.
1106 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *p_mi );
1109 * Set current audio track.
1111 * \param p_mi media player
1112 * \param i_track the track (int)
1113 * \return 0 on success, -1 on error
1115 VLC_PUBLIC_API int libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track );
1118 * Get current audio channel.
1120 * \param p_mi media player
1121 * \return the audio channel \see libvlc_audio_output_channel_t
1123 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_media_player_t *p_mi );
1126 * Set current audio channel.
1128 * \param p_mi media player
1129 * \param channel the audio channel, \see libvlc_audio_output_channel_t
1130 * \return 0 on success, -1 on error
1132 VLC_PUBLIC_API int libvlc_audio_set_channel( libvlc_media_player_t *p_mi, int channel );
1136 /** @} media_player */
1142 #endif /* VLC_LIBVLC_MEDIA_PLAYER_H */