1 /*****************************************************************************
2 * libvlc_media_player.h: libvlc_media_player external API
3 *****************************************************************************
4 * Copyright (C) 1998-2009 the VideoLAN team
7 * Authors: Clément Stenac <zorglub@videolan.org>
8 * Jean-Paul Saman <jpsaman@videolan.org>
9 * Pierre d'Herbemont <pdherbemont@videolan.org>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24 *****************************************************************************/
28 * This file defines libvlc_media_player external API
31 #ifndef VLC_LIBVLC_MEDIA_PLAYER_H
32 #define VLC_LIBVLC_MEDIA_PLAYER_H 1
38 /*****************************************************************************
40 *****************************************************************************/
41 /** \defgroup libvlc_media_player libvlc_media_player
43 * LibVLC Media Player, object that let you play a media
44 * in a custom drawable
48 typedef struct libvlc_media_player_t libvlc_media_player_t;
51 * Description for video, audio tracks and subtitles. It contains
52 * id, name (description string) and pointer to next record.
54 typedef struct libvlc_track_description_t
58 struct libvlc_track_description_t *p_next;
60 } libvlc_track_description_t;
63 * Description for audio output. It contains
64 * name, description and pointer to next record.
66 typedef struct libvlc_audio_output_t
69 char *psz_description;
70 struct libvlc_audio_output_t *p_next;
72 } libvlc_audio_output_t;
75 * Rectangle type for video geometry
77 typedef struct libvlc_rectangle_t
84 * Marq int options definition
86 typedef enum libvlc_video_marquee_int_option_t {
87 libvlc_marquee_Enable = 0,
89 libvlc_marquee_Opacity,
90 libvlc_marquee_Position,
91 libvlc_marquee_Refresh,
93 libvlc_marquee_Timeout,
96 } libvlc_video_marquee_int_option_t;
99 * Marq string options definition
101 typedef enum libvlc_video_marquee_string_option_t {
102 libvlc_marquee_Text = 0
103 } libvlc_video_marquee_string_option_t;
107 * Create an empty Media Player object
109 * \param p_libvlc_instance the libvlc instance in which the Media Player
111 * \param p_e an initialized exception pointer
113 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t *, libvlc_exception_t * );
116 * Create a Media Player object from a Media
118 * \param p_md the media. Afterwards the p_md can be safely
120 * \param p_e an initialized exception pointer
122 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new_from_media( libvlc_media_t *, libvlc_exception_t * );
125 * Release a media_player after use
126 * Decrement the reference count of a media player object. If the
127 * reference count is 0, then libvlc_media_player_release() will
128 * release the media player object. If the media player object
129 * has been released, then it should not be used again.
131 * \param p_mi the Media Player to free
133 VLC_PUBLIC_API void libvlc_media_player_release( libvlc_media_player_t * );
136 * Retain a reference to a media player object. Use
137 * libvlc_media_player_release() to decrement reference count.
139 * \param p_mi media player object
141 VLC_PUBLIC_API void libvlc_media_player_retain( libvlc_media_player_t * );
144 * Set the media that will be used by the media_player. If any,
145 * previous md will be released.
147 * \param p_mi the Media Player
148 * \param p_md the Media. Afterwards the p_md can be safely
150 * \param p_e an initialized exception pointer
152 VLC_PUBLIC_API void libvlc_media_player_set_media( libvlc_media_player_t *, libvlc_media_t *, libvlc_exception_t * );
155 * Get the media used by the media_player.
157 * \param p_mi the Media Player
158 * \param p_e an initialized exception pointer
159 * \return the media associated with p_mi, or NULL if no
160 * media is associated
162 VLC_PUBLIC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t *, libvlc_exception_t * );
165 * Get the Event Manager from which the media player send event.
167 * \param p_mi the Media Player
168 * \param p_e an initialized exception pointer
169 * \return the event manager associated with p_mi
171 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *, libvlc_exception_t * );
176 * \param p_mi the Media Player
177 * \param p_e an initialized exception pointer
178 * \return 1 if the media player is playing, 0 otherwise
180 VLC_PUBLIC_API int libvlc_media_player_is_playing ( libvlc_media_player_t *, libvlc_exception_t * );
185 * \param p_mi the Media Player
186 * \param p_e an initialized exception pointer
188 VLC_PUBLIC_API void libvlc_media_player_play ( libvlc_media_player_t *, libvlc_exception_t * );
193 * \param p_mi the Media Player
194 * \param p_e an initialized exception pointer
196 VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *, libvlc_exception_t * );
201 * \param p_mi the Media Player
202 * \param p_e an initialized exception pointer
204 VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *, libvlc_exception_t * );
207 * Set the NSView handler where the media player should render its video output.
209 * The object minimal_macosx expects is of kind NSObject and should
210 * respect the protocol:
212 * @protocol VLCOpenGLVideoViewEmbedding <NSObject>
213 * - (void)addVoutSubview:(NSView *)view;
214 * - (void)removeVoutSubview:(NSView *)view;
217 * You can find a live example in VLCVideoView in VLCKit.framework.
219 * \param p_mi the Media Player
220 * \param drawable the NSView handler
221 * \param p_e an initialized exception pointer
223 VLC_PUBLIC_API void libvlc_media_player_set_nsobject ( libvlc_media_player_t *p_mi, void * drawable, libvlc_exception_t *p_e );
226 * Get the NSView handler previously set with libvlc_media_player_set_nsobject().
228 * \param p_mi the Media Player
229 * \return the NSView handler or 0 if none where set
231 VLC_PUBLIC_API void * libvlc_media_player_get_nsobject ( libvlc_media_player_t *p_mi );
234 * Set the agl handler where the media player should render its video output.
236 * \param p_mi the Media Player
237 * \param drawable the agl handler
238 * \param p_e an initialized exception pointer
240 VLC_PUBLIC_API void libvlc_media_player_set_agl ( libvlc_media_player_t *p_mi, uint32_t drawable, libvlc_exception_t *p_e );
243 * Get the agl handler previously set with libvlc_media_player_set_agl().
245 * \param p_mi the Media Player
246 * \return the agl handler or 0 if none where set
248 VLC_PUBLIC_API uint32_t libvlc_media_player_get_agl ( libvlc_media_player_t *p_mi );
251 * Set an X Window System drawable where the media player should render its
252 * video output. If LibVLC was built without X11 output support, then this has
255 * The specified identifier must correspond to an existing Input/Output class
256 * X11 window. Pixmaps are <b>not</b> supported. The caller shall ensure that
257 * the X11 server is the same as the one the VLC instance has been configured
259 * If XVideo is <b>not</b> used, it is assumed that the drawable has the
260 * following properties in common with the default X11 screen: depth, scan line
261 * pad, black pixel. This is a bug.
263 * \param p_mi the Media Player
264 * \param drawable the ID of the X window
265 * \param p_e an initialized exception pointer
267 VLC_PUBLIC_API void libvlc_media_player_set_xwindow ( libvlc_media_player_t *p_mi, uint32_t drawable, libvlc_exception_t *p_e );
270 * Get the X Window System window identifier previously set with
271 * libvlc_media_player_set_xwindow(). Note that this will return the identifier
272 * even if VLC is not currently using it (for instance if it is playing an
275 * \param p_mi the Media Player
276 * \return an X window ID, or 0 if none where set.
278 VLC_PUBLIC_API uint32_t libvlc_media_player_get_xwindow ( libvlc_media_player_t *p_mi );
281 * Set a Win32/Win64 API window handle (HWND) where the media player should
282 * render its video output. If LibVLC was built without Win32/Win64 API output
283 * support, then this has no effects.
285 * \param p_mi the Media Player
286 * \param drawable windows handle of the drawable
287 * \param p_e an initialized exception pointer
289 VLC_PUBLIC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi, void *drawable, libvlc_exception_t *p_e );
292 * Get the Windows API window handle (HWND) previously set with
293 * libvlc_media_player_set_hwnd(). The handle will be returned even if LibVLC
294 * is not currently outputting any video to it.
296 * \param p_mi the Media Player
297 * \return a window handle or NULL if there are none.
299 VLC_PUBLIC_API void *libvlc_media_player_get_hwnd ( libvlc_media_player_t *p_mi );
303 /** \bug This might go away ... to be replaced by a broader system */
306 * Get the current movie length (in ms).
308 * \param p_mi the Media Player
309 * \param p_e an initialized exception pointer
310 * \return the movie length (in ms).
312 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_length( libvlc_media_player_t *, libvlc_exception_t *);
315 * Get the current movie time (in ms).
317 * \param p_mi the Media Player
318 * \param p_e an initialized exception pointer
319 * \return the movie time (in ms).
321 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_time( libvlc_media_player_t *, libvlc_exception_t *);
324 * Set the movie time (in ms).
326 * \param p_mi the Media Player
327 * \param the movie time (in ms).
328 * \param p_e an initialized exception pointer
330 VLC_PUBLIC_API void libvlc_media_player_set_time( libvlc_media_player_t *, libvlc_time_t, libvlc_exception_t *);
333 * Get movie position.
335 * \param p_mi the Media Player
336 * \param p_e an initialized exception pointer
337 * \return movie position
339 VLC_PUBLIC_API float libvlc_media_player_get_position( libvlc_media_player_t *, libvlc_exception_t *);
342 * Set movie position.
344 * \param p_mi the Media Player
345 * \param f_pos the position
346 * \param p_e an initialized exception pointer
348 VLC_PUBLIC_API void libvlc_media_player_set_position( libvlc_media_player_t *, float, libvlc_exception_t *);
353 * \param p_mi the Media Player
354 * \param i_chapter chapter number to play
355 * \param p_e an initialized exception pointer
357 VLC_PUBLIC_API void libvlc_media_player_set_chapter( libvlc_media_player_t *, int, libvlc_exception_t *);
362 * \param p_mi the Media Player
363 * \param p_e an initialized exception pointer
364 * \return chapter number currently playing
366 VLC_PUBLIC_API int libvlc_media_player_get_chapter( libvlc_media_player_t *, libvlc_exception_t * );
369 * Get movie chapter count
371 * \param p_mi the Media Player
372 * \param p_e an initialized exception pointer
373 * \return number of chapters in movie
375 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count( libvlc_media_player_t *, libvlc_exception_t *);
378 * Will the player play
380 * \param p_mi the Media Player
381 * \param p_e an initialized exception pointer
384 VLC_PUBLIC_API int libvlc_media_player_will_play ( libvlc_media_player_t *, libvlc_exception_t *);
387 * Get title chapter count
389 * \param p_mi the Media Player
390 * \param i_title title
391 * \param p_e an initialized exception pointer
392 * \return number of chapters in title
394 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count_for_title(
395 libvlc_media_player_t *, int, libvlc_exception_t *);
400 * \param p_mi the Media Player
401 * \param i_title title number to play
402 * \param p_e an initialized exception pointer
404 VLC_PUBLIC_API void libvlc_media_player_set_title( libvlc_media_player_t *, int, libvlc_exception_t *);
409 * \param p_mi the Media Player
410 * \param p_e an initialized exception pointer
411 * \return title number currently playing
413 VLC_PUBLIC_API int libvlc_media_player_get_title( libvlc_media_player_t *, libvlc_exception_t *);
416 * Get movie title count
418 * \param p_mi the Media Player
419 * \param p_e an initialized exception pointer
420 * \return title number count
422 VLC_PUBLIC_API int libvlc_media_player_get_title_count( libvlc_media_player_t *, libvlc_exception_t *);
425 * Set previous chapter
427 * \param p_mi the Media Player
428 * \param p_e an initialized exception pointer
430 VLC_PUBLIC_API void libvlc_media_player_previous_chapter( libvlc_media_player_t *, libvlc_exception_t *);
435 * \param p_mi the Media Player
436 * \param p_e an initialized exception pointer
438 VLC_PUBLIC_API void libvlc_media_player_next_chapter( libvlc_media_player_t *, libvlc_exception_t *);
441 * Get movie play rate
443 * \param p_mi the Media Player
444 * \param p_e an initialized exception pointer
445 * \return movie play rate
447 VLC_PUBLIC_API float libvlc_media_player_get_rate( libvlc_media_player_t *, libvlc_exception_t *);
450 * Set movie play rate
452 * \param p_mi the Media Player
453 * \param movie play rate to set
454 * \param p_e an initialized exception pointer
456 VLC_PUBLIC_API void libvlc_media_player_set_rate( libvlc_media_player_t *, float, libvlc_exception_t *);
459 * Get current movie state
461 * \param p_mi the Media Player
462 * \param p_e an initialized exception pointer
463 * \return current movie state as libvlc_state_t
465 VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *, libvlc_exception_t *);
470 * \param p_mi the Media Player
471 * \param p_e an initialized exception pointer
472 * \return frames per second (fps) for this playing movie
474 VLC_PUBLIC_API float libvlc_media_player_get_fps( libvlc_media_player_t *, libvlc_exception_t *);
479 * Does this media player have a video output?
481 * \param p_md the media player
482 * \param p_e an initialized exception pointer
484 VLC_PUBLIC_API int libvlc_media_player_has_vout( libvlc_media_player_t *, libvlc_exception_t *);
487 * Is this media player seekable?
489 * \param p_input the input
490 * \param p_e an initialized exception pointer
492 VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
495 * Can this media player be paused?
497 * \param p_input the input
498 * \param p_e an initialized exception pointer
500 VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
504 * Display the next frame
506 * \param p_input the libvlc_media_player_t instance
507 * \param p_e an initialized exception pointer
509 VLC_PUBLIC_API void libvlc_media_player_next_frame( libvlc_media_player_t *p_input,
510 libvlc_exception_t *p_e );
515 * Release (free) libvlc_track_description_t
517 * \param p_track_description the structure to release
519 VLC_PUBLIC_API void libvlc_track_description_release( libvlc_track_description_t *p_track_description );
521 /** \defgroup libvlc_video libvlc_video
522 * \ingroup libvlc_media_player
523 * LibVLC Video handling
528 * Toggle fullscreen status on a non-embedded video output.
530 * @warning The same limitations applies to this function
531 * as to libvlc_set_fullscreen().
533 * \param p_mediaplayer the media player
534 * \param p_e an initialized exception pointer
536 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
539 * Enable or disable fullscreen on a non-embedded video output.
541 * @warning With most window managers, only a top-level windows can switch to
542 * full-screen mode. Hence, this function will not operate properly if
543 * libvlc_media_player_set_xid() or libvlc_media_player_set_hwnd() was
544 * used to embed the video in a non-LibVLC widget. If you want to to render an
545 * embedded LibVLC video full-screen, the parent embedding widget must expanded
546 * to full screen (LibVLC cannot take care of that).
547 * LibVLC will then automatically resize the video as appropriate.
549 * \param p_mediaplayer the media player
550 * \param b_fullscreen boolean for fullscreen status
551 * \param p_e an initialized exception pointer
553 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *, int, libvlc_exception_t * );
556 * Get current fullscreen status.
558 * \param p_mediaplayer the media player
559 * \param p_e an initialized exception pointer
560 * \return the fullscreen status (boolean)
562 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
565 * Enable or disable key press events handling, according to the LibVLC hotkeys
566 * configuration. By default and for historical reasons, keyboard events are
567 * handled by the LibVLC video widget.
569 * \note On X11, there can be only one subscriber for key press and mouse
570 * click events per window. If your application has subscribed to those events
571 * for the X window ID of the video widget, then LibVLC will not be able to
572 * handle key presses and mouse clicks in any case.
574 * \warning This function is only implemented for X11 at the moment.
576 * \param mp the media player
577 * \param on true to handle key press events, false to ignore them.
580 void libvlc_video_set_key_input( libvlc_media_player_t *mp, unsigned on );
583 * Enable or disable mouse click events handling. By default, those events are
584 * handled. This is needed for DVD menus to work, as well as a few video
585 * filters such as "puzzle".
587 * \note See also \func libvlc_video_set_key_input().
589 * \warning This function is only implemented for X11 at the moment.
591 * \param mp the media player
592 * \param on true to handle mouse click events, false to ignore them.
595 void libvlc_video_set_mouse_input( libvlc_media_player_t *mp, unsigned on );
598 * Get current video height.
600 * \param p_mediaplayer the media player
601 * \param p_e an initialized exception pointer
602 * \return the video height
604 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_player_t *, libvlc_exception_t * );
607 * Get current video width.
609 * \param p_mediaplayer the media player
610 * \param p_e an initialized exception pointer
611 * \return the video width
613 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_player_t *, libvlc_exception_t * );
616 * Get the current video scaling factor.
617 * See also libvlc_video_set_scale().
619 * \param p_mediaplayer the media player
620 * \param p_e an initialized exception pointer
621 * \return the currently configured zoom factor, or 0. if the video is set
622 * to fit to the output window/drawable automatically.
624 VLC_PUBLIC_API float libvlc_video_get_scale( libvlc_media_player_t *,
625 libvlc_exception_t *p_e );
628 * Set the video scaling factor. That is the ratio of the number of pixels on
629 * screen to the number of pixels in the original decoded video in each
630 * dimension. Zero is a special value; it will adjust the video to the output
631 * window/drawable (in windowed mode) or the entire screen.
633 * Note that not all video outputs support scaling.
635 * \param p_mediaplayer the media player
636 * \param i_factor the scaling factor, or zero
637 * \param p_e an initialized exception pointer
639 VLC_PUBLIC_API void libvlc_video_set_scale( libvlc_media_player_t *, float,
640 libvlc_exception_t *p_e );
643 * Get current video aspect ratio.
645 * \param p_mediaplayer the media player
646 * \param p_e an initialized exception pointer
647 * \return the video aspect ratio
649 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *, libvlc_exception_t * );
652 * Set new video aspect ratio.
654 * \param p_mediaplayer the media player
655 * \param psz_aspect new video aspect-ratio
656 * \param p_e an initialized exception pointer
658 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *, const char *, libvlc_exception_t * );
661 * Get current video subtitle.
663 * \param p_mediaplayer the media player
664 * \param p_e an initialized exception pointer
665 * \return the video subtitle selected
667 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *, libvlc_exception_t * );
670 * Get the number of available video subtitles.
672 * \param p_mediaplayer the media player
673 * \param p_e an initialized exception pointer
674 * \return the number of available video subtitles
676 VLC_PUBLIC_API int libvlc_video_get_spu_count( libvlc_media_player_t *, libvlc_exception_t * );
679 * Get the description of available video subtitles.
681 * \param p_mediaplayer the media player
682 * \param p_e an initialized exception pointer
683 * \return list containing description of available video subtitles
685 VLC_PUBLIC_API libvlc_track_description_t *
686 libvlc_video_get_spu_description( libvlc_media_player_t *, libvlc_exception_t * );
689 * Set new video subtitle.
691 * \param p_mediaplayer the media player
692 * \param i_spu new video subtitle to select
693 * \param p_e an initialized exception pointer
695 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_player_t *, int , libvlc_exception_t * );
698 * Set new video subtitle file.
700 * \param p_mediaplayer the media player
701 * \param psz_subtitle new video subtitle file
702 * \param p_e an initialized exception pointer
703 * \return the success status (boolean)
705 VLC_PUBLIC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *, const char *, libvlc_exception_t * );
708 * Get the description of available titles.
710 * \param p_mediaplayer the media player
711 * \param p_e an initialized exception pointer
712 * \return list containing description of available titles
714 VLC_PUBLIC_API libvlc_track_description_t *
715 libvlc_video_get_title_description( libvlc_media_player_t *, libvlc_exception_t * );
718 * Get the description of available chapters for specific title.
720 * \param p_mediaplayer the media player
721 * \param i_title selected title
722 * \param p_e an initialized exception pointer
723 * \return list containing description of available chapter for title i_title
725 VLC_PUBLIC_API libvlc_track_description_t *
726 libvlc_video_get_chapter_description( libvlc_media_player_t *, int, libvlc_exception_t * );
729 * Get current crop filter geometry.
731 * \param p_mediaplayer the media player
732 * \param p_e an initialized exception pointer
733 * \return the crop filter geometry
735 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *, libvlc_exception_t * );
738 * Set new crop filter geometry.
740 * \param p_mediaplayer the media player
741 * \param psz_geometry new crop filter geometry
742 * \param p_e an initialized exception pointer
744 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_player_t *, const char *, libvlc_exception_t * );
747 * Toggle teletext transparent status on video output.
749 * \param p_mediaplayer the media player
750 * \param p_e an initialized exception pointer
752 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *, libvlc_exception_t * );
755 * Get current teletext page requested.
757 * \param p_mediaplayer the media player
758 * \param p_e an initialized exception pointer
759 * \return the current teletext page requested.
761 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t *, libvlc_exception_t * );
764 * Set new teletext page to retrieve.
766 * \param p_mediaplayer the media player
767 * \param i_page teletex page number requested
768 * \param p_e an initialized exception pointer
770 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *, int, libvlc_exception_t * );
773 * Get number of available video tracks.
775 * \param p_mi media player
776 * \param p_e an initialized exception
777 * \return the number of available video tracks (int)
779 VLC_PUBLIC_API int libvlc_video_get_track_count( libvlc_media_player_t *, libvlc_exception_t * );
782 * Get the description of available video tracks.
784 * \param p_mi media player
785 * \param p_e an initialized exception
786 * \return list with description of available video tracks
788 VLC_PUBLIC_API libvlc_track_description_t *
789 libvlc_video_get_track_description( libvlc_media_player_t *, libvlc_exception_t * );
792 * Get current video track.
794 * \param p_mi media player
795 * \param p_e an initialized exception pointer
796 * \return the video track (int)
798 VLC_PUBLIC_API int libvlc_video_get_track( libvlc_media_player_t *, libvlc_exception_t * );
803 * \param p_mi media player
804 * \param i_track the track (int)
805 * \param p_e an initialized exception pointer
807 VLC_PUBLIC_API void libvlc_video_set_track( libvlc_media_player_t *, int, libvlc_exception_t * );
810 * Take a snapshot of the current video window.
812 * If i_width AND i_height is 0, original size is used.
813 * If i_width XOR i_height is 0, original aspect-ratio is preserved.
815 * \param p_mi media player instance
816 * \param psz_filepath the path where to save the screenshot to
817 * \param i_width the snapshot's width
818 * \param i_height the snapshot's height
819 * \param p_e an initialized exception pointer
821 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_player_t *, const char *,unsigned int, unsigned int, libvlc_exception_t * );
824 * Enable or disable deinterlace filter
826 * \param p_mi libvlc media player
827 * \param b_enable boolean to enable or disable deinterlace filter
828 * \param psz_mode type of deinterlace filter to use
829 * \param p_e an initialized exception pointer
831 VLC_PUBLIC_API void libvlc_video_set_deinterlace( libvlc_media_player_t *,
833 libvlc_exception_t *);
836 * Get an integer option value
838 * \param p_mi libvlc media player
839 * \param option marq option to get \see libvlc_video_marquee_int_option_t
840 * \param p_e an initialized exception pointer
842 VLC_PUBLIC_API int libvlc_video_get_marquee_int( libvlc_media_player_t *,
843 unsigned, libvlc_exception_t * );
846 * Get a string option value
848 * \param p_mi libvlc media player
849 * \param option marq option to get \see libvlc_video_marquee_string_option_t
850 * \param p_e an initialized exception pointer
852 VLC_PUBLIC_API char *libvlc_video_get_marquee_string( libvlc_media_player_t *,
853 unsigned, libvlc_exception_t * );
856 * Enable, disable or set an integer marq option
858 * Setting libvlc_marquee_Enable has the side effect of enabling (arg !0)
859 * or disabling (arg 0) the marq filter.
861 * \param p_mi libvlc media player
862 * \param option marq option to set \see libvlc_video_marquee_int_option_t
863 * \param i_val marq option value
864 * \param p_e an initialized exception pointer
866 VLC_PUBLIC_API void libvlc_video_set_marquee_int( libvlc_media_player_t *,
867 unsigned, int, libvlc_exception_t * );
870 * Set a marq string option
872 * \param p_mi libvlc media player
873 * \param option marq option to set \see libvlc_video_marquee_string_option_t
874 * \param psz_text marq option value
875 * \param p_e an initialized exception pointer
877 VLC_PUBLIC_API void libvlc_video_set_marquee_string( libvlc_media_player_t *,
878 unsigned, const char *, libvlc_exception_t * );
880 enum libvlc_video_logo_option_t {
882 libvlc_logo_file, /**< string argument, "file,d,t;file,d,t;..." */
888 libvlc_logo_position,
892 * Get integer logo option.
894 * \param p_mi libvlc media player instance
895 * \param option logo option to get, values of libvlc_video_logo_option_t
896 * \param p_e an pointer to an initialized exception object
898 VLC_PUBLIC_API int libvlc_video_get_logo_int( libvlc_media_player_t *p_mi,
899 unsigned option, libvlc_exception_t *p_e );
902 * Set logo option as integer. Options that take a different type value
903 * cause an invalid argument exception.
904 * Passing libvlc_logo_enable as option value has the side effect of
905 * starting (arg !0) or stopping (arg 0) the logo filter.
907 * \param p_mi libvlc media player instance
908 * \param option logo option to set, values of libvlc_video_logo_option_t
909 * \param value logo option value
910 * \param p_e an pointer to an initialized exception object
912 VLC_PUBLIC_API void libvlc_video_set_logo_int( libvlc_media_player_t *p_mi,
913 unsigned option, int value, libvlc_exception_t *p_e );
916 * Set logo option as string. Options that take a different type value
917 * cause an invalid argument exception.
919 * \param p_mi libvlc media player instance
920 * \param option logo option to set, values of libvlc_video_logo_option_t
921 * \param psz_value logo option value
922 * \param p_e an pointer to an initialized exception object
924 VLC_PUBLIC_API void libvlc_video_set_logo_string( libvlc_media_player_t *p_mi,
925 unsigned option, const char *psz_value, libvlc_exception_t *p_e );
929 /** \defgroup libvlc_audio libvlc_audio
930 * \ingroup libvlc_media_player
931 * LibVLC Audio handling
938 typedef enum libvlc_audio_output_device_types_t {
939 libvlc_AudioOutputDevice_Error = -1,
940 libvlc_AudioOutputDevice_Mono = 1,
941 libvlc_AudioOutputDevice_Stereo = 2,
942 libvlc_AudioOutputDevice_2F2R = 4,
943 libvlc_AudioOutputDevice_3F2R = 5,
944 libvlc_AudioOutputDevice_5_1 = 6,
945 libvlc_AudioOutputDevice_6_1 = 7,
946 libvlc_AudioOutputDevice_7_1 = 8,
947 libvlc_AudioOutputDevice_SPDIF = 10
948 } libvlc_audio_output_device_types_t;
953 typedef enum libvlc_audio_output_channel_t {
954 libvlc_AudioChannel_Error = -1,
955 libvlc_AudioChannel_Stereo = 1,
956 libvlc_AudioChannel_RStereo = 2,
957 libvlc_AudioChannel_Left = 3,
958 libvlc_AudioChannel_Right = 4,
959 libvlc_AudioChannel_Dolbys = 5
960 } libvlc_audio_output_channel_t;
964 * Get the list of available audio outputs
966 * \param p_instance libvlc instance
967 * \param p_e an initialized exception pointer
968 * \return list of available audio outputs, at the end free it with
969 * \see libvlc_audio_output_list_release \see libvlc_audio_output_t
971 VLC_PUBLIC_API libvlc_audio_output_t *
972 libvlc_audio_output_list_get( libvlc_instance_t *,
973 libvlc_exception_t * );
976 * Free the list of available audio outputs
978 * \param p_list list with audio outputs for release
980 VLC_PUBLIC_API void libvlc_audio_output_list_release( libvlc_audio_output_t * );
983 * Set the audio output.
984 * Change will be applied after stop and play.
986 * \param p_instance libvlc instance
987 * \param psz_name name of audio output,
988 * use psz_name of \see libvlc_audio_output_t
989 * \return true if function succeded
991 VLC_PUBLIC_API int libvlc_audio_output_set( libvlc_instance_t *,
995 * Get count of devices for audio output, these devices are hardware oriented
996 * like analor or digital output of sound card
998 * \param p_instance libvlc instance
999 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1000 * \return number of devices
1002 VLC_PUBLIC_API int libvlc_audio_output_device_count( libvlc_instance_t *,
1006 * Get long name of device, if not available short name given
1008 * \param p_instance libvlc instance
1009 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1010 * \param i_device device index
1011 * \return long name of device
1013 VLC_PUBLIC_API char * libvlc_audio_output_device_longname( libvlc_instance_t *,
1018 * Get id name of device
1020 * \param p_instance libvlc instance
1021 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1022 * \param i_device device index
1023 * \return id name of device, use for setting device, need to be free after use
1025 VLC_PUBLIC_API char * libvlc_audio_output_device_id( libvlc_instance_t *,
1030 * Set device for using
1032 * \param p_instance libvlc instance
1033 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1034 * \param psz_device_id device
1036 VLC_PUBLIC_API void libvlc_audio_output_device_set( libvlc_instance_t *,
1041 * Get current audio device type. Device type describes something like
1042 * character of output sound - stereo sound, 2.1, 5.1 etc
1044 * \param p_instance vlc instance
1045 * \param p_e an initialized exception pointer
1046 * \return the audio devices type \see libvlc_audio_output_device_types_t
1048 VLC_PUBLIC_API int libvlc_audio_output_get_device_type(
1049 libvlc_instance_t *, libvlc_exception_t * );
1052 * Set current audio device type.
1054 * \param p_instance vlc instance
1055 * \param device_type the audio device type,
1056 according to \see libvlc_audio_output_device_types_t
1057 * \param p_e an initialized exception pointer
1059 VLC_PUBLIC_API void libvlc_audio_output_set_device_type( libvlc_instance_t *,
1061 libvlc_exception_t * );
1065 * Toggle mute status.
1067 * \param p_instance libvlc instance
1069 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t * );
1072 * Get current mute status.
1074 * \param p_instance libvlc instance
1075 * \return the mute status (boolean)
1077 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_instance_t * );
1082 * \param p_instance libvlc instance
1083 * \param status If status is true then mute, otherwise unmute
1085 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, int );
1088 * Get current audio level.
1090 * \param p_instance libvlc instance
1091 * \param p_e an initialized exception pointer
1092 * \return the audio level (int)
1094 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t * );
1097 * Set current audio level.
1099 * \param p_instance libvlc instance
1100 * \param i_volume the volume (int)
1101 * \param p_e an initialized exception pointer
1103 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
1106 * Get number of available audio tracks.
1108 * \param p_mi media player
1109 * \param p_e an initialized exception
1110 * \return the number of available audio tracks (int)
1112 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *, libvlc_exception_t * );
1115 * Get the description of available audio tracks.
1117 * \param p_mi media player
1118 * \param p_e an initialized exception
1119 * \return list with description of available audio tracks
1121 VLC_PUBLIC_API libvlc_track_description_t *
1122 libvlc_audio_get_track_description( libvlc_media_player_t *, libvlc_exception_t * );
1125 * Get current audio track.
1127 * \param p_mi media player
1128 * \param p_e an initialized exception pointer
1129 * \return the audio track (int)
1131 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *, libvlc_exception_t * );
1134 * Set current audio track.
1136 * \param p_mi media player
1137 * \param i_track the track (int)
1138 * \param p_e an initialized exception pointer
1140 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_player_t *, int, libvlc_exception_t * );
1143 * Get current audio channel.
1145 * \param p_instance vlc instance
1146 * \param p_e an initialized exception pointer
1147 * \return the audio channel \see libvlc_audio_output_channel_t
1150 libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
1153 * Set current audio channel.
1155 * \param p_instance vlc instance
1156 * \param channel the audio channel, \see libvlc_audio_output_channel_t
1157 * \param p_e an initialized exception pointer
1159 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *,
1161 libvlc_exception_t * );
1165 /** @} media_player */
1171 #endif /* VLC_LIBVLC_MEDIA_PLAYER_H */