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 the NSView handler where the media player should render its video output.
206 * Use the vout called "macosx".
208 * The drawable is an NSObject that follow the VLCOpenGLVideoViewEmbedding
212 * \@protocol VLCOpenGLVideoViewEmbedding <NSObject>
213 * - (void)addVoutSubview:(NSView *)view;
214 * - (void)removeVoutSubview:(NSView *)view;
218 * Or it can be an NSView object.
220 * If you want to use it along with Qt4 see the QMacCocoaViewContainer. Then
221 * the following code should work:
224 * NSView *video = [[NSView alloc] init];
225 * QMacCocoaViewContainer *container = new QMacCocoaViewContainer(video, parent);
226 * libvlc_media_player_set_nsobject(mp, video);
231 * You can find a live example in VLCVideoView in VLCKit.framework.
233 * \param p_mi the Media Player
234 * \param drawable the drawable that is either an NSView or an object following
235 * the VLCOpenGLVideoViewEmbedding protocol.
237 VLC_PUBLIC_API void libvlc_media_player_set_nsobject ( libvlc_media_player_t *p_mi, void * drawable );
240 * Get the NSView handler previously set with libvlc_media_player_set_nsobject().
242 * \param p_mi the Media Player
243 * \return the NSView handler or 0 if none where set
245 VLC_PUBLIC_API void * libvlc_media_player_get_nsobject ( libvlc_media_player_t *p_mi );
248 * Set the agl handler where the media player should render its video output.
250 * \param p_mi the Media Player
251 * \param drawable the agl handler
253 VLC_PUBLIC_API void libvlc_media_player_set_agl ( libvlc_media_player_t *p_mi, uint32_t drawable );
256 * Get the agl handler previously set with libvlc_media_player_set_agl().
258 * \param p_mi the Media Player
259 * \return the agl handler or 0 if none where set
261 VLC_PUBLIC_API uint32_t libvlc_media_player_get_agl ( libvlc_media_player_t *p_mi );
264 * Set an X Window System drawable where the media player should render its
265 * video output. If LibVLC was built without X11 output support, then this has
268 * The specified identifier must correspond to an existing Input/Output class
269 * X11 window. Pixmaps are <b>not</b> supported. The caller shall ensure that
270 * the X11 server is the same as the one the VLC instance has been configured
272 * If XVideo is <b>not</b> used, it is assumed that the drawable has the
273 * following properties in common with the default X11 screen: depth, scan line
274 * pad, black pixel. This is a bug.
276 * \param p_mi the Media Player
277 * \param drawable the ID of the X window
279 VLC_PUBLIC_API void libvlc_media_player_set_xwindow ( libvlc_media_player_t *p_mi, uint32_t drawable );
282 * Get the X Window System window identifier previously set with
283 * libvlc_media_player_set_xwindow(). Note that this will return the identifier
284 * even if VLC is not currently using it (for instance if it is playing an
287 * \param p_mi the Media Player
288 * \return an X window ID, or 0 if none where set.
290 VLC_PUBLIC_API uint32_t libvlc_media_player_get_xwindow ( libvlc_media_player_t *p_mi );
293 * Set a Win32/Win64 API window handle (HWND) where the media player should
294 * render its video output. If LibVLC was built without Win32/Win64 API output
295 * support, then this has no effects.
297 * \param p_mi the Media Player
298 * \param drawable windows handle of the drawable
300 VLC_PUBLIC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi, void *drawable );
303 * Get the Windows API window handle (HWND) previously set with
304 * libvlc_media_player_set_hwnd(). The handle will be returned even if LibVLC
305 * is not currently outputting any video to it.
307 * \param p_mi the Media Player
308 * \return a window handle or NULL if there are none.
310 VLC_PUBLIC_API void *libvlc_media_player_get_hwnd ( libvlc_media_player_t *p_mi );
314 /** \bug This might go away ... to be replaced by a broader system */
317 * Get the current movie length (in ms).
319 * \param p_mi the Media Player
320 * \return the movie length (in ms), or -1 if there is no media.
322 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_length( libvlc_media_player_t *p_mi );
325 * Get the current movie time (in ms).
327 * \param p_mi the Media Player
328 * \return the movie time (in ms), or -1 if there is no media.
330 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_time( libvlc_media_player_t *p_mi );
333 * Set the movie time (in ms). This has no effect if no media is being played.
334 * Not all formats and protocols support this.
336 * \param p_mi the Media Player
337 * \param i_time the movie time (in ms).
339 VLC_PUBLIC_API void libvlc_media_player_set_time( libvlc_media_player_t *p_mi, libvlc_time_t i_time );
342 * Get movie position.
344 * \param p_mi the Media Player
345 * \return movie position, or -1. in case of error
347 VLC_PUBLIC_API float libvlc_media_player_get_position( libvlc_media_player_t *p_mi );
350 * Set movie position. This has no effect if playback is not enabled.
351 * This might not work depending on the underlying input format and protocol.
353 * \param p_mi the Media Player
354 * \param f_pos the position
356 VLC_PUBLIC_API void libvlc_media_player_set_position( libvlc_media_player_t *p_mi, float f_pos );
359 * Set movie chapter (if applicable).
361 * \param p_mi the Media Player
362 * \param i_chapter chapter number to play
364 VLC_PUBLIC_API void libvlc_media_player_set_chapter( libvlc_media_player_t *p_mi, int i_chapter );
369 * \param p_mi the Media Player
370 * \return chapter number currently playing, or -1 if there is no media.
372 VLC_PUBLIC_API int libvlc_media_player_get_chapter( libvlc_media_player_t *p_mi );
375 * Get movie chapter count
377 * \param p_mi the Media Player
378 * \return number of chapters in movie, or -1.
380 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count( libvlc_media_player_t *p_mi );
383 * Is the player able to play
385 * \param p_mi the Media Player
388 VLC_PUBLIC_API int libvlc_media_player_will_play( libvlc_media_player_t *p_mi );
391 * Get title chapter count
393 * \param p_mi the Media Player
394 * \param i_title title
395 * \return number of chapters in title, or -1
397 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count_for_title(
398 libvlc_media_player_t *p_mi, int i_title );
403 * \param p_mi the Media Player
404 * \param i_title title number to play
406 VLC_PUBLIC_API void libvlc_media_player_set_title( libvlc_media_player_t *p_mi, int i_title );
411 * \param p_mi the Media Player
412 * \return title number currently playing, or -1
414 VLC_PUBLIC_API int libvlc_media_player_get_title( libvlc_media_player_t *p_mi );
417 * Get movie title count
419 * \param p_mi the Media Player
420 * \return title number count, or -1
422 VLC_PUBLIC_API int libvlc_media_player_get_title_count( libvlc_media_player_t *p_mi );
425 * Set previous chapter (if applicable)
427 * \param p_mi the Media Player
429 VLC_PUBLIC_API void libvlc_media_player_previous_chapter( libvlc_media_player_t *p_mi );
432 * Set next chapter (if applicable)
434 * \param p_mi the Media Player
436 VLC_PUBLIC_API void libvlc_media_player_next_chapter( libvlc_media_player_t *p_mi );
439 * Get the requested movie play rate.
440 * @warning Depending on the underlying media, the requested rate may be
441 * different from the real playback rate.
443 * \param p_mi the Media Player
444 * \return movie play rate
446 VLC_PUBLIC_API float libvlc_media_player_get_rate( libvlc_media_player_t *p_mi );
449 * Set movie play rate
451 * \param p_mi the Media Player
452 * \param rate movie play rate to set
453 * \return -1 if an error was detected, 0 otherwise (but even then, it might
454 * not actually work depending on the underlying media protocol)
456 VLC_PUBLIC_API int libvlc_media_player_set_rate( libvlc_media_player_t *p_mi, float rate );
459 * Get current movie state
461 * \param p_mi the Media Player
462 * \return the current state of the media player (playing, paused, ...) \see libvlc_state_t
464 VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *p_mi );
469 * \param p_mi the Media Player
470 * \return frames per second (fps) for this playing movie, or 0 if unspecified
472 VLC_PUBLIC_API float libvlc_media_player_get_fps( libvlc_media_player_t *p_mi );
477 * How many video outputs does this media player have?
479 * \param p_mi the media player
480 * \return the number of video outputs
482 VLC_PUBLIC_API unsigned libvlc_media_player_has_vout( libvlc_media_player_t *p_mi );
485 * Is this media player seekable?
487 * \param p_mi the media player
488 * \return true if the media player can seek
490 VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi );
493 * Can this media player be paused?
495 * \param p_mi the media player
496 * \return true if the media player can pause
498 VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi );
502 * Display the next frame (if supported)
504 * \param p_mi the media player
506 VLC_PUBLIC_API void libvlc_media_player_next_frame( libvlc_media_player_t *p_mi );
511 * Release (free) libvlc_track_description_t
513 * \param p_track_description the structure to release
515 VLC_PUBLIC_API void libvlc_track_description_release( libvlc_track_description_t *p_track_description );
517 /** \defgroup libvlc_video LibVLC video controls
522 * Toggle fullscreen status on non-embedded video outputs.
524 * @warning The same limitations applies to this function
525 * as to libvlc_set_fullscreen().
527 * \param p_mi the media player
529 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *p_mi );
532 * Enable or disable fullscreen.
534 * @warning With most window managers, only a top-level windows can be in
535 * full-screen mode. Hence, this function will not operate properly if
536 * libvlc_media_player_set_xid() was used to embed the video in a non-top-level
537 * window. In that case, the embedding window must be reparented to the root
538 * window <b>before</b> fullscreen mode is enabled. You will want to reparent
539 * it back to its normal parent when disabling fullscreen.
541 * \param p_mi the media player
542 * \param b_fullscreen boolean for fullscreen status
544 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *p_mi, int b_fullscreen );
547 * Get current fullscreen status.
549 * \param p_mi the media player
550 * \return the fullscreen status (boolean)
552 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t *p_mi );
555 * Enable or disable key press events handling, according to the LibVLC hotkeys
556 * configuration. By default and for historical reasons, keyboard events are
557 * handled by the LibVLC video widget.
559 * \note On X11, there can be only one subscriber for key press and mouse
560 * click events per window. If your application has subscribed to those events
561 * for the X window ID of the video widget, then LibVLC will not be able to
562 * handle key presses and mouse clicks in any case.
564 * \warning This function is only implemented for X11 and Win32 at the moment.
566 * \param p_mi the media player
567 * \param on true to handle key press events, false to ignore them.
570 void libvlc_video_set_key_input( libvlc_media_player_t *p_mi, unsigned on );
573 * Enable or disable mouse click events handling. By default, those events are
574 * handled. This is needed for DVD menus to work, as well as a few video
575 * filters such as "puzzle".
577 * \note See also libvlc_video_set_key_input().
579 * \warning This function is only implemented for X11 and Win32 at the moment.
581 * \param p_mi the media player
582 * \param on true to handle mouse click events, false to ignore them.
585 void libvlc_video_set_mouse_input( libvlc_media_player_t *p_mi, unsigned on );
588 * Get the pixel dimensions of a video.
590 * \param p_mi media player
591 * \param num number of the video (starting from, and most commonly 0)
592 * \param px pointer to get the pixel width [OUT]
593 * \param py pointer to get the pixel height [OUT]
594 * \return 0 on success, -1 if the specified video does not exist
597 int libvlc_video_get_size( libvlc_media_player_t *p_mi, unsigned num,
598 unsigned *px, unsigned *py );
601 * Get current video height.
602 * You should use libvlc_video_get_size() instead.
604 * \param p_mi the media player
605 * \return the video pixel height or 0 if not applicable
608 int libvlc_video_get_height( libvlc_media_player_t *p_mi );
611 * Get current video width.
612 * You should use libvlc_video_get_size() instead.
614 * \param p_mi the media player
615 * \return the video pixel width or 0 if not applicable
618 int libvlc_video_get_width( libvlc_media_player_t *p_mi );
621 * Get the mouse pointer coordinates over a video.
622 * Coordinates are expressed in terms of the decoded video resolution,
623 * <b>not</b> in terms of pixels on the screen/viewport (to get the latter,
624 * you can query your windowing system directly).
626 * Either of the coordinates may be negative or larger than the corresponding
627 * dimension of the video, if the cursor is outside the rendering area.
629 * @warning The coordinates may be out-of-date if the pointer is not located
630 * on the video rendering area. LibVLC does not track the pointer if it is
631 * outside of the video widget.
633 * @note LibVLC does not support multiple pointers (it does of course support
634 * multiple input devices sharing the same pointer) at the moment.
636 * \param p_mi media player
637 * \param num number of the video (starting from, and most commonly 0)
638 * \param px pointer to get the abscissa [OUT]
639 * \param py pointer to get the ordinate [OUT]
640 * \return 0 on success, -1 if the specified video does not exist
643 int libvlc_video_get_cursor( libvlc_media_player_t *p_mi, unsigned num,
647 * Get the current video scaling factor.
648 * See also libvlc_video_set_scale().
650 * \param p_mi the media player
651 * \return the currently configured zoom factor, or 0. if the video is set
652 * to fit to the output window/drawable automatically.
654 VLC_PUBLIC_API float libvlc_video_get_scale( libvlc_media_player_t *p_mi );
657 * Set the video scaling factor. That is the ratio of the number of pixels on
658 * screen to the number of pixels in the original decoded video in each
659 * dimension. Zero is a special value; it will adjust the video to the output
660 * window/drawable (in windowed mode) or the entire screen.
662 * Note that not all video outputs support scaling.
664 * \param p_mi the media player
665 * \param f_factor the scaling factor, or zero
667 VLC_PUBLIC_API void libvlc_video_set_scale( libvlc_media_player_t *p_mi, float f_factor );
670 * Get current video aspect ratio.
672 * \param p_mi the media player
673 * \return the video aspect ratio or NULL if unspecified
674 * (the result must be released with free()).
676 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *p_mi );
679 * Set new video aspect ratio.
681 * \param p_mi the media player
682 * \param psz_aspect new video aspect-ratio or NULL to reset to default
683 * \note Invalid aspect ratios are ignored.
685 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *p_mi, const char *psz_aspect );
688 * Get current video subtitle.
690 * \param p_mi the media player
691 * \return the video subtitle selected, or -1 if none
693 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *p_mi );
696 * Get the number of available video subtitles.
698 * \param p_mi the media player
699 * \return the number of available video subtitles
701 VLC_PUBLIC_API int libvlc_video_get_spu_count( libvlc_media_player_t *p_mi );
704 * Get the description of available video subtitles.
706 * \param p_mi the media player
707 * \return list containing description of available video subtitles
709 VLC_PUBLIC_API libvlc_track_description_t *
710 libvlc_video_get_spu_description( libvlc_media_player_t *p_mi );
713 * Set new video subtitle.
715 * \param p_mi the media player
716 * \param i_spu new video subtitle to select
717 * \return 0 on success, -1 if out of range
719 VLC_PUBLIC_API int libvlc_video_set_spu( libvlc_media_player_t *p_mi, unsigned i_spu );
722 * Set new video subtitle file.
724 * \param p_mi the media player
725 * \param psz_subtitle new video subtitle file
726 * \return the success status (boolean)
728 VLC_PUBLIC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *p_mi, const char *psz_subtitle );
731 * Get the description of available titles.
733 * \param p_mi the media player
734 * \return list containing description of available titles
736 VLC_PUBLIC_API libvlc_track_description_t *
737 libvlc_video_get_title_description( libvlc_media_player_t *p_mi );
740 * Get the description of available chapters for specific title.
742 * \param p_mi the media player
743 * \param i_title selected title
744 * \return list containing description of available chapter for title i_title
746 VLC_PUBLIC_API libvlc_track_description_t *
747 libvlc_video_get_chapter_description( libvlc_media_player_t *p_mi, int i_title );
750 * Get current crop filter geometry.
752 * \param p_mi the media player
753 * \return the crop filter geometry or NULL if unset
755 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *p_mi );
758 * Set new crop filter geometry.
760 * \param p_mi the media player
761 * \param psz_geometry new crop filter geometry (NULL to unset)
764 void libvlc_video_set_crop_geometry( libvlc_media_player_t *p_mi, const char *psz_geometry );
767 * Get current teletext page requested.
769 * \param p_mi the media player
770 * \return the current teletext page requested.
772 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t *p_mi );
775 * Set new teletext page to retrieve.
777 * \param p_mi the media player
778 * \param i_page teletex page number requested
780 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *p_mi, int i_page );
783 * Toggle teletext transparent status on video output.
785 * \param p_mi the media player
787 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *p_mi );
790 * Get number of available video tracks.
792 * \param p_mi media player
793 * \return the number of available video tracks (int)
795 VLC_PUBLIC_API int libvlc_video_get_track_count( libvlc_media_player_t *p_mi );
798 * Get the description of available video tracks.
800 * \param p_mi media player
801 * \return list with description of available video tracks, or NULL on error
803 VLC_PUBLIC_API libvlc_track_description_t *
804 libvlc_video_get_track_description( libvlc_media_player_t *p_mi );
807 * Get current video track.
809 * \param p_mi media player
810 * \return the video track (int) or -1 if none
812 VLC_PUBLIC_API int libvlc_video_get_track( libvlc_media_player_t *p_mi );
817 * \param p_mi media player
818 * \param i_track the track (int)
819 * \return 0 on success, -1 if out of range
822 int libvlc_video_set_track( libvlc_media_player_t *p_mi, int i_track );
825 * Take a snapshot of the current video window.
827 * If i_width AND i_height is 0, original size is used.
828 * If i_width XOR i_height is 0, original aspect-ratio is preserved.
830 * \param p_mi media player instance
831 * \param num number of video output (typically 0 for the first/only one)
832 * \param psz_filepath the path where to save the screenshot to
833 * \param i_width the snapshot's width
834 * \param i_height the snapshot's height
835 * \return 0 on success, -1 if the video was not found
838 int libvlc_video_take_snapshot( libvlc_media_player_t *p_mi, unsigned num,
839 const char *psz_filepath, unsigned int i_width,
840 unsigned int i_height );
843 * Enable or disable deinterlace filter
845 * \param p_mi libvlc media player
846 * \param psz_mode type of deinterlace filter, NULL to disable
848 VLC_PUBLIC_API void libvlc_video_set_deinterlace( libvlc_media_player_t *p_mi,
849 const char *psz_mode );
852 * Get an integer marquee option value
854 * \param p_mi libvlc media player
855 * \param option marq option to get \see libvlc_video_marquee_int_option_t
857 VLC_PUBLIC_API int libvlc_video_get_marquee_int( libvlc_media_player_t *p_mi,
861 * Get a string marquee option value
863 * \param p_mi libvlc media player
864 * \param option marq option to get \see libvlc_video_marquee_string_option_t
866 VLC_PUBLIC_API char *libvlc_video_get_marquee_string( libvlc_media_player_t *p_mi,
870 * Enable, disable or set an integer marquee option
872 * Setting libvlc_marquee_Enable has the side effect of enabling (arg !0)
873 * or disabling (arg 0) the marq filter.
875 * \param p_mi libvlc media player
876 * \param option marq option to set \see libvlc_video_marquee_int_option_t
877 * \param i_val marq option value
879 VLC_PUBLIC_API void libvlc_video_set_marquee_int( libvlc_media_player_t *p_mi,
880 unsigned option, int i_val );
883 * Set a marquee string option
885 * \param p_mi libvlc media player
886 * \param option marq option to set \see libvlc_video_marquee_string_option_t
887 * \param psz_text marq option value
889 VLC_PUBLIC_API void libvlc_video_set_marquee_string( libvlc_media_player_t *p_mi,
890 unsigned option, const char *psz_text );
892 /** option values for libvlc_video_{get,set}_logo_{int,string} */
893 enum libvlc_video_logo_option_t {
895 libvlc_logo_file, /**< string argument, "file,d,t;file,d,t;..." */
901 libvlc_logo_position,
905 * Get integer logo option.
907 * \param p_mi libvlc media player instance
908 * \param option logo option to get, values of libvlc_video_logo_option_t
910 VLC_PUBLIC_API int libvlc_video_get_logo_int( libvlc_media_player_t *p_mi,
914 * Set logo option as integer. Options that take a different type value
916 * Passing libvlc_logo_enable as option value has the side effect of
917 * starting (arg !0) or stopping (arg 0) the logo filter.
919 * \param p_mi libvlc media player instance
920 * \param option logo option to set, values of libvlc_video_logo_option_t
921 * \param value logo option value
923 VLC_PUBLIC_API void libvlc_video_set_logo_int( libvlc_media_player_t *p_mi,
924 unsigned option, int value );
927 * Set logo option as string. Options that take a different type value
930 * \param p_mi libvlc media player instance
931 * \param option logo option to set, values of libvlc_video_logo_option_t
932 * \param psz_value logo option value
934 VLC_PUBLIC_API void libvlc_video_set_logo_string( libvlc_media_player_t *p_mi,
935 unsigned option, const char *psz_value );
938 /** option values for libvlc_video_{get,set}_adjust_{int,float,bool} */
939 enum libvlc_video_adjust_option_t {
940 libvlc_adjust_Enable = 0,
941 libvlc_adjust_Contrast,
942 libvlc_adjust_Brightness,
944 libvlc_adjust_Saturation,
949 * Get integer adjust option.
951 * \param p_mi libvlc media player instance
952 * \param option adjust option to get, values of libvlc_video_adjust_option_t
953 * \version LibVLC 1.1.1 and later.
955 VLC_PUBLIC_API int libvlc_video_get_adjust_int( libvlc_media_player_t *p_mi,
959 * Set adjust option as integer. Options that take a different type value
961 * Passing libvlc_adjust_enable as option value has the side effect of
962 * starting (arg !0) or stopping (arg 0) the adjust filter.
964 * \param p_mi libvlc media player instance
965 * \param option adust option to set, values of libvlc_video_adjust_option_t
966 * \param value adjust option value
967 * \version LibVLC 1.1.1 and later.
969 VLC_PUBLIC_API void libvlc_video_set_adjust_int( libvlc_media_player_t *p_mi,
970 unsigned option, int value );
973 * Get float adjust option.
975 * \param p_mi libvlc media player instance
976 * \param option adjust option to get, values of libvlc_video_adjust_option_t
977 * \version LibVLC 1.1.1 and later.
979 VLC_PUBLIC_API float libvlc_video_get_adjust_float( libvlc_media_player_t *p_mi,
983 * Set adjust option as float. Options that take a different type value
986 * \param p_mi libvlc media player instance
987 * \param option adust option to set, values of libvlc_video_adjust_option_t
988 * \param value adjust option value
989 * \version LibVLC 1.1.1 and later.
991 VLC_PUBLIC_API void libvlc_video_set_adjust_float( libvlc_media_player_t *p_mi,
992 unsigned option, float value );
996 /** \defgroup libvlc_audio LibVLC audio controls
1001 * Audio device types
1003 typedef enum libvlc_audio_output_device_types_t {
1004 libvlc_AudioOutputDevice_Error = -1,
1005 libvlc_AudioOutputDevice_Mono = 1,
1006 libvlc_AudioOutputDevice_Stereo = 2,
1007 libvlc_AudioOutputDevice_2F2R = 4,
1008 libvlc_AudioOutputDevice_3F2R = 5,
1009 libvlc_AudioOutputDevice_5_1 = 6,
1010 libvlc_AudioOutputDevice_6_1 = 7,
1011 libvlc_AudioOutputDevice_7_1 = 8,
1012 libvlc_AudioOutputDevice_SPDIF = 10
1013 } libvlc_audio_output_device_types_t;
1018 typedef enum libvlc_audio_output_channel_t {
1019 libvlc_AudioChannel_Error = -1,
1020 libvlc_AudioChannel_Stereo = 1,
1021 libvlc_AudioChannel_RStereo = 2,
1022 libvlc_AudioChannel_Left = 3,
1023 libvlc_AudioChannel_Right = 4,
1024 libvlc_AudioChannel_Dolbys = 5
1025 } libvlc_audio_output_channel_t;
1029 * Get the list of available audio outputs
1031 * \param p_instance libvlc instance
1032 * \return list of available audio outputs. It must be freed it with
1033 * \see libvlc_audio_output_list_release \see libvlc_audio_output_t .
1034 * In case of error, NULL is returned.
1036 VLC_PUBLIC_API libvlc_audio_output_t *
1037 libvlc_audio_output_list_get( libvlc_instance_t *p_instance );
1040 * Free the list of available audio outputs
1042 * \param p_list list with audio outputs for release
1044 VLC_PUBLIC_API void libvlc_audio_output_list_release( libvlc_audio_output_t *p_list );
1047 * Set the audio output.
1048 * Change will be applied after stop and play.
1050 * \param p_mi media player
1051 * \param psz_name name of audio output,
1052 * use psz_name of \see libvlc_audio_output_t
1053 * \return true if function succeded
1055 VLC_PUBLIC_API int libvlc_audio_output_set( libvlc_media_player_t *p_mi,
1056 const char *psz_name );
1059 * Get count of devices for audio output, these devices are hardware oriented
1060 * like analor or digital output of sound card
1062 * \param p_instance libvlc instance
1063 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1064 * \return number of devices
1066 VLC_PUBLIC_API int libvlc_audio_output_device_count( libvlc_instance_t *p_instance,
1067 const char *psz_audio_output );
1070 * Get long name of device, if not available short name given
1072 * \param p_instance libvlc instance
1073 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1074 * \param i_device device index
1075 * \return long name of device
1077 VLC_PUBLIC_API char * libvlc_audio_output_device_longname( libvlc_instance_t *p_instance,
1078 const char *psz_audio_output,
1082 * Get id name of device
1084 * \param p_instance libvlc instance
1085 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1086 * \param i_device device index
1087 * \return id name of device, use for setting device, need to be free after use
1089 VLC_PUBLIC_API char * libvlc_audio_output_device_id( libvlc_instance_t *p_instance,
1090 const char *psz_audio_output,
1094 * Set audio output device. Changes are only effective after stop and play.
1096 * \param p_mi media player
1097 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1098 * \param psz_device_id device
1100 VLC_PUBLIC_API void libvlc_audio_output_device_set( libvlc_media_player_t *p_mi,
1101 const char *psz_audio_output,
1102 const char *psz_device_id );
1105 * Get current audio device type. Device type describes something like
1106 * character of output sound - stereo sound, 2.1, 5.1 etc
1108 * \param p_mi media player
1109 * \return the audio devices type \see libvlc_audio_output_device_types_t
1111 VLC_PUBLIC_API int libvlc_audio_output_get_device_type( libvlc_media_player_t *p_mi );
1114 * Set current audio device type.
1116 * \param p_mi vlc instance
1117 * \param device_type the audio device type,
1118 according to \see libvlc_audio_output_device_types_t
1120 VLC_PUBLIC_API void libvlc_audio_output_set_device_type( libvlc_media_player_t *p_mi,
1125 * Toggle mute status.
1127 * \param p_mi media player
1129 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_media_player_t *p_mi );
1132 * Get current mute status.
1134 * \param p_mi media player
1135 * \return the mute status (boolean)
1137 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_media_player_t *p_mi );
1142 * \param p_mi media player
1143 * \param status If status is true then mute, otherwise unmute
1145 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_media_player_t *p_mi, int status );
1148 * Get current audio level.
1150 * \param p_mi media player
1151 * \return the audio level (int)
1153 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_media_player_t *p_mi );
1156 * Set current audio level.
1158 * \param p_mi media player
1159 * \param i_volume the volume (int)
1160 * \return 0 if the volume was set, -1 if it was out of range
1162 VLC_PUBLIC_API int libvlc_audio_set_volume( libvlc_media_player_t *p_mi, int i_volume );
1165 * Get number of available audio tracks.
1167 * \param p_mi media player
1168 * \return the number of available audio tracks (int), or -1 if unavailable
1170 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *p_mi );
1173 * Get the description of available audio tracks.
1175 * \param p_mi media player
1176 * \return list with description of available audio tracks, or NULL
1178 VLC_PUBLIC_API libvlc_track_description_t *
1179 libvlc_audio_get_track_description( libvlc_media_player_t *p_mi );
1182 * Get current audio track.
1184 * \param p_mi media player
1185 * \return the audio track (int), or -1 if none.
1187 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *p_mi );
1190 * Set current audio track.
1192 * \param p_mi media player
1193 * \param i_track the track (int)
1194 * \return 0 on success, -1 on error
1196 VLC_PUBLIC_API int libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track );
1199 * Get current audio channel.
1201 * \param p_mi media player
1202 * \return the audio channel \see libvlc_audio_output_channel_t
1204 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_media_player_t *p_mi );
1207 * Set current audio channel.
1209 * \param p_mi media player
1210 * \param channel the audio channel, \see libvlc_audio_output_channel_t
1211 * \return 0 on success, -1 on error
1213 VLC_PUBLIC_API int libvlc_audio_set_channel( libvlc_media_player_t *p_mi, int channel );
1217 /** @} media_player */
1223 #endif /* VLC_LIBVLC_MEDIA_PLAYER_H */