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 * A LibVLC media player plays one media (usually in a custom drawable).
47 typedef struct libvlc_media_player_t libvlc_media_player_t;
50 * Description for video, audio tracks and subtitles. It contains
51 * id, name (description string) and pointer to next record.
53 typedef struct libvlc_track_description_t
57 struct libvlc_track_description_t *p_next;
59 } libvlc_track_description_t;
62 * Description for audio output. It contains
63 * name, description and pointer to next record.
65 typedef struct libvlc_audio_output_t
68 char *psz_description;
69 struct libvlc_audio_output_t *p_next;
71 } libvlc_audio_output_t;
74 * Rectangle type for video geometry
76 typedef struct libvlc_rectangle_t
83 * Marq options definition
85 typedef enum libvlc_video_marquee_option_t {
86 libvlc_marquee_Enable = 0,
87 libvlc_marquee_Text, /** string argument */
89 libvlc_marquee_Opacity,
90 libvlc_marquee_Position,
91 libvlc_marquee_Refresh,
93 libvlc_marquee_Timeout,
96 } libvlc_video_marquee_option_t;
99 * Create an empty Media Player object
101 * \param p_libvlc_instance the libvlc instance in which the Media Player
103 * \return a new media player object, or NULL on error.
105 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t *p_libvlc_instance );
108 * Create a Media Player object from a Media
110 * \param p_md the media. Afterwards the p_md can be safely
112 * \return a new media player object, or NULL on error.
114 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new_from_media( libvlc_media_t *p_md );
117 * Release a media_player after use
118 * Decrement the reference count of a media player object. If the
119 * reference count is 0, then libvlc_media_player_release() will
120 * release the media player object. If the media player object
121 * has been released, then it should not be used again.
123 * \param p_mi the Media Player to free
125 VLC_PUBLIC_API void libvlc_media_player_release( libvlc_media_player_t *p_mi );
128 * Retain a reference to a media player object. Use
129 * libvlc_media_player_release() to decrement reference count.
131 * \param p_mi media player object
133 VLC_PUBLIC_API void libvlc_media_player_retain( libvlc_media_player_t *p_mi );
136 * Set the media that will be used by the media_player. If any,
137 * previous md will be released.
139 * \param p_mi the Media Player
140 * \param p_md the Media. Afterwards the p_md can be safely
143 VLC_PUBLIC_API void libvlc_media_player_set_media( libvlc_media_player_t *p_mi,
144 libvlc_media_t *p_md );
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 *p_mi );
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 *p_mi );
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 *p_mi );
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 *p_mi );
180 * Pause or resume (no effect if there is no media)
182 * \param mp the Media Player
183 * \param do_pause play/resume if zero, pause if non-zero
184 * \version LibVLC 1.1.1 or later
186 VLC_PUBLIC_API void libvlc_media_player_set_pause ( libvlc_media_player_t *mp,
190 * Toggle pause (no effect if there is no media)
192 * \param p_mi the Media Player
194 VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *p_mi );
197 * Stop (no effect if there is no media)
199 * \param p_mi the Media Player
201 VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *p_mi );
204 * Set callbacks and private data to render decoded video to a custom area
205 * in memory. Use libvlc_video_set_format() to configure the decoded format.
207 * Whenever a new video frame needs to be decoded, the lock callback is
208 * invoked. Depending on the video chroma, one or three pixel planes of
209 * adequate dimensions must be returned via the second parameter. Those
210 * planes must be aligned on 32-bytes boundaries.
212 * When the video frame is decoded, the unlock callback is invoked. The
213 * second parameter to the callback corresponds is the return value of the
214 * lock callback. The third parameter conveys the pixel planes for convenience.
216 * When the video frame needs to be shown, as determined by the media playback
217 * clock, the display callback is invoked. The second parameter also conveys
218 * the return value from the lock callback.
220 * \param mp the media player
221 * \param lock callback to allocate video memory
222 * \param unlock callback to release video memory
223 * \param opaque private pointer for the three callbacks (as first parameter)
224 * \version LibVLC 1.1.1 or later
227 void libvlc_video_set_callbacks( libvlc_media_player_t *mp,
228 void *(*lock) (void *opaque, void **plane),
229 void (*unlock) (void *opaque, void *picture, void *const *plane),
230 void (*display) (void *opaque, void *picture),
234 * Set decoded video chroma and dimensions. This only works in combination with
235 * libvlc_video_set_callbacks().
237 * \param mp the media player
238 * \param chroma a four-characters string identifying the chroma
239 * (e.g. "RV32" or "I420")
240 * \param width pixel width
241 * \param height pixel height
242 * \param pitch line pitch (in bytes)
243 * \version LibVLC 1.1.1 or later
246 void libvlc_video_set_format( libvlc_media_player_t *mp, const char *chroma,
247 unsigned width, unsigned height,
251 * Set the NSView handler where the media player should render its video output.
253 * Use the vout called "macosx".
255 * The drawable is an NSObject that follow the VLCOpenGLVideoViewEmbedding
259 * \@protocol VLCOpenGLVideoViewEmbedding <NSObject>
260 * - (void)addVoutSubview:(NSView *)view;
261 * - (void)removeVoutSubview:(NSView *)view;
265 * Or it can be an NSView object.
267 * If you want to use it along with Qt4 see the QMacCocoaViewContainer. Then
268 * the following code should work:
271 * NSView *video = [[NSView alloc] init];
272 * QMacCocoaViewContainer *container = new QMacCocoaViewContainer(video, parent);
273 * libvlc_media_player_set_nsobject(mp, video);
278 * You can find a live example in VLCVideoView in VLCKit.framework.
280 * \param p_mi the Media Player
281 * \param drawable the drawable that is either an NSView or an object following
282 * the VLCOpenGLVideoViewEmbedding protocol.
284 VLC_PUBLIC_API void libvlc_media_player_set_nsobject ( libvlc_media_player_t *p_mi, void * drawable );
287 * Get the NSView handler previously set with libvlc_media_player_set_nsobject().
289 * \param p_mi the Media Player
290 * \return the NSView handler or 0 if none where set
292 VLC_PUBLIC_API void * libvlc_media_player_get_nsobject ( libvlc_media_player_t *p_mi );
295 * Set the agl handler where the media player should render its video output.
297 * \param p_mi the Media Player
298 * \param drawable the agl handler
300 VLC_PUBLIC_API void libvlc_media_player_set_agl ( libvlc_media_player_t *p_mi, uint32_t drawable );
303 * Get the agl handler previously set with libvlc_media_player_set_agl().
305 * \param p_mi the Media Player
306 * \return the agl handler or 0 if none where set
308 VLC_PUBLIC_API uint32_t libvlc_media_player_get_agl ( libvlc_media_player_t *p_mi );
311 * Set an X Window System drawable where the media player should render its
312 * video output. If LibVLC was built without X11 output support, then this has
315 * The specified identifier must correspond to an existing Input/Output class
316 * X11 window. Pixmaps are <b>not</b> supported. The caller shall ensure that
317 * the X11 server is the same as the one the VLC instance has been configured
320 * \param p_mi the Media Player
321 * \param drawable the ID of the X window
323 VLC_PUBLIC_API void libvlc_media_player_set_xwindow ( libvlc_media_player_t *p_mi, uint32_t drawable );
326 * Get the X Window System window identifier previously set with
327 * libvlc_media_player_set_xwindow(). Note that this will return the identifier
328 * even if VLC is not currently using it (for instance if it is playing an
331 * \param p_mi the Media Player
332 * \return an X window ID, or 0 if none where set.
334 VLC_PUBLIC_API uint32_t libvlc_media_player_get_xwindow ( libvlc_media_player_t *p_mi );
337 * Set a Win32/Win64 API window handle (HWND) where the media player should
338 * render its video output. If LibVLC was built without Win32/Win64 API output
339 * support, then this has no effects.
341 * \param p_mi the Media Player
342 * \param drawable windows handle of the drawable
344 VLC_PUBLIC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi, void *drawable );
347 * Get the Windows API window handle (HWND) previously set with
348 * libvlc_media_player_set_hwnd(). The handle will be returned even if LibVLC
349 * is not currently outputting any video to it.
351 * \param p_mi the Media Player
352 * \return a window handle or NULL if there are none.
354 VLC_PUBLIC_API void *libvlc_media_player_get_hwnd ( libvlc_media_player_t *p_mi );
358 /** \bug This might go away ... to be replaced by a broader system */
361 * Get the current movie length (in ms).
363 * \param p_mi the Media Player
364 * \return the movie length (in ms), or -1 if there is no media.
366 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_length( libvlc_media_player_t *p_mi );
369 * Get the current movie time (in ms).
371 * \param p_mi the Media Player
372 * \return the movie time (in ms), or -1 if there is no media.
374 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_time( libvlc_media_player_t *p_mi );
377 * Set the movie time (in ms). This has no effect if no media is being played.
378 * Not all formats and protocols support this.
380 * \param p_mi the Media Player
381 * \param i_time the movie time (in ms).
383 VLC_PUBLIC_API void libvlc_media_player_set_time( libvlc_media_player_t *p_mi, libvlc_time_t i_time );
386 * Get movie position.
388 * \param p_mi the Media Player
389 * \return movie position, or -1. in case of error
391 VLC_PUBLIC_API float libvlc_media_player_get_position( libvlc_media_player_t *p_mi );
394 * Set movie position. This has no effect if playback is not enabled.
395 * This might not work depending on the underlying input format and protocol.
397 * \param p_mi the Media Player
398 * \param f_pos the position
400 VLC_PUBLIC_API void libvlc_media_player_set_position( libvlc_media_player_t *p_mi, float f_pos );
403 * Set movie chapter (if applicable).
405 * \param p_mi the Media Player
406 * \param i_chapter chapter number to play
408 VLC_PUBLIC_API void libvlc_media_player_set_chapter( libvlc_media_player_t *p_mi, int i_chapter );
413 * \param p_mi the Media Player
414 * \return chapter number currently playing, or -1 if there is no media.
416 VLC_PUBLIC_API int libvlc_media_player_get_chapter( libvlc_media_player_t *p_mi );
419 * Get movie chapter count
421 * \param p_mi the Media Player
422 * \return number of chapters in movie, or -1.
424 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count( libvlc_media_player_t *p_mi );
427 * Is the player able to play
429 * \param p_mi the Media Player
432 VLC_PUBLIC_API int libvlc_media_player_will_play( libvlc_media_player_t *p_mi );
435 * Get title chapter count
437 * \param p_mi the Media Player
438 * \param i_title title
439 * \return number of chapters in title, or -1
441 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count_for_title(
442 libvlc_media_player_t *p_mi, int i_title );
447 * \param p_mi the Media Player
448 * \param i_title title number to play
450 VLC_PUBLIC_API void libvlc_media_player_set_title( libvlc_media_player_t *p_mi, int i_title );
455 * \param p_mi the Media Player
456 * \return title number currently playing, or -1
458 VLC_PUBLIC_API int libvlc_media_player_get_title( libvlc_media_player_t *p_mi );
461 * Get movie title count
463 * \param p_mi the Media Player
464 * \return title number count, or -1
466 VLC_PUBLIC_API int libvlc_media_player_get_title_count( libvlc_media_player_t *p_mi );
469 * Set previous chapter (if applicable)
471 * \param p_mi the Media Player
473 VLC_PUBLIC_API void libvlc_media_player_previous_chapter( libvlc_media_player_t *p_mi );
476 * Set next chapter (if applicable)
478 * \param p_mi the Media Player
480 VLC_PUBLIC_API void libvlc_media_player_next_chapter( libvlc_media_player_t *p_mi );
483 * Get the requested movie play rate.
484 * @warning Depending on the underlying media, the requested rate may be
485 * different from the real playback rate.
487 * \param p_mi the Media Player
488 * \return movie play rate
490 VLC_PUBLIC_API float libvlc_media_player_get_rate( libvlc_media_player_t *p_mi );
493 * Set movie play rate
495 * \param p_mi the Media Player
496 * \param rate movie play rate to set
497 * \return -1 if an error was detected, 0 otherwise (but even then, it might
498 * not actually work depending on the underlying media protocol)
500 VLC_PUBLIC_API int libvlc_media_player_set_rate( libvlc_media_player_t *p_mi, float rate );
503 * Get current movie state
505 * \param p_mi the Media Player
506 * \return the current state of the media player (playing, paused, ...) \see libvlc_state_t
508 VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *p_mi );
513 * \param p_mi the Media Player
514 * \return frames per second (fps) for this playing movie, or 0 if unspecified
516 VLC_PUBLIC_API float libvlc_media_player_get_fps( libvlc_media_player_t *p_mi );
521 * How many video outputs does this media player have?
523 * \param p_mi the media player
524 * \return the number of video outputs
526 VLC_PUBLIC_API unsigned libvlc_media_player_has_vout( libvlc_media_player_t *p_mi );
529 * Is this media player seekable?
531 * \param p_mi the media player
532 * \return true if the media player can seek
534 VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi );
537 * Can this media player be paused?
539 * \param p_mi the media player
540 * \return true if the media player can pause
542 VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi );
546 * Display the next frame (if supported)
548 * \param p_mi the media player
550 VLC_PUBLIC_API void libvlc_media_player_next_frame( libvlc_media_player_t *p_mi );
555 * Release (free) libvlc_track_description_t
557 * \param p_track_description the structure to release
559 VLC_PUBLIC_API void libvlc_track_description_release( libvlc_track_description_t *p_track_description );
561 /** \defgroup libvlc_video LibVLC video controls
566 * Toggle fullscreen status on non-embedded video outputs.
568 * @warning The same limitations applies to this function
569 * as to libvlc_set_fullscreen().
571 * \param p_mi the media player
573 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *p_mi );
576 * Enable or disable fullscreen.
578 * @warning With most window managers, only a top-level windows can be in
579 * full-screen mode. Hence, this function will not operate properly if
580 * libvlc_media_player_set_xwindow() was used to embed the video in a
581 * non-top-level window. In that case, the embedding window must be reparented
582 * to the root window <b>before</b> fullscreen mode is enabled. You will want
583 * to reparent it back to its normal parent when disabling fullscreen.
585 * \param p_mi the media player
586 * \param b_fullscreen boolean for fullscreen status
588 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *p_mi, int b_fullscreen );
591 * Get current fullscreen status.
593 * \param p_mi the media player
594 * \return the fullscreen status (boolean)
596 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t *p_mi );
599 * Enable or disable key press events handling, according to the LibVLC hotkeys
600 * configuration. By default and for historical reasons, keyboard events are
601 * handled by the LibVLC video widget.
603 * \note On X11, there can be only one subscriber for key press and mouse
604 * click events per window. If your application has subscribed to those events
605 * for the X window ID of the video widget, then LibVLC will not be able to
606 * handle key presses and mouse clicks in any case.
608 * \warning This function is only implemented for X11 and Win32 at the moment.
610 * \param p_mi the media player
611 * \param on true to handle key press events, false to ignore them.
614 void libvlc_video_set_key_input( libvlc_media_player_t *p_mi, unsigned on );
617 * Enable or disable mouse click events handling. By default, those events are
618 * handled. This is needed for DVD menus to work, as well as a few video
619 * filters such as "puzzle".
621 * \note See also libvlc_video_set_key_input().
623 * \warning This function is only implemented for X11 and Win32 at the moment.
625 * \param p_mi the media player
626 * \param on true to handle mouse click events, false to ignore them.
629 void libvlc_video_set_mouse_input( libvlc_media_player_t *p_mi, unsigned on );
632 * Get the pixel dimensions of a video.
634 * \param p_mi media player
635 * \param num number of the video (starting from, and most commonly 0)
636 * \param px pointer to get the pixel width [OUT]
637 * \param py pointer to get the pixel height [OUT]
638 * \return 0 on success, -1 if the specified video does not exist
641 int libvlc_video_get_size( libvlc_media_player_t *p_mi, unsigned num,
642 unsigned *px, unsigned *py );
645 * Get current video height.
646 * You should use libvlc_video_get_size() instead.
648 * \param p_mi the media player
649 * \return the video pixel height or 0 if not applicable
652 int libvlc_video_get_height( libvlc_media_player_t *p_mi );
655 * Get current video width.
656 * You should use libvlc_video_get_size() instead.
658 * \param p_mi the media player
659 * \return the video pixel width or 0 if not applicable
662 int libvlc_video_get_width( libvlc_media_player_t *p_mi );
665 * Get the mouse pointer coordinates over a video.
666 * Coordinates are expressed in terms of the decoded video resolution,
667 * <b>not</b> in terms of pixels on the screen/viewport (to get the latter,
668 * you can query your windowing system directly).
670 * Either of the coordinates may be negative or larger than the corresponding
671 * dimension of the video, if the cursor is outside the rendering area.
673 * @warning The coordinates may be out-of-date if the pointer is not located
674 * on the video rendering area. LibVLC does not track the pointer if it is
675 * outside of the video widget.
677 * @note LibVLC does not support multiple pointers (it does of course support
678 * multiple input devices sharing the same pointer) at the moment.
680 * \param p_mi media player
681 * \param num number of the video (starting from, and most commonly 0)
682 * \param px pointer to get the abscissa [OUT]
683 * \param py pointer to get the ordinate [OUT]
684 * \return 0 on success, -1 if the specified video does not exist
687 int libvlc_video_get_cursor( libvlc_media_player_t *p_mi, unsigned num,
691 * Get the current video scaling factor.
692 * See also libvlc_video_set_scale().
694 * \param p_mi the media player
695 * \return the currently configured zoom factor, or 0. if the video is set
696 * to fit to the output window/drawable automatically.
698 VLC_PUBLIC_API float libvlc_video_get_scale( libvlc_media_player_t *p_mi );
701 * Set the video scaling factor. That is the ratio of the number of pixels on
702 * screen to the number of pixels in the original decoded video in each
703 * dimension. Zero is a special value; it will adjust the video to the output
704 * window/drawable (in windowed mode) or the entire screen.
706 * Note that not all video outputs support scaling.
708 * \param p_mi the media player
709 * \param f_factor the scaling factor, or zero
711 VLC_PUBLIC_API void libvlc_video_set_scale( libvlc_media_player_t *p_mi, float f_factor );
714 * Get current video aspect ratio.
716 * \param p_mi the media player
717 * \return the video aspect ratio or NULL if unspecified
718 * (the result must be released with free()).
720 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *p_mi );
723 * Set new video aspect ratio.
725 * \param p_mi the media player
726 * \param psz_aspect new video aspect-ratio or NULL to reset to default
727 * \note Invalid aspect ratios are ignored.
729 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *p_mi, const char *psz_aspect );
732 * Get current video subtitle.
734 * \param p_mi the media player
735 * \return the video subtitle selected, or -1 if none
737 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *p_mi );
740 * Get the number of available video subtitles.
742 * \param p_mi the media player
743 * \return the number of available video subtitles
745 VLC_PUBLIC_API int libvlc_video_get_spu_count( libvlc_media_player_t *p_mi );
748 * Get the description of available video subtitles.
750 * \param p_mi the media player
751 * \return list containing description of available video subtitles
753 VLC_PUBLIC_API libvlc_track_description_t *
754 libvlc_video_get_spu_description( libvlc_media_player_t *p_mi );
757 * Set new video subtitle.
759 * \param p_mi the media player
760 * \param i_spu new video subtitle to select
761 * \return 0 on success, -1 if out of range
763 VLC_PUBLIC_API int libvlc_video_set_spu( libvlc_media_player_t *p_mi, unsigned i_spu );
766 * Set new video subtitle file.
768 * \param p_mi the media player
769 * \param psz_subtitle new video subtitle file
770 * \return the success status (boolean)
772 VLC_PUBLIC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *p_mi, const char *psz_subtitle );
775 * Get the description of available titles.
777 * \param p_mi the media player
778 * \return list containing description of available titles
780 VLC_PUBLIC_API libvlc_track_description_t *
781 libvlc_video_get_title_description( libvlc_media_player_t *p_mi );
784 * Get the description of available chapters for specific title.
786 * \param p_mi the media player
787 * \param i_title selected title
788 * \return list containing description of available chapter for title i_title
790 VLC_PUBLIC_API libvlc_track_description_t *
791 libvlc_video_get_chapter_description( libvlc_media_player_t *p_mi, int i_title );
794 * Get current crop filter geometry.
796 * \param p_mi the media player
797 * \return the crop filter geometry or NULL if unset
799 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *p_mi );
802 * Set new crop filter geometry.
804 * \param p_mi the media player
805 * \param psz_geometry new crop filter geometry (NULL to unset)
808 void libvlc_video_set_crop_geometry( libvlc_media_player_t *p_mi, const char *psz_geometry );
811 * Get current teletext page requested.
813 * \param p_mi the media player
814 * \return the current teletext page requested.
816 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t *p_mi );
819 * Set new teletext page to retrieve.
821 * \param p_mi the media player
822 * \param i_page teletex page number requested
824 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *p_mi, int i_page );
827 * Toggle teletext transparent status on video output.
829 * \param p_mi the media player
831 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *p_mi );
834 * Get number of available video tracks.
836 * \param p_mi media player
837 * \return the number of available video tracks (int)
839 VLC_PUBLIC_API int libvlc_video_get_track_count( libvlc_media_player_t *p_mi );
842 * Get the description of available video tracks.
844 * \param p_mi media player
845 * \return list with description of available video tracks, or NULL on error
847 VLC_PUBLIC_API libvlc_track_description_t *
848 libvlc_video_get_track_description( libvlc_media_player_t *p_mi );
851 * Get current video track.
853 * \param p_mi media player
854 * \return the video track (int) or -1 if none
856 VLC_PUBLIC_API int libvlc_video_get_track( libvlc_media_player_t *p_mi );
861 * \param p_mi media player
862 * \param i_track the track (int)
863 * \return 0 on success, -1 if out of range
866 int libvlc_video_set_track( libvlc_media_player_t *p_mi, int i_track );
869 * Take a snapshot of the current video window.
871 * If i_width AND i_height is 0, original size is used.
872 * If i_width XOR i_height is 0, original aspect-ratio is preserved.
874 * \param p_mi media player instance
875 * \param num number of video output (typically 0 for the first/only one)
876 * \param psz_filepath the path where to save the screenshot to
877 * \param i_width the snapshot's width
878 * \param i_height the snapshot's height
879 * \return 0 on success, -1 if the video was not found
882 int libvlc_video_take_snapshot( libvlc_media_player_t *p_mi, unsigned num,
883 const char *psz_filepath, unsigned int i_width,
884 unsigned int i_height );
887 * Enable or disable deinterlace filter
889 * \param p_mi libvlc media player
890 * \param psz_mode type of deinterlace filter, NULL to disable
892 VLC_PUBLIC_API void libvlc_video_set_deinterlace( libvlc_media_player_t *p_mi,
893 const char *psz_mode );
896 * Get an integer marquee option value
898 * \param p_mi libvlc media player
899 * \param option marq option to get \see libvlc_video_marquee_int_option_t
901 VLC_PUBLIC_API int libvlc_video_get_marquee_int( libvlc_media_player_t *p_mi,
905 * Get a string marquee option value
907 * \param p_mi libvlc media player
908 * \param option marq option to get \see libvlc_video_marquee_string_option_t
910 VLC_PUBLIC_API char *libvlc_video_get_marquee_string( libvlc_media_player_t *p_mi,
914 * Enable, disable or set an integer marquee option
916 * Setting libvlc_marquee_Enable has the side effect of enabling (arg !0)
917 * or disabling (arg 0) the marq filter.
919 * \param p_mi libvlc media player
920 * \param option marq option to set \see libvlc_video_marquee_int_option_t
921 * \param i_val marq option value
923 VLC_PUBLIC_API void libvlc_video_set_marquee_int( libvlc_media_player_t *p_mi,
924 unsigned option, int i_val );
927 * Set a marquee string option
929 * \param p_mi libvlc media player
930 * \param option marq option to set \see libvlc_video_marquee_string_option_t
931 * \param psz_text marq option value
933 VLC_PUBLIC_API void libvlc_video_set_marquee_string( libvlc_media_player_t *p_mi,
934 unsigned option, const char *psz_text );
936 /** option values for libvlc_video_{get,set}_logo_{int,string} */
937 enum libvlc_video_logo_option_t {
939 libvlc_logo_file, /**< string argument, "file,d,t;file,d,t;..." */
945 libvlc_logo_position,
949 * Get integer logo option.
951 * \param p_mi libvlc media player instance
952 * \param option logo option to get, values of libvlc_video_logo_option_t
954 VLC_PUBLIC_API int libvlc_video_get_logo_int( libvlc_media_player_t *p_mi,
958 * Set logo option as integer. Options that take a different type value
960 * Passing libvlc_logo_enable as option value has the side effect of
961 * starting (arg !0) or stopping (arg 0) the logo filter.
963 * \param p_mi libvlc media player instance
964 * \param option logo option to set, values of libvlc_video_logo_option_t
965 * \param value logo option value
967 VLC_PUBLIC_API void libvlc_video_set_logo_int( libvlc_media_player_t *p_mi,
968 unsigned option, int value );
971 * Set logo option as string. Options that take a different type value
974 * \param p_mi libvlc media player instance
975 * \param option logo option to set, values of libvlc_video_logo_option_t
976 * \param psz_value logo option value
978 VLC_PUBLIC_API void libvlc_video_set_logo_string( libvlc_media_player_t *p_mi,
979 unsigned option, const char *psz_value );
982 /** option values for libvlc_video_{get,set}_adjust_{int,float,bool} */
983 enum libvlc_video_adjust_option_t {
984 libvlc_adjust_Enable = 0,
985 libvlc_adjust_Contrast,
986 libvlc_adjust_Brightness,
988 libvlc_adjust_Saturation,
993 * Get integer adjust option.
995 * \param p_mi libvlc media player instance
996 * \param option adjust option to get, values of libvlc_video_adjust_option_t
997 * \version LibVLC 1.1.1 and later.
999 VLC_PUBLIC_API int libvlc_video_get_adjust_int( libvlc_media_player_t *p_mi,
1003 * Set adjust option as integer. Options that take a different type value
1005 * Passing libvlc_adjust_enable as option value has the side effect of
1006 * starting (arg !0) or stopping (arg 0) the adjust filter.
1008 * \param p_mi libvlc media player instance
1009 * \param option adust option to set, values of libvlc_video_adjust_option_t
1010 * \param value adjust option value
1011 * \version LibVLC 1.1.1 and later.
1013 VLC_PUBLIC_API void libvlc_video_set_adjust_int( libvlc_media_player_t *p_mi,
1014 unsigned option, int value );
1017 * Get float adjust option.
1019 * \param p_mi libvlc media player instance
1020 * \param option adjust option to get, values of libvlc_video_adjust_option_t
1021 * \version LibVLC 1.1.1 and later.
1023 VLC_PUBLIC_API float libvlc_video_get_adjust_float( libvlc_media_player_t *p_mi,
1027 * Set adjust option as float. Options that take a different type value
1030 * \param p_mi libvlc media player instance
1031 * \param option adust option to set, values of libvlc_video_adjust_option_t
1032 * \param value adjust option value
1033 * \version LibVLC 1.1.1 and later.
1035 VLC_PUBLIC_API void libvlc_video_set_adjust_float( libvlc_media_player_t *p_mi,
1036 unsigned option, float value );
1040 /** \defgroup libvlc_audio LibVLC audio controls
1045 * Audio device types
1047 typedef enum libvlc_audio_output_device_types_t {
1048 libvlc_AudioOutputDevice_Error = -1,
1049 libvlc_AudioOutputDevice_Mono = 1,
1050 libvlc_AudioOutputDevice_Stereo = 2,
1051 libvlc_AudioOutputDevice_2F2R = 4,
1052 libvlc_AudioOutputDevice_3F2R = 5,
1053 libvlc_AudioOutputDevice_5_1 = 6,
1054 libvlc_AudioOutputDevice_6_1 = 7,
1055 libvlc_AudioOutputDevice_7_1 = 8,
1056 libvlc_AudioOutputDevice_SPDIF = 10
1057 } libvlc_audio_output_device_types_t;
1062 typedef enum libvlc_audio_output_channel_t {
1063 libvlc_AudioChannel_Error = -1,
1064 libvlc_AudioChannel_Stereo = 1,
1065 libvlc_AudioChannel_RStereo = 2,
1066 libvlc_AudioChannel_Left = 3,
1067 libvlc_AudioChannel_Right = 4,
1068 libvlc_AudioChannel_Dolbys = 5
1069 } libvlc_audio_output_channel_t;
1073 * Get the list of available audio outputs
1075 * \param p_instance libvlc instance
1076 * \return list of available audio outputs. It must be freed it with
1077 * \see libvlc_audio_output_list_release \see libvlc_audio_output_t .
1078 * In case of error, NULL is returned.
1080 VLC_PUBLIC_API libvlc_audio_output_t *
1081 libvlc_audio_output_list_get( libvlc_instance_t *p_instance );
1084 * Free the list of available audio outputs
1086 * \param p_list list with audio outputs for release
1088 VLC_PUBLIC_API void libvlc_audio_output_list_release( libvlc_audio_output_t *p_list );
1091 * Set the audio output.
1092 * Change will be applied after stop and play.
1094 * \param p_mi media player
1095 * \param psz_name name of audio output,
1096 * use psz_name of \see libvlc_audio_output_t
1097 * \return true if function succeded
1099 VLC_PUBLIC_API int libvlc_audio_output_set( libvlc_media_player_t *p_mi,
1100 const char *psz_name );
1103 * Get count of devices for audio output, these devices are hardware oriented
1104 * like analor or digital output of sound card
1106 * \param p_instance libvlc instance
1107 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1108 * \return number of devices
1110 VLC_PUBLIC_API int libvlc_audio_output_device_count( libvlc_instance_t *p_instance,
1111 const char *psz_audio_output );
1114 * Get long name of device, if not available short name given
1116 * \param p_instance libvlc instance
1117 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1118 * \param i_device device index
1119 * \return long name of device
1121 VLC_PUBLIC_API char * libvlc_audio_output_device_longname( libvlc_instance_t *p_instance,
1122 const char *psz_audio_output,
1126 * Get id name of device
1128 * \param p_instance libvlc instance
1129 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1130 * \param i_device device index
1131 * \return id name of device, use for setting device, need to be free after use
1133 VLC_PUBLIC_API char * libvlc_audio_output_device_id( libvlc_instance_t *p_instance,
1134 const char *psz_audio_output,
1138 * Set audio output device. Changes are only effective after stop and play.
1140 * \param p_mi media player
1141 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1142 * \param psz_device_id device
1144 VLC_PUBLIC_API void libvlc_audio_output_device_set( libvlc_media_player_t *p_mi,
1145 const char *psz_audio_output,
1146 const char *psz_device_id );
1149 * Get current audio device type. Device type describes something like
1150 * character of output sound - stereo sound, 2.1, 5.1 etc
1152 * \param p_mi media player
1153 * \return the audio devices type \see libvlc_audio_output_device_types_t
1155 VLC_PUBLIC_API int libvlc_audio_output_get_device_type( libvlc_media_player_t *p_mi );
1158 * Set current audio device type.
1160 * \param p_mi vlc instance
1161 * \param device_type the audio device type,
1162 according to \see libvlc_audio_output_device_types_t
1164 VLC_PUBLIC_API void libvlc_audio_output_set_device_type( libvlc_media_player_t *p_mi,
1169 * Toggle mute status.
1171 * \param p_mi media player
1173 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_media_player_t *p_mi );
1176 * Get current mute status.
1178 * \param p_mi media player
1179 * \return the mute status (boolean)
1181 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_media_player_t *p_mi );
1186 * \param p_mi media player
1187 * \param status If status is true then mute, otherwise unmute
1189 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_media_player_t *p_mi, int status );
1192 * Get current audio level.
1194 * \param p_mi media player
1195 * \return the audio level (int)
1197 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_media_player_t *p_mi );
1200 * Set current audio level.
1202 * \param p_mi media player
1203 * \param i_volume the volume (int)
1204 * \return 0 if the volume was set, -1 if it was out of range
1206 VLC_PUBLIC_API int libvlc_audio_set_volume( libvlc_media_player_t *p_mi, int i_volume );
1209 * Get number of available audio tracks.
1211 * \param p_mi media player
1212 * \return the number of available audio tracks (int), or -1 if unavailable
1214 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *p_mi );
1217 * Get the description of available audio tracks.
1219 * \param p_mi media player
1220 * \return list with description of available audio tracks, or NULL
1222 VLC_PUBLIC_API libvlc_track_description_t *
1223 libvlc_audio_get_track_description( libvlc_media_player_t *p_mi );
1226 * Get current audio track.
1228 * \param p_mi media player
1229 * \return the audio track (int), or -1 if none.
1231 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *p_mi );
1234 * Set current audio track.
1236 * \param p_mi media player
1237 * \param i_track the track (int)
1238 * \return 0 on success, -1 on error
1240 VLC_PUBLIC_API int libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track );
1243 * Get current audio channel.
1245 * \param p_mi media player
1246 * \return the audio channel \see libvlc_audio_output_channel_t
1248 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_media_player_t *p_mi );
1251 * Set current audio channel.
1253 * \param p_mi media player
1254 * \param channel the audio channel, \see libvlc_audio_output_channel_t
1255 * \return 0 on success, -1 on error
1257 VLC_PUBLIC_API int libvlc_audio_set_channel( libvlc_media_player_t *p_mi, int channel );
1260 * Get current audio delay.
1262 * \param p_mi media player
1263 * \return the audio delay (microseconds)
1264 * \version LibVLC 1.1.1 or later
1266 VLC_PUBLIC_API int64_t libvlc_audio_get_delay( libvlc_media_player_t *p_mi );
1269 * Set current audio delay. The audio delay will be reset to zero each time the media changes.
1271 * \param p_mi media player
1272 * \param i_delay the audio delay (microseconds)
1273 * \return 0 on success, -1 on error
1274 * \version LibVLC 1.1.1 or later
1276 VLC_PUBLIC_API int libvlc_audio_set_delay( libvlc_media_player_t *p_mi, int64_t i_delay );
1280 /** @} media_player */
1286 #endif /* VLC_LIBVLC_MEDIA_PLAYER_H */