Revert "Remove libvlc_free"
[vlc/asuraparaju-public.git] / include / vlc / libvlc_media_player.h
blob105090eafc13e384e06fbeee2935c4c595a5958a
1 /*****************************************************************************
2 * libvlc_media_player.h: libvlc_media_player external API
3 *****************************************************************************
4 * Copyright (C) 1998-2010 the VideoLAN team
5 * $Id$
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 *****************************************************************************/
26 /**
27 * \file
28 * This file defines libvlc_media_player external API
31 #ifndef VLC_LIBVLC_MEDIA_PLAYER_H
32 #define VLC_LIBVLC_MEDIA_PLAYER_H 1
34 # ifdef __cplusplus
35 extern "C" {
36 # endif
38 /*****************************************************************************
39 * Media Player
40 *****************************************************************************/
41 /** \defgroup libvlc_media_player LibVLC media player
42 * \ingroup libvlc
43 * A LibVLC media player plays one media (usually in a custom drawable).
44 * @{
47 typedef struct libvlc_media_player_t libvlc_media_player_t;
49 /**
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
55 int i_id;
56 char *psz_name;
57 struct libvlc_track_description_t *p_next;
59 } libvlc_track_description_t;
61 /**
62 * Description for audio output. It contains
63 * name, description and pointer to next record.
65 typedef struct libvlc_audio_output_t
67 char *psz_name;
68 char *psz_description;
69 struct libvlc_audio_output_t *p_next;
71 } libvlc_audio_output_t;
73 /**
74 * Rectangle type for video geometry
76 typedef struct libvlc_rectangle_t
78 int top, left;
79 int bottom, right;
80 } libvlc_rectangle_t;
82 /**
83 * Marq options definition
85 typedef enum libvlc_video_marquee_option_t {
86 libvlc_marquee_Enable = 0,
87 libvlc_marquee_Text, /** string argument */
88 libvlc_marquee_Color,
89 libvlc_marquee_Opacity,
90 libvlc_marquee_Position,
91 libvlc_marquee_Refresh,
92 libvlc_marquee_Size,
93 libvlc_marquee_Timeout,
94 libvlc_marquee_X,
95 libvlc_marquee_Y
96 } libvlc_video_marquee_option_t;
98 /**
99 * Navigation mode
101 typedef enum libvlc_navigate_mode_t
103 libvlc_navigate_activate = 0,
104 libvlc_navigate_up,
105 libvlc_navigate_down,
106 libvlc_navigate_left,
107 libvlc_navigate_right,
108 } libvlc_navigate_mode_t;
111 * Create an empty Media Player object
113 * \param p_libvlc_instance the libvlc instance in which the Media Player
114 * should be created.
115 * \return a new media player object, or NULL on error.
117 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t *p_libvlc_instance );
120 * Create a Media Player object from a Media
122 * \param p_md the media. Afterwards the p_md can be safely
123 * destroyed.
124 * \return a new media player object, or NULL on error.
126 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new_from_media( libvlc_media_t *p_md );
129 * Release a media_player after use
130 * Decrement the reference count of a media player object. If the
131 * reference count is 0, then libvlc_media_player_release() will
132 * release the media player object. If the media player object
133 * has been released, then it should not be used again.
135 * \param p_mi the Media Player to free
137 VLC_PUBLIC_API void libvlc_media_player_release( libvlc_media_player_t *p_mi );
140 * Retain a reference to a media player object. Use
141 * libvlc_media_player_release() to decrement reference count.
143 * \param p_mi media player object
145 VLC_PUBLIC_API void libvlc_media_player_retain( libvlc_media_player_t *p_mi );
148 * Set the media that will be used by the media_player. If any,
149 * previous md will be released.
151 * \param p_mi the Media Player
152 * \param p_md the Media. Afterwards the p_md can be safely
153 * destroyed.
155 VLC_PUBLIC_API void libvlc_media_player_set_media( libvlc_media_player_t *p_mi,
156 libvlc_media_t *p_md );
159 * Get the media used by the media_player.
161 * \param p_mi the Media Player
162 * \return the media associated with p_mi, or NULL if no
163 * media is associated
165 VLC_PUBLIC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t *p_mi );
168 * Get the Event Manager from which the media player send event.
170 * \param p_mi the Media Player
171 * \return the event manager associated with p_mi
173 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *p_mi );
176 * is_playing
178 * \param p_mi the Media Player
179 * \return 1 if the media player is playing, 0 otherwise
181 VLC_PUBLIC_API int libvlc_media_player_is_playing ( libvlc_media_player_t *p_mi );
184 * Play
186 * \param p_mi the Media Player
187 * \return 0 if playback started (and was already started), or -1 on error.
189 VLC_PUBLIC_API int libvlc_media_player_play ( libvlc_media_player_t *p_mi );
192 * Pause or resume (no effect if there is no media)
194 * \param mp the Media Player
195 * \param do_pause play/resume if zero, pause if non-zero
196 * \version LibVLC 1.1.1 or later
198 VLC_PUBLIC_API void libvlc_media_player_set_pause ( libvlc_media_player_t *mp,
199 int do_pause );
202 * Toggle pause (no effect if there is no media)
204 * \param p_mi the Media Player
206 VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *p_mi );
209 * Stop (no effect if there is no media)
211 * \param p_mi the Media Player
213 VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *p_mi );
216 * Set callbacks and private data to render decoded video to a custom area
217 * in memory. Use libvlc_video_set_format() to configure the decoded format.
219 * Whenever a new video frame needs to be decoded, the lock callback is
220 * invoked. Depending on the video chroma, one or three pixel planes of
221 * adequate dimensions must be returned via the second parameter. Those
222 * planes must be aligned on 32-bytes boundaries.
224 * When the video frame is decoded, the unlock callback is invoked. The
225 * second parameter to the callback corresponds is the return value of the
226 * lock callback. The third parameter conveys the pixel planes for convenience.
228 * When the video frame needs to be shown, as determined by the media playback
229 * clock, the display callback is invoked. The second parameter also conveys
230 * the return value from the lock callback.
232 * \param mp the media player
233 * \param lock callback to allocate video memory
234 * \param unlock callback to release video memory
235 * \param opaque private pointer for the three callbacks (as first parameter)
236 * \version LibVLC 1.1.1 or later
238 VLC_PUBLIC_API
239 void libvlc_video_set_callbacks( libvlc_media_player_t *mp,
240 void *(*lock) (void *opaque, void **plane),
241 void (*unlock) (void *opaque, void *picture, void *const *plane),
242 void (*display) (void *opaque, void *picture),
243 void *opaque );
246 * Set decoded video chroma and dimensions. This only works in combination with
247 * libvlc_video_set_callbacks().
249 * \param mp the media player
250 * \param chroma a four-characters string identifying the chroma
251 * (e.g. "RV32" or "I420")
252 * \param width pixel width
253 * \param height pixel height
254 * \param pitch line pitch (in bytes)
255 * \version LibVLC 1.1.1 or later
257 VLC_PUBLIC_API
258 void libvlc_video_set_format( libvlc_media_player_t *mp, const char *chroma,
259 unsigned width, unsigned height,
260 unsigned pitch );
263 * Set the NSView handler where the media player should render its video output.
265 * Use the vout called "macosx".
267 * The drawable is an NSObject that follow the VLCOpenGLVideoViewEmbedding
268 * protocol:
270 * @begincode
271 * \@protocol VLCOpenGLVideoViewEmbedding <NSObject>
272 * - (void)addVoutSubview:(NSView *)view;
273 * - (void)removeVoutSubview:(NSView *)view;
274 * \@end
275 * @endcode
277 * Or it can be an NSView object.
279 * If you want to use it along with Qt4 see the QMacCocoaViewContainer. Then
280 * the following code should work:
281 * @begincode
283 * NSView *video = [[NSView alloc] init];
284 * QMacCocoaViewContainer *container = new QMacCocoaViewContainer(video, parent);
285 * libvlc_media_player_set_nsobject(mp, video);
286 * [video release];
288 * @endcode
290 * You can find a live example in VLCVideoView in VLCKit.framework.
292 * \param p_mi the Media Player
293 * \param drawable the drawable that is either an NSView or an object following
294 * the VLCOpenGLVideoViewEmbedding protocol.
296 VLC_PUBLIC_API void libvlc_media_player_set_nsobject ( libvlc_media_player_t *p_mi, void * drawable );
299 * Get the NSView handler previously set with libvlc_media_player_set_nsobject().
301 * \param p_mi the Media Player
302 * \return the NSView handler or 0 if none where set
304 VLC_PUBLIC_API void * libvlc_media_player_get_nsobject ( libvlc_media_player_t *p_mi );
307 * Set the agl handler where the media player should render its video output.
309 * \param p_mi the Media Player
310 * \param drawable the agl handler
312 VLC_PUBLIC_API void libvlc_media_player_set_agl ( libvlc_media_player_t *p_mi, uint32_t drawable );
315 * Get the agl handler previously set with libvlc_media_player_set_agl().
317 * \param p_mi the Media Player
318 * \return the agl handler or 0 if none where set
320 VLC_PUBLIC_API uint32_t libvlc_media_player_get_agl ( libvlc_media_player_t *p_mi );
323 * Set an X Window System drawable where the media player should render its
324 * video output. If LibVLC was built without X11 output support, then this has
325 * no effects.
327 * The specified identifier must correspond to an existing Input/Output class
328 * X11 window. Pixmaps are <b>not</b> supported. The caller shall ensure that
329 * the X11 server is the same as the one the VLC instance has been configured
330 * with.
332 * \param p_mi the Media Player
333 * \param drawable the ID of the X window
335 VLC_PUBLIC_API void libvlc_media_player_set_xwindow ( libvlc_media_player_t *p_mi, uint32_t drawable );
338 * Get the X Window System window identifier previously set with
339 * libvlc_media_player_set_xwindow(). Note that this will return the identifier
340 * even if VLC is not currently using it (for instance if it is playing an
341 * audio-only input).
343 * \param p_mi the Media Player
344 * \return an X window ID, or 0 if none where set.
346 VLC_PUBLIC_API uint32_t libvlc_media_player_get_xwindow ( libvlc_media_player_t *p_mi );
349 * Set a Win32/Win64 API window handle (HWND) where the media player should
350 * render its video output. If LibVLC was built without Win32/Win64 API output
351 * support, then this has no effects.
353 * \param p_mi the Media Player
354 * \param drawable windows handle of the drawable
356 VLC_PUBLIC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi, void *drawable );
359 * Get the Windows API window handle (HWND) previously set with
360 * libvlc_media_player_set_hwnd(). The handle will be returned even if LibVLC
361 * is not currently outputting any video to it.
363 * \param p_mi the Media Player
364 * \return a window handle or NULL if there are none.
366 VLC_PUBLIC_API void *libvlc_media_player_get_hwnd ( libvlc_media_player_t *p_mi );
370 /** \bug This might go away ... to be replaced by a broader system */
373 * Get the current movie length (in ms).
375 * \param p_mi the Media Player
376 * \return the movie length (in ms), or -1 if there is no media.
378 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_length( libvlc_media_player_t *p_mi );
381 * Get the current movie time (in ms).
383 * \param p_mi the Media Player
384 * \return the movie time (in ms), or -1 if there is no media.
386 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_time( libvlc_media_player_t *p_mi );
389 * Set the movie time (in ms). This has no effect if no media is being played.
390 * Not all formats and protocols support this.
392 * \param p_mi the Media Player
393 * \param i_time the movie time (in ms).
395 VLC_PUBLIC_API void libvlc_media_player_set_time( libvlc_media_player_t *p_mi, libvlc_time_t i_time );
398 * Get movie position.
400 * \param p_mi the Media Player
401 * \return movie position, or -1. in case of error
403 VLC_PUBLIC_API float libvlc_media_player_get_position( libvlc_media_player_t *p_mi );
406 * Set movie position. This has no effect if playback is not enabled.
407 * This might not work depending on the underlying input format and protocol.
409 * \param p_mi the Media Player
410 * \param f_pos the position
412 VLC_PUBLIC_API void libvlc_media_player_set_position( libvlc_media_player_t *p_mi, float f_pos );
415 * Set movie chapter (if applicable).
417 * \param p_mi the Media Player
418 * \param i_chapter chapter number to play
420 VLC_PUBLIC_API void libvlc_media_player_set_chapter( libvlc_media_player_t *p_mi, int i_chapter );
423 * Get movie chapter.
425 * \param p_mi the Media Player
426 * \return chapter number currently playing, or -1 if there is no media.
428 VLC_PUBLIC_API int libvlc_media_player_get_chapter( libvlc_media_player_t *p_mi );
431 * Get movie chapter count
433 * \param p_mi the Media Player
434 * \return number of chapters in movie, or -1.
436 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count( libvlc_media_player_t *p_mi );
439 * Is the player able to play
441 * \param p_mi the Media Player
442 * \return boolean
444 VLC_PUBLIC_API int libvlc_media_player_will_play( libvlc_media_player_t *p_mi );
447 * Get title chapter count
449 * \param p_mi the Media Player
450 * \param i_title title
451 * \return number of chapters in title, or -1
453 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count_for_title(
454 libvlc_media_player_t *p_mi, int i_title );
457 * Set movie title
459 * \param p_mi the Media Player
460 * \param i_title title number to play
462 VLC_PUBLIC_API void libvlc_media_player_set_title( libvlc_media_player_t *p_mi, int i_title );
465 * Get movie title
467 * \param p_mi the Media Player
468 * \return title number currently playing, or -1
470 VLC_PUBLIC_API int libvlc_media_player_get_title( libvlc_media_player_t *p_mi );
473 * Get movie title count
475 * \param p_mi the Media Player
476 * \return title number count, or -1
478 VLC_PUBLIC_API int libvlc_media_player_get_title_count( libvlc_media_player_t *p_mi );
481 * Set previous chapter (if applicable)
483 * \param p_mi the Media Player
485 VLC_PUBLIC_API void libvlc_media_player_previous_chapter( libvlc_media_player_t *p_mi );
488 * Set next chapter (if applicable)
490 * \param p_mi the Media Player
492 VLC_PUBLIC_API void libvlc_media_player_next_chapter( libvlc_media_player_t *p_mi );
495 * Get the requested movie play rate.
496 * @warning Depending on the underlying media, the requested rate may be
497 * different from the real playback rate.
499 * \param p_mi the Media Player
500 * \return movie play rate
502 VLC_PUBLIC_API float libvlc_media_player_get_rate( libvlc_media_player_t *p_mi );
505 * Set movie play rate
507 * \param p_mi the Media Player
508 * \param rate movie play rate to set
509 * \return -1 if an error was detected, 0 otherwise (but even then, it might
510 * not actually work depending on the underlying media protocol)
512 VLC_PUBLIC_API int libvlc_media_player_set_rate( libvlc_media_player_t *p_mi, float rate );
515 * Get current movie state
517 * \param p_mi the Media Player
518 * \return the current state of the media player (playing, paused, ...) \see libvlc_state_t
520 VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *p_mi );
523 * Get movie fps rate
525 * \param p_mi the Media Player
526 * \return frames per second (fps) for this playing movie, or 0 if unspecified
528 VLC_PUBLIC_API float libvlc_media_player_get_fps( libvlc_media_player_t *p_mi );
530 /** end bug */
533 * How many video outputs does this media player have?
535 * \param p_mi the media player
536 * \return the number of video outputs
538 VLC_PUBLIC_API unsigned libvlc_media_player_has_vout( libvlc_media_player_t *p_mi );
541 * Is this media player seekable?
543 * \param p_mi the media player
544 * \return true if the media player can seek
546 VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi );
549 * Can this media player be paused?
551 * \param p_mi the media player
552 * \return true if the media player can pause
554 VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi );
558 * Display the next frame (if supported)
560 * \param p_mi the media player
562 VLC_PUBLIC_API void libvlc_media_player_next_frame( libvlc_media_player_t *p_mi );
565 * Navigate through DVD Menu
567 * \param p_mi the Media Player
568 * \param navigate the Navigation mode
569 * \version libVLC 1.2.0 or later
571 VLC_PUBLIC_API void libvlc_media_player_navigate( libvlc_media_player_t* p_mi,
572 unsigned navigate );
575 * Release (free) libvlc_track_description_t
577 * \param p_track_description the structure to release
579 VLC_PUBLIC_API void libvlc_track_description_release( libvlc_track_description_t *p_track_description );
581 /** \defgroup libvlc_video LibVLC video controls
582 * @{
586 * Toggle fullscreen status on non-embedded video outputs.
588 * @warning The same limitations applies to this function
589 * as to libvlc_set_fullscreen().
591 * \param p_mi the media player
593 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *p_mi );
596 * Enable or disable fullscreen.
598 * @warning With most window managers, only a top-level windows can be in
599 * full-screen mode. Hence, this function will not operate properly if
600 * libvlc_media_player_set_xwindow() was used to embed the video in a
601 * non-top-level window. In that case, the embedding window must be reparented
602 * to the root window <b>before</b> fullscreen mode is enabled. You will want
603 * to reparent it back to its normal parent when disabling fullscreen.
605 * \param p_mi the media player
606 * \param b_fullscreen boolean for fullscreen status
608 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *p_mi, int b_fullscreen );
611 * Get current fullscreen status.
613 * \param p_mi the media player
614 * \return the fullscreen status (boolean)
616 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t *p_mi );
619 * Enable or disable key press events handling, according to the LibVLC hotkeys
620 * configuration. By default and for historical reasons, keyboard events are
621 * handled by the LibVLC video widget.
623 * \note On X11, there can be only one subscriber for key press and mouse
624 * click events per window. If your application has subscribed to those events
625 * for the X window ID of the video widget, then LibVLC will not be able to
626 * handle key presses and mouse clicks in any case.
628 * \warning This function is only implemented for X11 and Win32 at the moment.
630 * \param p_mi the media player
631 * \param on true to handle key press events, false to ignore them.
633 VLC_PUBLIC_API
634 void libvlc_video_set_key_input( libvlc_media_player_t *p_mi, unsigned on );
637 * Enable or disable mouse click events handling. By default, those events are
638 * handled. This is needed for DVD menus to work, as well as a few video
639 * filters such as "puzzle".
641 * \note See also libvlc_video_set_key_input().
643 * \warning This function is only implemented for X11 and Win32 at the moment.
645 * \param p_mi the media player
646 * \param on true to handle mouse click events, false to ignore them.
648 VLC_PUBLIC_API
649 void libvlc_video_set_mouse_input( libvlc_media_player_t *p_mi, unsigned on );
652 * Get the pixel dimensions of a video.
654 * \param p_mi media player
655 * \param num number of the video (starting from, and most commonly 0)
656 * \param px pointer to get the pixel width [OUT]
657 * \param py pointer to get the pixel height [OUT]
658 * \return 0 on success, -1 if the specified video does not exist
660 VLC_PUBLIC_API
661 int libvlc_video_get_size( libvlc_media_player_t *p_mi, unsigned num,
662 unsigned *px, unsigned *py );
665 * Get current video height.
666 * You should use libvlc_video_get_size() instead.
668 * \param p_mi the media player
669 * \return the video pixel height or 0 if not applicable
671 VLC_DEPRECATED_API
672 int libvlc_video_get_height( libvlc_media_player_t *p_mi );
675 * Get current video width.
676 * You should use libvlc_video_get_size() instead.
678 * \param p_mi the media player
679 * \return the video pixel width or 0 if not applicable
681 VLC_DEPRECATED_API
682 int libvlc_video_get_width( libvlc_media_player_t *p_mi );
685 * Get the mouse pointer coordinates over a video.
686 * Coordinates are expressed in terms of the decoded video resolution,
687 * <b>not</b> in terms of pixels on the screen/viewport (to get the latter,
688 * you can query your windowing system directly).
690 * Either of the coordinates may be negative or larger than the corresponding
691 * dimension of the video, if the cursor is outside the rendering area.
693 * @warning The coordinates may be out-of-date if the pointer is not located
694 * on the video rendering area. LibVLC does not track the pointer if it is
695 * outside of the video widget.
697 * @note LibVLC does not support multiple pointers (it does of course support
698 * multiple input devices sharing the same pointer) at the moment.
700 * \param p_mi media player
701 * \param num number of the video (starting from, and most commonly 0)
702 * \param px pointer to get the abscissa [OUT]
703 * \param py pointer to get the ordinate [OUT]
704 * \return 0 on success, -1 if the specified video does not exist
706 VLC_PUBLIC_API
707 int libvlc_video_get_cursor( libvlc_media_player_t *p_mi, unsigned num,
708 int *px, int *py );
711 * Get the current video scaling factor.
712 * See also libvlc_video_set_scale().
714 * \param p_mi the media player
715 * \return the currently configured zoom factor, or 0. if the video is set
716 * to fit to the output window/drawable automatically.
718 VLC_PUBLIC_API float libvlc_video_get_scale( libvlc_media_player_t *p_mi );
721 * Set the video scaling factor. That is the ratio of the number of pixels on
722 * screen to the number of pixels in the original decoded video in each
723 * dimension. Zero is a special value; it will adjust the video to the output
724 * window/drawable (in windowed mode) or the entire screen.
726 * Note that not all video outputs support scaling.
728 * \param p_mi the media player
729 * \param f_factor the scaling factor, or zero
731 VLC_PUBLIC_API void libvlc_video_set_scale( libvlc_media_player_t *p_mi, float f_factor );
734 * Get current video aspect ratio.
736 * \param p_mi the media player
737 * \return the video aspect ratio or NULL if unspecified
738 * (the result must be released with free() or libvlc_free()).
740 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *p_mi );
743 * Set new video aspect ratio.
745 * \param p_mi the media player
746 * \param psz_aspect new video aspect-ratio or NULL to reset to default
747 * \note Invalid aspect ratios are ignored.
749 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *p_mi, const char *psz_aspect );
752 * Get current video subtitle.
754 * \param p_mi the media player
755 * \return the video subtitle selected, or -1 if none
757 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *p_mi );
760 * Get the number of available video subtitles.
762 * \param p_mi the media player
763 * \return the number of available video subtitles
765 VLC_PUBLIC_API int libvlc_video_get_spu_count( libvlc_media_player_t *p_mi );
768 * Get the description of available video subtitles.
770 * \param p_mi the media player
771 * \return list containing description of available video subtitles
773 VLC_PUBLIC_API libvlc_track_description_t *
774 libvlc_video_get_spu_description( libvlc_media_player_t *p_mi );
777 * Set new video subtitle.
779 * \param p_mi the media player
780 * \param i_spu new video subtitle to select
781 * \return 0 on success, -1 if out of range
783 VLC_PUBLIC_API int libvlc_video_set_spu( libvlc_media_player_t *p_mi, unsigned i_spu );
786 * Set new video subtitle file.
788 * \param p_mi the media player
789 * \param psz_subtitle new video subtitle file
790 * \return the success status (boolean)
792 VLC_PUBLIC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *p_mi, const char *psz_subtitle );
795 * Get the description of available titles.
797 * \param p_mi the media player
798 * \return list containing description of available titles
800 VLC_PUBLIC_API libvlc_track_description_t *
801 libvlc_video_get_title_description( libvlc_media_player_t *p_mi );
804 * Get the description of available chapters for specific title.
806 * \param p_mi the media player
807 * \param i_title selected title
808 * \return list containing description of available chapter for title i_title
810 VLC_PUBLIC_API libvlc_track_description_t *
811 libvlc_video_get_chapter_description( libvlc_media_player_t *p_mi, int i_title );
814 * Get current crop filter geometry.
816 * \param p_mi the media player
817 * \return the crop filter geometry or NULL if unset
819 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *p_mi );
822 * Set new crop filter geometry.
824 * \param p_mi the media player
825 * \param psz_geometry new crop filter geometry (NULL to unset)
827 VLC_PUBLIC_API
828 void libvlc_video_set_crop_geometry( libvlc_media_player_t *p_mi, const char *psz_geometry );
831 * Get current teletext page requested.
833 * \param p_mi the media player
834 * \return the current teletext page requested.
836 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t *p_mi );
839 * Set new teletext page to retrieve.
841 * \param p_mi the media player
842 * \param i_page teletex page number requested
844 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *p_mi, int i_page );
847 * Toggle teletext transparent status on video output.
849 * \param p_mi the media player
851 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *p_mi );
854 * Get number of available video tracks.
856 * \param p_mi media player
857 * \return the number of available video tracks (int)
859 VLC_PUBLIC_API int libvlc_video_get_track_count( libvlc_media_player_t *p_mi );
862 * Get the description of available video tracks.
864 * \param p_mi media player
865 * \return list with description of available video tracks, or NULL on error
867 VLC_PUBLIC_API libvlc_track_description_t *
868 libvlc_video_get_track_description( libvlc_media_player_t *p_mi );
871 * Get current video track.
873 * \param p_mi media player
874 * \return the video track (int) or -1 if none
876 VLC_PUBLIC_API int libvlc_video_get_track( libvlc_media_player_t *p_mi );
879 * Set video track.
881 * \param p_mi media player
882 * \param i_track the track (int)
883 * \return 0 on success, -1 if out of range
885 VLC_PUBLIC_API
886 int libvlc_video_set_track( libvlc_media_player_t *p_mi, int i_track );
889 * Take a snapshot of the current video window.
891 * If i_width AND i_height is 0, original size is used.
892 * If i_width XOR i_height is 0, original aspect-ratio is preserved.
894 * \param p_mi media player instance
895 * \param num number of video output (typically 0 for the first/only one)
896 * \param psz_filepath the path where to save the screenshot to
897 * \param i_width the snapshot's width
898 * \param i_height the snapshot's height
899 * \return 0 on success, -1 if the video was not found
901 VLC_PUBLIC_API
902 int libvlc_video_take_snapshot( libvlc_media_player_t *p_mi, unsigned num,
903 const char *psz_filepath, unsigned int i_width,
904 unsigned int i_height );
907 * Enable or disable deinterlace filter
909 * \param p_mi libvlc media player
910 * \param psz_mode type of deinterlace filter, NULL to disable
912 VLC_PUBLIC_API void libvlc_video_set_deinterlace( libvlc_media_player_t *p_mi,
913 const char *psz_mode );
916 * Get an integer marquee option value
918 * \param p_mi libvlc media player
919 * \param option marq option to get \see libvlc_video_marquee_int_option_t
921 VLC_PUBLIC_API int libvlc_video_get_marquee_int( libvlc_media_player_t *p_mi,
922 unsigned option );
925 * Get a string marquee option value
927 * \param p_mi libvlc media player
928 * \param option marq option to get \see libvlc_video_marquee_string_option_t
930 VLC_PUBLIC_API char *libvlc_video_get_marquee_string( libvlc_media_player_t *p_mi,
931 unsigned option );
934 * Enable, disable or set an integer marquee option
936 * Setting libvlc_marquee_Enable has the side effect of enabling (arg !0)
937 * or disabling (arg 0) the marq filter.
939 * \param p_mi libvlc media player
940 * \param option marq option to set \see libvlc_video_marquee_int_option_t
941 * \param i_val marq option value
943 VLC_PUBLIC_API void libvlc_video_set_marquee_int( libvlc_media_player_t *p_mi,
944 unsigned option, int i_val );
947 * Set a marquee string option
949 * \param p_mi libvlc media player
950 * \param option marq option to set \see libvlc_video_marquee_string_option_t
951 * \param psz_text marq option value
953 VLC_PUBLIC_API void libvlc_video_set_marquee_string( libvlc_media_player_t *p_mi,
954 unsigned option, const char *psz_text );
956 /** option values for libvlc_video_{get,set}_logo_{int,string} */
957 enum libvlc_video_logo_option_t {
958 libvlc_logo_enable,
959 libvlc_logo_file, /**< string argument, "file,d,t;file,d,t;..." */
960 libvlc_logo_x,
961 libvlc_logo_y,
962 libvlc_logo_delay,
963 libvlc_logo_repeat,
964 libvlc_logo_opacity,
965 libvlc_logo_position,
969 * Get integer logo option.
971 * \param p_mi libvlc media player instance
972 * \param option logo option to get, values of libvlc_video_logo_option_t
974 VLC_PUBLIC_API int libvlc_video_get_logo_int( libvlc_media_player_t *p_mi,
975 unsigned option );
978 * Set logo option as integer. Options that take a different type value
979 * are ignored.
980 * Passing libvlc_logo_enable as option value has the side effect of
981 * starting (arg !0) or stopping (arg 0) the logo filter.
983 * \param p_mi libvlc media player instance
984 * \param option logo option to set, values of libvlc_video_logo_option_t
985 * \param value logo option value
987 VLC_PUBLIC_API void libvlc_video_set_logo_int( libvlc_media_player_t *p_mi,
988 unsigned option, int value );
991 * Set logo option as string. Options that take a different type value
992 * are ignored.
994 * \param p_mi libvlc media player instance
995 * \param option logo option to set, values of libvlc_video_logo_option_t
996 * \param psz_value logo option value
998 VLC_PUBLIC_API void libvlc_video_set_logo_string( libvlc_media_player_t *p_mi,
999 unsigned option, const char *psz_value );
1002 /** option values for libvlc_video_{get,set}_adjust_{int,float,bool} */
1003 enum libvlc_video_adjust_option_t {
1004 libvlc_adjust_Enable = 0,
1005 libvlc_adjust_Contrast,
1006 libvlc_adjust_Brightness,
1007 libvlc_adjust_Hue,
1008 libvlc_adjust_Saturation,
1009 libvlc_adjust_Gamma,
1013 * Get integer adjust option.
1015 * \param p_mi libvlc media player instance
1016 * \param option adjust option to get, values of libvlc_video_adjust_option_t
1017 * \version LibVLC 1.1.1 and later.
1019 VLC_PUBLIC_API int libvlc_video_get_adjust_int( libvlc_media_player_t *p_mi,
1020 unsigned option );
1023 * Set adjust option as integer. Options that take a different type value
1024 * are ignored.
1025 * Passing libvlc_adjust_enable as option value has the side effect of
1026 * starting (arg !0) or stopping (arg 0) the adjust filter.
1028 * \param p_mi libvlc media player instance
1029 * \param option adust option to set, values of libvlc_video_adjust_option_t
1030 * \param value adjust option value
1031 * \version LibVLC 1.1.1 and later.
1033 VLC_PUBLIC_API void libvlc_video_set_adjust_int( libvlc_media_player_t *p_mi,
1034 unsigned option, int value );
1037 * Get float adjust option.
1039 * \param p_mi libvlc media player instance
1040 * \param option adjust option to get, values of libvlc_video_adjust_option_t
1041 * \version LibVLC 1.1.1 and later.
1043 VLC_PUBLIC_API float libvlc_video_get_adjust_float( libvlc_media_player_t *p_mi,
1044 unsigned option );
1047 * Set adjust option as float. Options that take a different type value
1048 * are ignored.
1050 * \param p_mi libvlc media player instance
1051 * \param option adust option to set, values of libvlc_video_adjust_option_t
1052 * \param value adjust option value
1053 * \version LibVLC 1.1.1 and later.
1055 VLC_PUBLIC_API void libvlc_video_set_adjust_float( libvlc_media_player_t *p_mi,
1056 unsigned option, float value );
1058 /** @} video */
1060 /** \defgroup libvlc_audio LibVLC audio controls
1061 * @{
1065 * Audio device types
1067 typedef enum libvlc_audio_output_device_types_t {
1068 libvlc_AudioOutputDevice_Error = -1,
1069 libvlc_AudioOutputDevice_Mono = 1,
1070 libvlc_AudioOutputDevice_Stereo = 2,
1071 libvlc_AudioOutputDevice_2F2R = 4,
1072 libvlc_AudioOutputDevice_3F2R = 5,
1073 libvlc_AudioOutputDevice_5_1 = 6,
1074 libvlc_AudioOutputDevice_6_1 = 7,
1075 libvlc_AudioOutputDevice_7_1 = 8,
1076 libvlc_AudioOutputDevice_SPDIF = 10
1077 } libvlc_audio_output_device_types_t;
1080 * Audio channels
1082 typedef enum libvlc_audio_output_channel_t {
1083 libvlc_AudioChannel_Error = -1,
1084 libvlc_AudioChannel_Stereo = 1,
1085 libvlc_AudioChannel_RStereo = 2,
1086 libvlc_AudioChannel_Left = 3,
1087 libvlc_AudioChannel_Right = 4,
1088 libvlc_AudioChannel_Dolbys = 5
1089 } libvlc_audio_output_channel_t;
1093 * Get the list of available audio outputs
1095 * \param p_instance libvlc instance
1096 * \return list of available audio outputs. It must be freed it with
1097 * \see libvlc_audio_output_list_release \see libvlc_audio_output_t .
1098 * In case of error, NULL is returned.
1100 VLC_PUBLIC_API libvlc_audio_output_t *
1101 libvlc_audio_output_list_get( libvlc_instance_t *p_instance );
1104 * Free the list of available audio outputs
1106 * \param p_list list with audio outputs for release
1108 VLC_PUBLIC_API void libvlc_audio_output_list_release( libvlc_audio_output_t *p_list );
1111 * Set the audio output.
1112 * Change will be applied after stop and play.
1114 * \param p_mi media player
1115 * \param psz_name name of audio output,
1116 * use psz_name of \see libvlc_audio_output_t
1117 * \return true if function succeded
1119 VLC_PUBLIC_API int libvlc_audio_output_set( libvlc_media_player_t *p_mi,
1120 const char *psz_name );
1123 * Get count of devices for audio output, these devices are hardware oriented
1124 * like analor or digital output of sound card
1126 * \param p_instance libvlc instance
1127 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1128 * \return number of devices
1130 VLC_PUBLIC_API int libvlc_audio_output_device_count( libvlc_instance_t *p_instance,
1131 const char *psz_audio_output );
1134 * Get long name of device, if not available short name given
1136 * \param p_instance libvlc instance
1137 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1138 * \param i_device device index
1139 * \return long name of device
1141 VLC_PUBLIC_API char * libvlc_audio_output_device_longname( libvlc_instance_t *p_instance,
1142 const char *psz_audio_output,
1143 int i_device );
1146 * Get id name of device
1148 * \param p_instance libvlc instance
1149 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1150 * \param i_device device index
1151 * \return id name of device, use for setting device, need to be free after use
1153 VLC_PUBLIC_API char * libvlc_audio_output_device_id( libvlc_instance_t *p_instance,
1154 const char *psz_audio_output,
1155 int i_device );
1158 * Set audio output device. Changes are only effective after stop and play.
1160 * \param p_mi media player
1161 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1162 * \param psz_device_id device
1164 VLC_PUBLIC_API void libvlc_audio_output_device_set( libvlc_media_player_t *p_mi,
1165 const char *psz_audio_output,
1166 const char *psz_device_id );
1169 * Get current audio device type. Device type describes something like
1170 * character of output sound - stereo sound, 2.1, 5.1 etc
1172 * \param p_mi media player
1173 * \return the audio devices type \see libvlc_audio_output_device_types_t
1175 VLC_PUBLIC_API int libvlc_audio_output_get_device_type( libvlc_media_player_t *p_mi );
1178 * Set current audio device type.
1180 * \param p_mi vlc instance
1181 * \param device_type the audio device type,
1182 according to \see libvlc_audio_output_device_types_t
1184 VLC_PUBLIC_API void libvlc_audio_output_set_device_type( libvlc_media_player_t *p_mi,
1185 int device_type );
1189 * Toggle mute status.
1191 * \param p_mi media player
1193 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_media_player_t *p_mi );
1196 * Get current mute status.
1198 * \param p_mi media player
1199 * \return the mute status (boolean)
1201 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_media_player_t *p_mi );
1204 * Set mute status.
1206 * \param p_mi media player
1207 * \param status If status is true then mute, otherwise unmute
1209 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_media_player_t *p_mi, int status );
1212 * Get current audio level.
1214 * \param p_mi media player
1215 * \return the audio level (int)
1217 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_media_player_t *p_mi );
1220 * Set current audio level.
1222 * \param p_mi media player
1223 * \param i_volume the volume (int)
1224 * \return 0 if the volume was set, -1 if it was out of range
1226 VLC_PUBLIC_API int libvlc_audio_set_volume( libvlc_media_player_t *p_mi, int i_volume );
1229 * Get number of available audio tracks.
1231 * \param p_mi media player
1232 * \return the number of available audio tracks (int), or -1 if unavailable
1234 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *p_mi );
1237 * Get the description of available audio tracks.
1239 * \param p_mi media player
1240 * \return list with description of available audio tracks, or NULL
1242 VLC_PUBLIC_API libvlc_track_description_t *
1243 libvlc_audio_get_track_description( libvlc_media_player_t *p_mi );
1246 * Get current audio track.
1248 * \param p_mi media player
1249 * \return the audio track (int), or -1 if none.
1251 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *p_mi );
1254 * Set current audio track.
1256 * \param p_mi media player
1257 * \param i_track the track (int)
1258 * \return 0 on success, -1 on error
1260 VLC_PUBLIC_API int libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track );
1263 * Get current audio channel.
1265 * \param p_mi media player
1266 * \return the audio channel \see libvlc_audio_output_channel_t
1268 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_media_player_t *p_mi );
1271 * Set current audio channel.
1273 * \param p_mi media player
1274 * \param channel the audio channel, \see libvlc_audio_output_channel_t
1275 * \return 0 on success, -1 on error
1277 VLC_PUBLIC_API int libvlc_audio_set_channel( libvlc_media_player_t *p_mi, int channel );
1280 * Get current audio delay.
1282 * \param p_mi media player
1283 * \return the audio delay (microseconds)
1284 * \version LibVLC 1.1.1 or later
1286 VLC_PUBLIC_API int64_t libvlc_audio_get_delay( libvlc_media_player_t *p_mi );
1289 * Set current audio delay. The audio delay will be reset to zero each time the media changes.
1291 * \param p_mi media player
1292 * \param i_delay the audio delay (microseconds)
1293 * \return 0 on success, -1 on error
1294 * \version LibVLC 1.1.1 or later
1296 VLC_PUBLIC_API int libvlc_audio_set_delay( libvlc_media_player_t *p_mi, int64_t i_delay );
1298 /** @} audio */
1300 /** @} media_player */
1302 # ifdef __cplusplus
1304 # endif
1306 #endif /* VLC_LIBVLC_MEDIA_PLAYER_H */