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 * 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 *p_mi );
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 *p_mi );
194 * Set the NSView handler where the media player should render its video output.
196 * Use the vout called "macosx".
198 * The drawable is an NSObject that follow the VLCOpenGLVideoViewEmbedding
202 * \@protocol VLCOpenGLVideoViewEmbedding <NSObject>
203 * - (void)addVoutSubview:(NSView *)view;
204 * - (void)removeVoutSubview:(NSView *)view;
208 * Or it can be an NSView object.
210 * If you want to use it along with Qt4 see the QMacCocoaViewContainer. Then
211 * the following code should work:
214 * NSView *video = [[NSView alloc] init];
215 * QMacCocoaViewContainer *container = new QMacCocoaViewContainer(video, parent);
216 * libvlc_media_player_set_nsobject(mp, video);
221 * You can find a live example in VLCVideoView in VLCKit.framework.
223 * \param p_mi the Media Player
224 * \param drawable the drawable that is either an NSView or an object following
225 * the VLCOpenGLVideoViewEmbedding protocol.
227 VLC_PUBLIC_API void libvlc_media_player_set_nsobject ( libvlc_media_player_t *p_mi, void * drawable );
230 * Get the NSView handler previously set with libvlc_media_player_set_nsobject().
232 * \param p_mi the Media Player
233 * \return the NSView handler or 0 if none where set
235 VLC_PUBLIC_API void * libvlc_media_player_get_nsobject ( libvlc_media_player_t *p_mi );
238 * Set the agl handler where the media player should render its video output.
240 * \param p_mi the Media Player
241 * \param drawable the agl handler
243 VLC_PUBLIC_API void libvlc_media_player_set_agl ( libvlc_media_player_t *p_mi, uint32_t drawable );
246 * Get the agl handler previously set with libvlc_media_player_set_agl().
248 * \param p_mi the Media Player
249 * \return the agl handler or 0 if none where set
251 VLC_PUBLIC_API uint32_t libvlc_media_player_get_agl ( libvlc_media_player_t *p_mi );
254 * Set an X Window System drawable where the media player should render its
255 * video output. If LibVLC was built without X11 output support, then this has
258 * The specified identifier must correspond to an existing Input/Output class
259 * X11 window. Pixmaps are <b>not</b> supported. The caller shall ensure that
260 * the X11 server is the same as the one the VLC instance has been configured
262 * If XVideo is <b>not</b> used, it is assumed that the drawable has the
263 * following properties in common with the default X11 screen: depth, scan line
264 * pad, black pixel. This is a bug.
266 * \param p_mi the Media Player
267 * \param drawable the ID of the X window
269 VLC_PUBLIC_API void libvlc_media_player_set_xwindow ( libvlc_media_player_t *p_mi, uint32_t drawable );
272 * Get the X Window System window identifier previously set with
273 * libvlc_media_player_set_xwindow(). Note that this will return the identifier
274 * even if VLC is not currently using it (for instance if it is playing an
277 * \param p_mi the Media Player
278 * \return an X window ID, or 0 if none where set.
280 VLC_PUBLIC_API uint32_t libvlc_media_player_get_xwindow ( libvlc_media_player_t *p_mi );
283 * Set a Win32/Win64 API window handle (HWND) where the media player should
284 * render its video output. If LibVLC was built without Win32/Win64 API output
285 * support, then this has no effects.
287 * \param p_mi the Media Player
288 * \param drawable windows handle of the drawable
290 VLC_PUBLIC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi, void *drawable );
293 * Get the Windows API window handle (HWND) previously set with
294 * libvlc_media_player_set_hwnd(). The handle will be returned even if LibVLC
295 * is not currently outputting any video to it.
297 * \param p_mi the Media Player
298 * \return a window handle or NULL if there are none.
300 VLC_PUBLIC_API void *libvlc_media_player_get_hwnd ( libvlc_media_player_t *p_mi );
304 /** \bug This might go away ... to be replaced by a broader system */
307 * Get the current movie length (in ms).
309 * \param p_mi the Media Player
310 * \return the movie length (in ms), or -1 if there is no media.
312 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_length( libvlc_media_player_t *p_mi );
315 * Get the current movie time (in ms).
317 * \param p_mi the Media Player
318 * \return the movie time (in ms), or -1 if there is no media.
320 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_time( libvlc_media_player_t *p_mi );
323 * Set the movie time (in ms). This has no effect if no media is being played.
324 * Not all formats and protocols support this.
326 * \param p_mi the Media Player
327 * \param i_time the movie time (in ms).
329 VLC_PUBLIC_API void libvlc_media_player_set_time( libvlc_media_player_t *p_mi, libvlc_time_t i_time );
332 * Get movie position.
334 * \param p_mi the Media Player
335 * \return movie position, or -1. in case of error
337 VLC_PUBLIC_API float libvlc_media_player_get_position( libvlc_media_player_t *p_mi );
340 * Set movie position. This has no effect if playback is not enabled.
341 * This might not work depending on the underlying input format and protocol.
343 * \param p_mi the Media Player
344 * \param f_pos the position
346 VLC_PUBLIC_API void libvlc_media_player_set_position( libvlc_media_player_t *p_mi, float f_pos );
349 * Set movie chapter (if applicable).
351 * \param p_mi the Media Player
352 * \param i_chapter chapter number to play
354 VLC_PUBLIC_API void libvlc_media_player_set_chapter( libvlc_media_player_t *p_mi, int i_chapter );
359 * \param p_mi the Media Player
360 * \return chapter number currently playing, or -1 if there is no media.
362 VLC_PUBLIC_API int libvlc_media_player_get_chapter( libvlc_media_player_t *p_mi );
365 * Get movie chapter count
367 * \param p_mi the Media Player
368 * \return number of chapters in movie, or -1.
370 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count( libvlc_media_player_t *p_mi );
373 * Is the player able to play
375 * \param p_mi the Media Player
378 VLC_PUBLIC_API int libvlc_media_player_will_play( libvlc_media_player_t *p_mi );
381 * Get title chapter count
383 * \param p_mi the Media Player
384 * \param i_title title
385 * \return number of chapters in title, or -1
387 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count_for_title(
388 libvlc_media_player_t *p_mi, int i_title );
393 * \param p_mi the Media Player
394 * \param i_title title number to play
396 VLC_PUBLIC_API void libvlc_media_player_set_title( libvlc_media_player_t *p_mi, int i_title );
401 * \param p_mi the Media Player
402 * \return title number currently playing, or -1
404 VLC_PUBLIC_API int libvlc_media_player_get_title( libvlc_media_player_t *p_mi );
407 * Get movie title count
409 * \param p_mi the Media Player
410 * \return title number count, or -1
412 VLC_PUBLIC_API int libvlc_media_player_get_title_count( libvlc_media_player_t *p_mi );
415 * Set previous chapter (if applicable)
417 * \param p_mi the Media Player
419 VLC_PUBLIC_API void libvlc_media_player_previous_chapter( libvlc_media_player_t *p_mi );
422 * Set next chapter (if applicable)
424 * \param p_mi the Media Player
426 VLC_PUBLIC_API void libvlc_media_player_next_chapter( libvlc_media_player_t *p_mi );
429 * Get the requested movie play rate.
430 * @warning Depending on the underlying media, the requested rate may be
431 * different from the real playback rate.
433 * \param p_mi the Media Player
434 * \return movie play rate
436 VLC_PUBLIC_API float libvlc_media_player_get_rate( libvlc_media_player_t *p_mi );
439 * Set movie play rate
441 * \param p_mi the Media Player
442 * \param rate movie play rate to set
443 * \return -1 if an error was detected, 0 otherwise (but even then, it might
444 * not actually work depending on the underlying media protocol)
446 VLC_PUBLIC_API int libvlc_media_player_set_rate( libvlc_media_player_t *p_mi, float rate );
449 * Get current movie state
451 * \param p_mi the Media Player
452 * \return the current state of the media player (playing, paused, ...) \see libvlc_state_t
454 VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *p_mi );
459 * \param p_mi the Media Player
460 * \return frames per second (fps) for this playing movie, or 0 if unspecified
462 VLC_PUBLIC_API float libvlc_media_player_get_fps( libvlc_media_player_t *p_mi );
467 * How many video outputs does this media player have?
469 * \param p_mi the media player
470 * \return the number of video outputs
472 VLC_PUBLIC_API unsigned libvlc_media_player_has_vout( libvlc_media_player_t *p_mi );
475 * Is this media player seekable?
477 * \param p_mi the media player
478 * \return true if the media player can seek
480 VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi );
483 * Can this media player be paused?
485 * \param p_mi the media player
486 * \return true if the media player can pause
488 VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi );
492 * Display the next frame (if supported)
494 * \param p_mi the media player
496 VLC_PUBLIC_API void libvlc_media_player_next_frame( libvlc_media_player_t *p_mi );
501 * Release (free) libvlc_track_description_t
503 * \param p_track_description the structure to release
505 VLC_PUBLIC_API void libvlc_track_description_release( libvlc_track_description_t *p_track_description );
507 /** \defgroup libvlc_video LibVLC video controls
512 * Toggle fullscreen status on non-embedded video outputs.
514 * @warning The same limitations applies to this function
515 * as to libvlc_set_fullscreen().
517 * \param p_mi the media player
519 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *p_mi );
522 * Enable or disable fullscreen.
524 * @warning With most window managers, only a top-level windows can be in
525 * full-screen mode. Hence, this function will not operate properly if
526 * libvlc_media_player_set_xid() was used to embed the video in a non-top-level
527 * window. In that case, the embedding window must be reparented to the root
528 * window <b>before</b> fullscreen mode is enabled. You will want to reparent
529 * it back to its normal parent when disabling fullscreen.
531 * \param p_mi the media player
532 * \param b_fullscreen boolean for fullscreen status
534 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *p_mi, int b_fullscreen );
537 * Get current fullscreen status.
539 * \param p_mi the media player
540 * \return the fullscreen status (boolean)
542 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t *p_mi );
545 * Enable or disable key press events handling, according to the LibVLC hotkeys
546 * configuration. By default and for historical reasons, keyboard events are
547 * handled by the LibVLC video widget.
549 * \note On X11, there can be only one subscriber for key press and mouse
550 * click events per window. If your application has subscribed to those events
551 * for the X window ID of the video widget, then LibVLC will not be able to
552 * handle key presses and mouse clicks in any case.
554 * \warning This function is only implemented for X11 and Win32 at the moment.
556 * \param p_mi the media player
557 * \param on true to handle key press events, false to ignore them.
560 void libvlc_video_set_key_input( libvlc_media_player_t *p_mi, unsigned on );
563 * Enable or disable mouse click events handling. By default, those events are
564 * handled. This is needed for DVD menus to work, as well as a few video
565 * filters such as "puzzle".
567 * \note See also libvlc_video_set_key_input().
569 * \warning This function is only implemented for X11 and Win32 at the moment.
571 * \param p_mi the media player
572 * \param on true to handle mouse click events, false to ignore them.
575 void libvlc_video_set_mouse_input( libvlc_media_player_t *p_mi, unsigned on );
578 * Get the pixel dimensions of a video.
580 * \param p_mi media player
581 * \param num number of the video (starting from, and most commonly 0)
582 * \param px pointer to get the pixel width [OUT]
583 * \param py pointer to get the pixel height [OUT]
584 * \return 0 on success, -1 if the specified video does not exist
587 int libvlc_video_get_size( libvlc_media_player_t *p_mi, unsigned num,
588 unsigned *px, unsigned *py );
591 * Get current video height.
592 * You should use libvlc_video_get_size() instead.
594 * \param p_mi the media player
595 * \return the video pixel height or 0 if not applicable
598 int libvlc_video_get_height( libvlc_media_player_t *p_mi );
601 * Get current video width.
602 * You should use libvlc_video_get_size() instead.
604 * \param p_mi the media player
605 * \return the video pixel width or 0 if not applicable
608 int libvlc_video_get_width( libvlc_media_player_t *p_mi );
611 * Get the mouse pointer coordinates over a video.
612 * Coordinates are expressed in terms of the decoded video resolution,
613 * <b>not</b> in terms of pixels on the screen/viewport (to get the latter,
614 * you can query your windowing system directly).
616 * Either of the coordinates may be negative or larger than the corresponding
617 * dimension of the video, if the cursor is outside the rendering area.
619 * @warning The coordinates may be out-of-date if the pointer is not located
620 * on the video rendering area. LibVLC does not track the pointer if it is
621 * outside of the video widget.
623 * @note LibVLC does not support multiple pointers (it does of course support
624 * multiple input devices sharing the same pointer) at the moment.
626 * \param p_mi media player
627 * \param num number of the video (starting from, and most commonly 0)
628 * \param px pointer to get the abscissa [OUT]
629 * \param py pointer to get the ordinate [OUT]
630 * \return 0 on success, -1 if the specified video does not exist
633 int libvlc_video_get_cursor( libvlc_media_player_t *p_mi, unsigned num,
637 * Get the current video scaling factor.
638 * See also libvlc_video_set_scale().
640 * \param p_mi the media player
641 * \return the currently configured zoom factor, or 0. if the video is set
642 * to fit to the output window/drawable automatically.
644 VLC_PUBLIC_API float libvlc_video_get_scale( libvlc_media_player_t *p_mi );
647 * Set the video scaling factor. That is the ratio of the number of pixels on
648 * screen to the number of pixels in the original decoded video in each
649 * dimension. Zero is a special value; it will adjust the video to the output
650 * window/drawable (in windowed mode) or the entire screen.
652 * Note that not all video outputs support scaling.
654 * \param p_mi the media player
655 * \param f_factor the scaling factor, or zero
657 VLC_PUBLIC_API void libvlc_video_set_scale( libvlc_media_player_t *p_mi, float f_factor );
660 * Get current video aspect ratio.
662 * \param p_mi the media player
663 * \return the video aspect ratio or NULL if unspecified
664 * (the result must be released with free()).
666 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *p_mi );
669 * Set new video aspect ratio.
671 * \param p_mi the media player
672 * \param psz_aspect new video aspect-ratio or NULL to reset to default
673 * \note Invalid aspect ratios are ignored.
675 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *p_mi, const char *psz_aspect );
678 * Get current video subtitle.
680 * \param p_mi the media player
681 * \return the video subtitle selected, or -1 if none
683 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *p_mi );
686 * Get the number of available video subtitles.
688 * \param p_mi the media player
689 * \return the number of available video subtitles
691 VLC_PUBLIC_API int libvlc_video_get_spu_count( libvlc_media_player_t *p_mi );
694 * Get the description of available video subtitles.
696 * \param p_mi the media player
697 * \return list containing description of available video subtitles
699 VLC_PUBLIC_API libvlc_track_description_t *
700 libvlc_video_get_spu_description( libvlc_media_player_t *p_mi );
703 * Set new video subtitle.
705 * \param p_mi the media player
706 * \param i_spu new video subtitle to select
707 * \return 0 on success, -1 if out of range
709 VLC_PUBLIC_API int libvlc_video_set_spu( libvlc_media_player_t *p_mi, unsigned i_spu );
712 * Set new video subtitle file.
714 * \param p_mi the media player
715 * \param psz_subtitle new video subtitle file
716 * \return the success status (boolean)
718 VLC_PUBLIC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *p_mi, const char *psz_subtitle );
721 * Get the description of available titles.
723 * \param p_mi the media player
724 * \return list containing description of available titles
726 VLC_PUBLIC_API libvlc_track_description_t *
727 libvlc_video_get_title_description( libvlc_media_player_t *p_mi );
730 * Get the description of available chapters for specific title.
732 * \param p_mi the media player
733 * \param i_title selected title
734 * \return list containing description of available chapter for title i_title
736 VLC_PUBLIC_API libvlc_track_description_t *
737 libvlc_video_get_chapter_description( libvlc_media_player_t *p_mi, int i_title );
740 * Get current crop filter geometry.
742 * \param p_mi the media player
743 * \return the crop filter geometry or NULL if unset
745 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *p_mi );
748 * Set new crop filter geometry.
750 * \param p_mi the media player
751 * \param psz_geometry new crop filter geometry (NULL to unset)
754 void libvlc_video_set_crop_geometry( libvlc_media_player_t *p_mi, const char *psz_geometry );
757 * Get current teletext page requested.
759 * \param p_mi the media player
760 * \return the current teletext page requested.
762 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t *p_mi );
765 * Set new teletext page to retrieve.
767 * \param p_mi the media player
768 * \param i_page teletex page number requested
770 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *p_mi, int i_page );
773 * Toggle teletext transparent status on video output.
775 * \param p_mi the media player
777 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *p_mi );
780 * Get number of available video tracks.
782 * \param p_mi media player
783 * \return the number of available video tracks (int)
785 VLC_PUBLIC_API int libvlc_video_get_track_count( libvlc_media_player_t *p_mi );
788 * Get the description of available video tracks.
790 * \param p_mi media player
791 * \return list with description of available video tracks, or NULL on error
793 VLC_PUBLIC_API libvlc_track_description_t *
794 libvlc_video_get_track_description( libvlc_media_player_t *p_mi );
797 * Get current video track.
799 * \param p_mi media player
800 * \return the video track (int) or -1 if none
802 VLC_PUBLIC_API int libvlc_video_get_track( libvlc_media_player_t *p_mi );
807 * \param p_mi media player
808 * \param i_track the track (int)
809 * \return 0 on success, -1 if out of range
812 int libvlc_video_set_track( libvlc_media_player_t *p_mi, int i_track );
815 * Take a snapshot of the current video window.
817 * If i_width AND i_height is 0, original size is used.
818 * If i_width XOR i_height is 0, original aspect-ratio is preserved.
820 * \param p_mi media player instance
821 * \param num number of video output (typically 0 for the first/only one)
822 * \param psz_filepath the path where to save the screenshot to
823 * \param i_width the snapshot's width
824 * \param i_height the snapshot's height
825 * \return 0 on success, -1 if the video was not found
828 int libvlc_video_take_snapshot( libvlc_media_player_t *p_mi, unsigned num,
829 const char *psz_filepath, unsigned int i_width,
830 unsigned int i_height );
833 * Enable or disable deinterlace filter
835 * \param p_mi libvlc media player
836 * \param psz_mode type of deinterlace filter, NULL to disable
838 VLC_PUBLIC_API void libvlc_video_set_deinterlace( libvlc_media_player_t *p_mi,
839 const char *psz_mode );
842 * Get an integer marquee option value
844 * \param p_mi libvlc media player
845 * \param option marq option to get \see libvlc_video_marquee_int_option_t
847 VLC_PUBLIC_API int libvlc_video_get_marquee_int( libvlc_media_player_t *p_mi,
851 * Get a string marquee option value
853 * \param p_mi libvlc media player
854 * \param option marq option to get \see libvlc_video_marquee_string_option_t
856 VLC_PUBLIC_API char *libvlc_video_get_marquee_string( libvlc_media_player_t *p_mi,
860 * Enable, disable or set an integer marquee option
862 * Setting libvlc_marquee_Enable has the side effect of enabling (arg !0)
863 * or disabling (arg 0) the marq filter.
865 * \param p_mi libvlc media player
866 * \param option marq option to set \see libvlc_video_marquee_int_option_t
867 * \param i_val marq option value
869 VLC_PUBLIC_API void libvlc_video_set_marquee_int( libvlc_media_player_t *p_mi,
870 unsigned option, int i_val );
873 * Set a marquee string option
875 * \param p_mi libvlc media player
876 * \param option marq option to set \see libvlc_video_marquee_string_option_t
877 * \param psz_text marq option value
879 VLC_PUBLIC_API void libvlc_video_set_marquee_string( libvlc_media_player_t *p_mi,
880 unsigned option, const char *psz_text );
882 /** option values for libvlc_video_{get,set}_logo_{int,string} */
883 enum libvlc_video_logo_option_t {
885 libvlc_logo_file, /**< string argument, "file,d,t;file,d,t;..." */
891 libvlc_logo_position,
895 * Get integer logo option.
897 * \param p_mi libvlc media player instance
898 * \param option logo option to get, values of libvlc_video_logo_option_t
900 VLC_PUBLIC_API int libvlc_video_get_logo_int( libvlc_media_player_t *p_mi,
904 * Set logo option as integer. Options that take a different type value
906 * Passing libvlc_logo_enable as option value has the side effect of
907 * starting (arg !0) or stopping (arg 0) the logo filter.
909 * \param p_mi libvlc media player instance
910 * \param option logo option to set, values of libvlc_video_logo_option_t
911 * \param value logo option value
913 VLC_PUBLIC_API void libvlc_video_set_logo_int( libvlc_media_player_t *p_mi,
914 unsigned option, int value );
917 * Set logo option as string. Options that take a different type value
920 * \param p_mi libvlc media player instance
921 * \param option logo option to set, values of libvlc_video_logo_option_t
922 * \param psz_value logo option value
924 VLC_PUBLIC_API void libvlc_video_set_logo_string( libvlc_media_player_t *p_mi,
925 unsigned option, const char *psz_value );
928 /** option values for libvlc_video_{get,set}_adjust_{int,float,bool} */
929 enum libvlc_video_adjust_option_t {
930 libvlc_adjust_Enable = 0,
931 libvlc_adjust_Contrast,
932 libvlc_adjust_Brightness,
934 libvlc_adjust_Saturation,
939 * Get integer adjust option.
941 * \param p_mi libvlc media player instance
942 * \param option adjust option to get, values of libvlc_video_adjust_option_t
944 VLC_PUBLIC_API int libvlc_video_get_adjust_int( libvlc_media_player_t *p_mi,
948 * Set adjust option as integer. Options that take a different type value
950 * Passing libvlc_adjust_enable as option value has the side effect of
951 * starting (arg !0) or stopping (arg 0) the adjust filter.
953 * \param p_mi libvlc media player instance
954 * \param option adust option to set, values of libvlc_video_adjust_option_t
955 * \param value adjust option value
957 VLC_PUBLIC_API void libvlc_video_set_adjust_int( libvlc_media_player_t *p_mi,
958 unsigned option, int value );
961 * Get float adjust option.
963 * \param p_mi libvlc media player instance
964 * \param option adjust option to get, values of libvlc_video_adjust_option_t
966 VLC_PUBLIC_API float libvlc_video_get_adjust_float( libvlc_media_player_t *p_mi,
970 * Set adjust option as float. Options that take a different type value
973 * \param p_mi libvlc media player instance
974 * \param option adust option to set, values of libvlc_video_adjust_option_t
975 * \param value adjust option value
977 VLC_PUBLIC_API void libvlc_video_set_adjust_float( libvlc_media_player_t *p_mi,
978 unsigned option, float value );
982 /** \defgroup libvlc_audio LibVLC audio controls
989 typedef enum libvlc_audio_output_device_types_t {
990 libvlc_AudioOutputDevice_Error = -1,
991 libvlc_AudioOutputDevice_Mono = 1,
992 libvlc_AudioOutputDevice_Stereo = 2,
993 libvlc_AudioOutputDevice_2F2R = 4,
994 libvlc_AudioOutputDevice_3F2R = 5,
995 libvlc_AudioOutputDevice_5_1 = 6,
996 libvlc_AudioOutputDevice_6_1 = 7,
997 libvlc_AudioOutputDevice_7_1 = 8,
998 libvlc_AudioOutputDevice_SPDIF = 10
999 } libvlc_audio_output_device_types_t;
1004 typedef enum libvlc_audio_output_channel_t {
1005 libvlc_AudioChannel_Error = -1,
1006 libvlc_AudioChannel_Stereo = 1,
1007 libvlc_AudioChannel_RStereo = 2,
1008 libvlc_AudioChannel_Left = 3,
1009 libvlc_AudioChannel_Right = 4,
1010 libvlc_AudioChannel_Dolbys = 5
1011 } libvlc_audio_output_channel_t;
1015 * Get the list of available audio outputs
1017 * \param p_instance libvlc instance
1018 * \return list of available audio outputs. It must be freed it with
1019 * \see libvlc_audio_output_list_release \see libvlc_audio_output_t .
1020 * In case of error, NULL is returned.
1022 VLC_PUBLIC_API libvlc_audio_output_t *
1023 libvlc_audio_output_list_get( libvlc_instance_t *p_instance );
1026 * Free the list of available audio outputs
1028 * \param p_list list with audio outputs for release
1030 VLC_PUBLIC_API void libvlc_audio_output_list_release( libvlc_audio_output_t *p_list );
1033 * Set the audio output.
1034 * Change will be applied after stop and play.
1036 * \param p_mi media player
1037 * \param psz_name name of audio output,
1038 * use psz_name of \see libvlc_audio_output_t
1039 * \return true if function succeded
1041 VLC_PUBLIC_API int libvlc_audio_output_set( libvlc_media_player_t *p_mi,
1042 const char *psz_name );
1045 * Get count of devices for audio output, these devices are hardware oriented
1046 * like analor or digital output of sound card
1048 * \param p_instance libvlc instance
1049 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1050 * \return number of devices
1052 VLC_PUBLIC_API int libvlc_audio_output_device_count( libvlc_instance_t *p_instance,
1053 const char *psz_audio_output );
1056 * Get long name of device, if not available short name given
1058 * \param p_instance libvlc instance
1059 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1060 * \param i_device device index
1061 * \return long name of device
1063 VLC_PUBLIC_API char * libvlc_audio_output_device_longname( libvlc_instance_t *p_instance,
1064 const char *psz_audio_output,
1068 * Get id name of device
1070 * \param p_instance libvlc instance
1071 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1072 * \param i_device device index
1073 * \return id name of device, use for setting device, need to be free after use
1075 VLC_PUBLIC_API char * libvlc_audio_output_device_id( libvlc_instance_t *p_instance,
1076 const char *psz_audio_output,
1080 * Set audio output device. Changes are only effective after stop and play.
1082 * \param p_mi media player
1083 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1084 * \param psz_device_id device
1086 VLC_PUBLIC_API void libvlc_audio_output_device_set( libvlc_media_player_t *p_mi,
1087 const char *psz_audio_output,
1088 const char *psz_device_id );
1091 * Get current audio device type. Device type describes something like
1092 * character of output sound - stereo sound, 2.1, 5.1 etc
1094 * \param p_mi media player
1095 * \return the audio devices type \see libvlc_audio_output_device_types_t
1097 VLC_PUBLIC_API int libvlc_audio_output_get_device_type( libvlc_media_player_t *p_mi );
1100 * Set current audio device type.
1102 * \param p_mi vlc instance
1103 * \param device_type the audio device type,
1104 according to \see libvlc_audio_output_device_types_t
1106 VLC_PUBLIC_API void libvlc_audio_output_set_device_type( libvlc_media_player_t *p_mi,
1111 * Toggle mute status.
1113 * \param p_mi media player
1115 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_media_player_t *p_mi );
1118 * Get current mute status.
1120 * \param p_mi media player
1121 * \return the mute status (boolean)
1123 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_media_player_t *p_mi );
1128 * \param p_mi media player
1129 * \param status If status is true then mute, otherwise unmute
1131 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_media_player_t *p_mi, int status );
1134 * Get current audio level.
1136 * \param p_mi media player
1137 * \return the audio level (int)
1139 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_media_player_t *p_mi );
1142 * Set current audio level.
1144 * \param p_mi media player
1145 * \param i_volume the volume (int)
1146 * \return 0 if the volume was set, -1 if it was out of range
1148 VLC_PUBLIC_API int libvlc_audio_set_volume( libvlc_media_player_t *p_mi, int i_volume );
1151 * Get number of available audio tracks.
1153 * \param p_mi media player
1154 * \return the number of available audio tracks (int), or -1 if unavailable
1156 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *p_mi );
1159 * Get the description of available audio tracks.
1161 * \param p_mi media player
1162 * \return list with description of available audio tracks, or NULL
1164 VLC_PUBLIC_API libvlc_track_description_t *
1165 libvlc_audio_get_track_description( libvlc_media_player_t *p_mi );
1168 * Get current audio track.
1170 * \param p_mi media player
1171 * \return the audio track (int), or -1 if none.
1173 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *p_mi );
1176 * Set current audio track.
1178 * \param p_mi media player
1179 * \param i_track the track (int)
1180 * \return 0 on success, -1 on error
1182 VLC_PUBLIC_API int libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track );
1185 * Get current audio channel.
1187 * \param p_mi media player
1188 * \return the audio channel \see libvlc_audio_output_channel_t
1190 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_media_player_t *p_mi );
1193 * Set current audio channel.
1195 * \param p_mi media player
1196 * \param channel the audio channel, \see libvlc_audio_output_channel_t
1197 * \return 0 on success, -1 on error
1199 VLC_PUBLIC_API int libvlc_audio_set_channel( libvlc_media_player_t *p_mi, int channel );
1203 /** @} media_player */
1209 #endif /* VLC_LIBVLC_MEDIA_PLAYER_H */