1 /*****************************************************************************
2 * libvlc_media_player.h: libvlc_media_player external API
3 *****************************************************************************
4 * Copyright (C) 1998-2010 the VideoLAN team
7 * Authors: Clément Stenac <zorglub@videolan.org>
8 * Jean-Paul Saman <jpsaman@videolan.org>
9 * Pierre d'Herbemont <pdherbemont@videolan.org>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24 *****************************************************************************/
28 * This file defines libvlc_media_player external API
31 #ifndef VLC_LIBVLC_MEDIA_PLAYER_H
32 #define VLC_LIBVLC_MEDIA_PLAYER_H 1
38 /*****************************************************************************
40 *****************************************************************************/
41 /** \defgroup libvlc_media_player LibVLC media player
43 * A LibVLC media player plays one media (usually in a custom drawable).
47 typedef struct libvlc_media_player_t libvlc_media_player_t;
50 * Description for video, audio tracks and subtitles. It contains
51 * id, name (description string) and pointer to next record.
53 typedef struct libvlc_track_description_t
57 struct libvlc_track_description_t *p_next;
59 } libvlc_track_description_t;
62 * Description for audio output. It contains
63 * name, description and pointer to next record.
65 typedef struct libvlc_audio_output_t
68 char *psz_description;
69 struct libvlc_audio_output_t *p_next;
71 } libvlc_audio_output_t;
74 * Rectangle type for video geometry
76 typedef struct libvlc_rectangle_t
83 * Marq options definition
85 typedef enum libvlc_video_marquee_option_t {
86 libvlc_marquee_Enable = 0,
87 libvlc_marquee_Text, /** string argument */
89 libvlc_marquee_Opacity,
90 libvlc_marquee_Position,
91 libvlc_marquee_Refresh,
93 libvlc_marquee_Timeout,
96 } libvlc_video_marquee_option_t;
99 * Create an empty Media Player object
101 * \param p_libvlc_instance the libvlc instance in which the Media Player
103 * \return a new media player object, or NULL on error.
105 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t *p_libvlc_instance );
108 * Create a Media Player object from a Media
110 * \param p_md the media. Afterwards the p_md can be safely
112 * \return a new media player object, or NULL on error.
114 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new_from_media( libvlc_media_t *p_md );
117 * Release a media_player after use
118 * Decrement the reference count of a media player object. If the
119 * reference count is 0, then libvlc_media_player_release() will
120 * release the media player object. If the media player object
121 * has been released, then it should not be used again.
123 * \param p_mi the Media Player to free
125 VLC_PUBLIC_API void libvlc_media_player_release( libvlc_media_player_t *p_mi );
128 * Retain a reference to a media player object. Use
129 * libvlc_media_player_release() to decrement reference count.
131 * \param p_mi media player object
133 VLC_PUBLIC_API void libvlc_media_player_retain( libvlc_media_player_t *p_mi );
136 * Set the media that will be used by the media_player. If any,
137 * previous md will be released.
139 * \param p_mi the Media Player
140 * \param p_md the Media. Afterwards the p_md can be safely
143 VLC_PUBLIC_API void libvlc_media_player_set_media( libvlc_media_player_t *p_mi,
144 libvlc_media_t *p_md );
147 * Get the media used by the media_player.
149 * \param p_mi the Media Player
150 * \return the media associated with p_mi, or NULL if no
151 * media is associated
153 VLC_PUBLIC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t *p_mi );
156 * Get the Event Manager from which the media player send event.
158 * \param p_mi the Media Player
159 * \return the event manager associated with p_mi
161 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *p_mi );
166 * \param p_mi the Media Player
167 * \return 1 if the media player is playing, 0 otherwise
169 VLC_PUBLIC_API int libvlc_media_player_is_playing ( libvlc_media_player_t *p_mi );
174 * \param p_mi the Media Player
175 * \return 0 if playback started (and was already started), or -1 on error.
177 VLC_PUBLIC_API int libvlc_media_player_play ( libvlc_media_player_t *p_mi );
180 * Toggle pause (no effect if there is no media)
182 * \param p_mi the Media Player
184 VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *p_mi );
187 * Stop (no effect if there is no media)
189 * \param p_mi the Media Player
191 VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *p_mi );
194 * Set the NSView handler where the media player should render its video output.
196 * The object minimal_macosx expects is of kind NSObject and should
197 * respect the protocol:
200 * \@protocol VLCOpenGLVideoViewEmbedding <NSObject>
201 * - (void)addVoutSubview:(NSView *)view;
202 * - (void)removeVoutSubview:(NSView *)view;
206 * You can find a live example in VLCVideoView in VLCKit.framework.
208 * \param p_mi the Media Player
209 * \param drawable the NSView handler
211 VLC_PUBLIC_API void libvlc_media_player_set_nsobject ( libvlc_media_player_t *p_mi, void * drawable );
214 * Get the NSView handler previously set with libvlc_media_player_set_nsobject().
216 * \param p_mi the Media Player
217 * \return the NSView handler or 0 if none where set
219 VLC_PUBLIC_API void * libvlc_media_player_get_nsobject ( libvlc_media_player_t *p_mi );
222 * Set the agl handler where the media player should render its video output.
224 * \param p_mi the Media Player
225 * \param drawable the agl handler
227 VLC_PUBLIC_API void libvlc_media_player_set_agl ( libvlc_media_player_t *p_mi, uint32_t drawable );
230 * Get the agl handler previously set with libvlc_media_player_set_agl().
232 * \param p_mi the Media Player
233 * \return the agl handler or 0 if none where set
235 VLC_PUBLIC_API uint32_t libvlc_media_player_get_agl ( libvlc_media_player_t *p_mi );
238 * Set an X Window System drawable where the media player should render its
239 * video output. If LibVLC was built without X11 output support, then this has
242 * The specified identifier must correspond to an existing Input/Output class
243 * X11 window. Pixmaps are <b>not</b> supported. The caller shall ensure that
244 * the X11 server is the same as the one the VLC instance has been configured
246 * If XVideo is <b>not</b> used, it is assumed that the drawable has the
247 * following properties in common with the default X11 screen: depth, scan line
248 * pad, black pixel. This is a bug.
250 * \param p_mi the Media Player
251 * \param drawable the ID of the X window
253 VLC_PUBLIC_API void libvlc_media_player_set_xwindow ( libvlc_media_player_t *p_mi, uint32_t drawable );
256 * Get the X Window System window identifier previously set with
257 * libvlc_media_player_set_xwindow(). Note that this will return the identifier
258 * even if VLC is not currently using it (for instance if it is playing an
261 * \param p_mi the Media Player
262 * \return an X window ID, or 0 if none where set.
264 VLC_PUBLIC_API uint32_t libvlc_media_player_get_xwindow ( libvlc_media_player_t *p_mi );
267 * Set a Win32/Win64 API window handle (HWND) where the media player should
268 * render its video output. If LibVLC was built without Win32/Win64 API output
269 * support, then this has no effects.
271 * \param p_mi the Media Player
272 * \param drawable windows handle of the drawable
274 VLC_PUBLIC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi, void *drawable );
277 * Get the Windows API window handle (HWND) previously set with
278 * libvlc_media_player_set_hwnd(). The handle will be returned even if LibVLC
279 * is not currently outputting any video to it.
281 * \param p_mi the Media Player
282 * \return a window handle or NULL if there are none.
284 VLC_PUBLIC_API void *libvlc_media_player_get_hwnd ( libvlc_media_player_t *p_mi );
288 /** \bug This might go away ... to be replaced by a broader system */
291 * Get the current movie length (in ms).
293 * \param p_mi the Media Player
294 * \return the movie length (in ms), or -1 if there is no media.
296 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_length( libvlc_media_player_t *p_mi );
299 * Get the current movie time (in ms).
301 * \param p_mi the Media Player
302 * \return the movie time (in ms), or -1 if there is no media.
304 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_time( libvlc_media_player_t *p_mi );
307 * Set the movie time (in ms). This has no effect if no media is being played.
308 * Not all formats and protocols support this.
310 * \param p_mi the Media Player
311 * \param i_time the movie time (in ms).
313 VLC_PUBLIC_API void libvlc_media_player_set_time( libvlc_media_player_t *p_mi, libvlc_time_t i_time );
316 * Get movie position.
318 * \param p_mi the Media Player
319 * \return movie position, or -1. in case of error
321 VLC_PUBLIC_API float libvlc_media_player_get_position( libvlc_media_player_t *p_mi );
324 * Set movie position. This has no effect if playback is not enabled.
325 * This might not work depending on the underlying input format and protocol.
327 * \param p_mi the Media Player
328 * \param f_pos the position
330 VLC_PUBLIC_API void libvlc_media_player_set_position( libvlc_media_player_t *p_mi, float f_pos );
333 * Set movie chapter (if applicable).
335 * \param p_mi the Media Player
336 * \param i_chapter chapter number to play
338 VLC_PUBLIC_API void libvlc_media_player_set_chapter( libvlc_media_player_t *p_mi, int i_chapter );
343 * \param p_mi the Media Player
344 * \return chapter number currently playing, or -1 if there is no media.
346 VLC_PUBLIC_API int libvlc_media_player_get_chapter( libvlc_media_player_t *p_mi );
349 * Get movie chapter count
351 * \param p_mi the Media Player
352 * \return number of chapters in movie, or -1.
354 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count( libvlc_media_player_t *p_mi );
357 * Is the player able to play
359 * \param p_mi the Media Player
362 VLC_PUBLIC_API int libvlc_media_player_will_play( libvlc_media_player_t *p_mi );
365 * Get title chapter count
367 * \param p_mi the Media Player
368 * \param i_title title
369 * \return number of chapters in title, or -1
371 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count_for_title(
372 libvlc_media_player_t *p_mi, int i_title );
377 * \param p_mi the Media Player
378 * \param i_title title number to play
380 VLC_PUBLIC_API void libvlc_media_player_set_title( libvlc_media_player_t *p_mi, int i_title );
385 * \param p_mi the Media Player
386 * \return title number currently playing, or -1
388 VLC_PUBLIC_API int libvlc_media_player_get_title( libvlc_media_player_t *p_mi );
391 * Get movie title count
393 * \param p_mi the Media Player
394 * \return title number count, or -1
396 VLC_PUBLIC_API int libvlc_media_player_get_title_count( libvlc_media_player_t *p_mi );
399 * Set previous chapter (if applicable)
401 * \param p_mi the Media Player
403 VLC_PUBLIC_API void libvlc_media_player_previous_chapter( libvlc_media_player_t *p_mi );
406 * Set next chapter (if applicable)
408 * \param p_mi the Media Player
410 VLC_PUBLIC_API void libvlc_media_player_next_chapter( libvlc_media_player_t *p_mi );
413 * Get the requested movie play rate.
414 * @warning Depending on the underlying media, the requested rate may be
415 * different from the real playback rate.
417 * \param p_mi the Media Player
418 * \return movie play rate
420 VLC_PUBLIC_API float libvlc_media_player_get_rate( libvlc_media_player_t *p_mi );
423 * Set movie play rate
425 * \param p_mi the Media Player
426 * \param rate movie play rate to set
427 * \return -1 if an error was detected, 0 otherwise (but even then, it might
428 * not actually work depending on the underlying media protocol)
430 VLC_PUBLIC_API int libvlc_media_player_set_rate( libvlc_media_player_t *p_mi, float rate );
433 * Get current movie state
435 * \param p_mi the Media Player
437 VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *p_mi );
442 * \param p_mi the Media Player
443 * \return frames per second (fps) for this playing movie, or 0 if unspecified
445 VLC_PUBLIC_API float libvlc_media_player_get_fps( libvlc_media_player_t *p_mi );
450 * How many video outputs does this media player have?
452 * \param p_mi the media player
453 * \return the number of video outputs
455 VLC_PUBLIC_API unsigned libvlc_media_player_has_vout( libvlc_media_player_t *p_mi );
458 * Is this media player seekable?
460 * \param p_mi the media player
462 VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi );
465 * Can this media player be paused?
467 * \param p_mi the media player
469 VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi );
473 * Display the next frame (if supported)
475 * \param p_mi the media player
477 VLC_PUBLIC_API void libvlc_media_player_next_frame( libvlc_media_player_t *p_mi );
482 * Release (free) libvlc_track_description_t
484 * \param p_track_description the structure to release
486 VLC_PUBLIC_API void libvlc_track_description_release( libvlc_track_description_t *p_track_description );
488 /** \defgroup libvlc_video LibVLC video controls
493 * Toggle fullscreen status on non-embedded video outputs.
495 * @warning The same limitations applies to this function
496 * as to libvlc_set_fullscreen().
498 * \param p_mi the media player
500 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *p_mi );
503 * Enable or disable fullscreen.
505 * @warning With most window managers, only a top-level windows can be in
506 * full-screen mode. Hence, this function will not operate properly if
507 * libvlc_media_player_set_xid() was used to embed the video in a non-top-level
508 * window. In that case, the embedding window must be reparented to the root
509 * window <b>before</b> fullscreen mode is enabled. You will want to reparent
510 * it back to its normal parent when disabling fullscreen.
512 * \param p_mi the media player
513 * \param b_fullscreen boolean for fullscreen status
515 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *p_mi, int b_fullscreen );
518 * Get current fullscreen status.
520 * \param p_mi the media player
521 * \return the fullscreen status (boolean)
523 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t *p_mi );
526 * Enable or disable key press events handling, according to the LibVLC hotkeys
527 * configuration. By default and for historical reasons, keyboard events are
528 * handled by the LibVLC video widget.
530 * \note On X11, there can be only one subscriber for key press and mouse
531 * click events per window. If your application has subscribed to those events
532 * for the X window ID of the video widget, then LibVLC will not be able to
533 * handle key presses and mouse clicks in any case.
535 * \warning This function is only implemented for X11 at the moment.
537 * \param p_mi the media player
538 * \param on true to handle key press events, false to ignore them.
541 void libvlc_video_set_key_input( libvlc_media_player_t *p_mi, unsigned on );
544 * Enable or disable mouse click events handling. By default, those events are
545 * handled. This is needed for DVD menus to work, as well as a few video
546 * filters such as "puzzle".
548 * \note See also libvlc_video_set_key_input().
550 * \warning This function is only implemented for X11 at the moment.
552 * \param p_mi the media player
553 * \param on true to handle mouse click events, false to ignore them.
556 void libvlc_video_set_mouse_input( libvlc_media_player_t *p_mi, unsigned on );
559 * Get the pixel dimensions of a video.
561 * \param p_mi media player
562 * \param num number of the video (starting from, and most commonly 0)
563 * \param px pointer to get the pixel width [OUT]
564 * \param py pointer to get the pixel height [OUT]
565 * \return 0 on success, -1 if the specified video does not exist
568 int libvlc_video_get_size( libvlc_media_player_t *p_mi, unsigned num,
569 unsigned *px, unsigned *py );
572 * Get current video height.
573 * You should use libvlc_video_get_size() instead.
575 * \param p_mi the media player
576 * \return the video pixel height or 0 if not applicable
579 int libvlc_video_get_height( libvlc_media_player_t *p_mi );
582 * Get current video width.
583 * You should use libvlc_video_get_size() instead.
585 * \param p_mi the media player
586 * \return the video pixel width or 0 if not applicable
589 int libvlc_video_get_width( libvlc_media_player_t *p_mi );
592 * Get the mouse pointer coordinates over a video.
593 * Coordinates are expressed in terms of the decoded video resolution,
594 * <b>not</b> in terms of pixels on the screen/viewport (to get the latter,
595 * you can query your windowing system directly).
597 * Either of the coordinates may be negative or larger than the corresponding
598 * dimension of the video, if the cursor is outside the rendering area.
600 * @warning The coordinates may be out-of-date if the pointer is not located
601 * on the video rendering area. LibVLC does not track the pointer if it is
602 * outside of the video widget.
604 * @note LibVLC does not support multiple pointers (it does of course support
605 * multiple input devices sharing the same pointer) at the moment.
607 * \param p_mi media player
608 * \param num number of the video (starting from, and most commonly 0)
609 * \param px pointer to get the abscissa [OUT]
610 * \param py pointer to get the ordinate [OUT]
611 * \return 0 on success, -1 if the specified video does not exist
614 int libvlc_video_get_cursor( libvlc_media_player_t *p_mi, unsigned num,
618 * Get the current video scaling factor.
619 * See also libvlc_video_set_scale().
621 * \param p_mi the media player
622 * \return the currently configured zoom factor, or 0. if the video is set
623 * to fit to the output window/drawable automatically.
625 VLC_PUBLIC_API float libvlc_video_get_scale( libvlc_media_player_t *p_mi );
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_mi the media player
636 * \param f_factor the scaling factor, or zero
638 VLC_PUBLIC_API void libvlc_video_set_scale( libvlc_media_player_t *p_mi, float f_factor );
641 * Get current video aspect ratio.
643 * \param p_mi the media player
644 * \return the video aspect ratio or NULL if unspecified
645 * (the result must be released with free()).
647 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *p_mi );
650 * Set new video aspect ratio.
652 * \param p_mi the media player
653 * \param psz_aspect new video aspect-ratio or NULL to reset to default
654 * \note Invalid aspect ratios are ignored.
656 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *p_mi, const char *psz_aspect );
659 * Get current video subtitle.
661 * \param p_mi the media player
662 * \return the video subtitle selected, or -1 if none
664 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *p_mi );
667 * Get the number of available video subtitles.
669 * \param p_mi the media player
670 * \return the number of available video subtitles
672 VLC_PUBLIC_API int libvlc_video_get_spu_count( libvlc_media_player_t *p_mi );
675 * Get the description of available video subtitles.
677 * \param p_mi the media player
678 * \return list containing description of available video subtitles
680 VLC_PUBLIC_API libvlc_track_description_t *
681 libvlc_video_get_spu_description( libvlc_media_player_t *p_mi );
684 * Set new video subtitle.
686 * \param p_mi the media player
687 * \param i_spu new video subtitle to select
688 * \return 0 on success, -1 if out of range
690 VLC_PUBLIC_API int libvlc_video_set_spu( libvlc_media_player_t *p_mi, unsigned i_spu );
693 * Set new video subtitle file.
695 * \param p_mi the media player
696 * \param psz_subtitle new video subtitle file
697 * \return the success status (boolean)
699 VLC_PUBLIC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *p_mi, const char *psz_subtitle );
702 * Get the description of available titles.
704 * \param p_mi the media player
705 * \return list containing description of available titles
707 VLC_PUBLIC_API libvlc_track_description_t *
708 libvlc_video_get_title_description( libvlc_media_player_t *p_mi );
711 * Get the description of available chapters for specific title.
713 * \param p_mi the media player
714 * \param i_title selected title
715 * \return list containing description of available chapter for title i_title
717 VLC_PUBLIC_API libvlc_track_description_t *
718 libvlc_video_get_chapter_description( libvlc_media_player_t *p_mi, int i_title );
721 * Get current crop filter geometry.
723 * \param p_mi the media player
724 * \return the crop filter geometry or NULL if unset
726 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *p_mi );
729 * Set new crop filter geometry.
731 * \param p_mi the media player
732 * \param psz_geometry new crop filter geometry (NULL to unset)
735 void libvlc_video_set_crop_geometry( libvlc_media_player_t *p_mi, const char *psz_geometry );
738 * Get current teletext page requested.
740 * \param p_mi the media player
741 * \return the current teletext page requested.
743 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t *p_mi );
746 * Set new teletext page to retrieve.
748 * \param p_mi the media player
749 * \param i_page teletex page number requested
751 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *p_mi, int i_page );
754 * Toggle teletext transparent status on video output.
756 * \param p_mi the media player
758 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *p_mi );
761 * Get number of available video tracks.
763 * \param p_mi media player
764 * \return the number of available video tracks (int)
766 VLC_PUBLIC_API int libvlc_video_get_track_count( libvlc_media_player_t *p_mi );
769 * Get the description of available video tracks.
771 * \param p_mi media player
772 * \return list with description of available video tracks, or NULL on error
774 VLC_PUBLIC_API libvlc_track_description_t *
775 libvlc_video_get_track_description( libvlc_media_player_t *p_mi );
778 * Get current video track.
780 * \param p_mi media player
781 * \return the video track (int) or -1 if none
783 VLC_PUBLIC_API int libvlc_video_get_track( libvlc_media_player_t *p_mi );
788 * \param p_mi media player
789 * \param i_track the track (int)
790 * \return 0 on success, -1 if out of range
793 int libvlc_video_set_track( libvlc_media_player_t *p_mi, int i_track );
796 * Take a snapshot of the current video window.
798 * If i_width AND i_height is 0, original size is used.
799 * If i_width XOR i_height is 0, original aspect-ratio is preserved.
801 * \param p_mi media player instance
802 * \param num number of video output (typically 0 for the first/only one)
803 * \param psz_filepath the path where to save the screenshot to
804 * \param i_width the snapshot's width
805 * \param i_height the snapshot's height
806 * \return 0 on success, -1 if the video was not found
809 int libvlc_video_take_snapshot( libvlc_media_player_t *p_mi, unsigned num,
810 const char *psz_filepath, unsigned int i_width,
811 unsigned int i_height );
814 * Enable or disable deinterlace filter
816 * \param p_mi libvlc media player
817 * \param psz_mode type of deinterlace filter, NULL to disable
819 VLC_PUBLIC_API void libvlc_video_set_deinterlace( libvlc_media_player_t *p_mi,
820 const char *psz_mode );
823 * Get an integer marquee option value
825 * \param p_mi libvlc media player
826 * \param option marq option to get \see libvlc_video_marquee_int_option_t
828 VLC_PUBLIC_API int libvlc_video_get_marquee_int( libvlc_media_player_t *p_mi,
832 * Get a string marquee option value
834 * \param p_mi libvlc media player
835 * \param option marq option to get \see libvlc_video_marquee_string_option_t
837 VLC_PUBLIC_API char *libvlc_video_get_marquee_string( libvlc_media_player_t *p_mi,
841 * Enable, disable or set an integer marquee option
843 * Setting libvlc_marquee_Enable has the side effect of enabling (arg !0)
844 * or disabling (arg 0) the marq filter.
846 * \param p_mi libvlc media player
847 * \param option marq option to set \see libvlc_video_marquee_int_option_t
848 * \param i_val marq option value
850 VLC_PUBLIC_API void libvlc_video_set_marquee_int( libvlc_media_player_t *p_mi,
851 unsigned option, int i_val );
854 * Set a marquee string option
856 * \param p_mi libvlc media player
857 * \param option marq option to set \see libvlc_video_marquee_string_option_t
858 * \param psz_text marq option value
860 VLC_PUBLIC_API void libvlc_video_set_marquee_string( libvlc_media_player_t *p_mi,
861 unsigned option, const char *psz_text );
863 /** option values for libvlc_video_{get,set}_logo_{int,string} */
864 enum libvlc_video_logo_option_t {
866 libvlc_logo_file, /**< string argument, "file,d,t;file,d,t;..." */
872 libvlc_logo_position,
876 * Get integer logo option.
878 * \param p_mi libvlc media player instance
879 * \param option logo option to get, values of libvlc_video_logo_option_t
881 VLC_PUBLIC_API int libvlc_video_get_logo_int( libvlc_media_player_t *p_mi,
885 * Set logo option as integer. Options that take a different type value
887 * Passing libvlc_logo_enable as option value has the side effect of
888 * starting (arg !0) or stopping (arg 0) the logo filter.
890 * \param p_mi libvlc media player instance
891 * \param option logo option to set, values of libvlc_video_logo_option_t
892 * \param value logo option value
894 VLC_PUBLIC_API void libvlc_video_set_logo_int( libvlc_media_player_t *p_mi,
895 unsigned option, int value );
898 * Set logo option as string. Options that take a different type value
901 * \param p_mi libvlc media player instance
902 * \param option logo option to set, values of libvlc_video_logo_option_t
903 * \param psz_value logo option value
905 VLC_PUBLIC_API void libvlc_video_set_logo_string( libvlc_media_player_t *p_mi,
906 unsigned option, const char *psz_value );
911 /** \defgroup libvlc_audio LibVLC audio controls
918 typedef enum libvlc_audio_output_device_types_t {
919 libvlc_AudioOutputDevice_Error = -1,
920 libvlc_AudioOutputDevice_Mono = 1,
921 libvlc_AudioOutputDevice_Stereo = 2,
922 libvlc_AudioOutputDevice_2F2R = 4,
923 libvlc_AudioOutputDevice_3F2R = 5,
924 libvlc_AudioOutputDevice_5_1 = 6,
925 libvlc_AudioOutputDevice_6_1 = 7,
926 libvlc_AudioOutputDevice_7_1 = 8,
927 libvlc_AudioOutputDevice_SPDIF = 10
928 } libvlc_audio_output_device_types_t;
933 typedef enum libvlc_audio_output_channel_t {
934 libvlc_AudioChannel_Error = -1,
935 libvlc_AudioChannel_Stereo = 1,
936 libvlc_AudioChannel_RStereo = 2,
937 libvlc_AudioChannel_Left = 3,
938 libvlc_AudioChannel_Right = 4,
939 libvlc_AudioChannel_Dolbys = 5
940 } libvlc_audio_output_channel_t;
944 * Get the list of available audio outputs
946 * \param p_instance libvlc instance
947 * \return list of available audio outputs. It must be freed it with
948 * \see libvlc_audio_output_list_release \see libvlc_audio_output_t .
949 * In case of error, NULL is returned.
951 VLC_PUBLIC_API libvlc_audio_output_t *
952 libvlc_audio_output_list_get( libvlc_instance_t *p_instance );
955 * Free the list of available audio outputs
957 * \param p_list list with audio outputs for release
959 VLC_PUBLIC_API void libvlc_audio_output_list_release( libvlc_audio_output_t *p_list );
962 * Set the audio output.
963 * Change will be applied after stop and play.
965 * \param p_mi media player
966 * \param psz_name name of audio output,
967 * use psz_name of \see libvlc_audio_output_t
968 * \return true if function succeded
970 VLC_PUBLIC_API int libvlc_audio_output_set( libvlc_media_player_t *p_mi,
971 const char *psz_name );
974 * Get count of devices for audio output, these devices are hardware oriented
975 * like analor or digital output of sound card
977 * \param p_instance libvlc instance
978 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
979 * \return number of devices
981 VLC_PUBLIC_API int libvlc_audio_output_device_count( libvlc_instance_t *p_instance,
982 const char *psz_audio_output );
985 * Get long name of device, if not available short name given
987 * \param p_instance libvlc instance
988 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
989 * \param i_device device index
990 * \return long name of device
992 VLC_PUBLIC_API char * libvlc_audio_output_device_longname( libvlc_instance_t *p_instance,
993 const char *psz_audio_output,
997 * Get id name of device
999 * \param p_instance libvlc instance
1000 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1001 * \param i_device device index
1002 * \return id name of device, use for setting device, need to be free after use
1004 VLC_PUBLIC_API char * libvlc_audio_output_device_id( libvlc_instance_t *p_instance,
1005 const char *psz_audio_output,
1009 * Set audio output device. Changes are only effective after stop and play.
1011 * \param p_mi media player
1012 * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1013 * \param psz_device_id device
1015 VLC_PUBLIC_API void libvlc_audio_output_device_set( libvlc_media_player_t *p_mi,
1016 const char *psz_audio_output,
1017 const char *psz_device_id );
1020 * Get current audio device type. Device type describes something like
1021 * character of output sound - stereo sound, 2.1, 5.1 etc
1023 * \param p_mi media player
1024 * \return the audio devices type \see libvlc_audio_output_device_types_t
1026 VLC_PUBLIC_API int libvlc_audio_output_get_device_type( libvlc_media_player_t *p_mi );
1029 * Set current audio device type.
1031 * \param p_mi vlc instance
1032 * \param device_type the audio device type,
1033 according to \see libvlc_audio_output_device_types_t
1035 VLC_PUBLIC_API void libvlc_audio_output_set_device_type( libvlc_media_player_t *p_mi,
1040 * Toggle mute status.
1042 * \param p_mi media player
1044 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_media_player_t *p_mi );
1047 * Get current mute status.
1049 * \param p_mi media player
1050 * \return the mute status (boolean)
1052 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_media_player_t *p_mi );
1057 * \param p_mi media player
1058 * \param status If status is true then mute, otherwise unmute
1060 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_media_player_t *p_mi, int status );
1063 * Get current audio level.
1065 * \param p_mi media player
1066 * \return the audio level (int)
1068 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_media_player_t *p_mi );
1071 * Set current audio level.
1073 * \param p_mi media player
1074 * \param i_volume the volume (int)
1075 * \return 0 if the volume was set, -1 if it was out of range
1077 VLC_PUBLIC_API int libvlc_audio_set_volume( libvlc_media_player_t *p_mi, int i_volume );
1080 * Get number of available audio tracks.
1082 * \param p_mi media player
1083 * \return the number of available audio tracks (int), or -1 if unavailable
1085 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *p_mi );
1088 * Get the description of available audio tracks.
1090 * \param p_mi media player
1091 * \return list with description of available audio tracks, or NULL
1093 VLC_PUBLIC_API libvlc_track_description_t *
1094 libvlc_audio_get_track_description( libvlc_media_player_t *p_mi );
1097 * Get current audio track.
1099 * \param p_mi media player
1100 * \return the audio track (int), or -1 if none.
1102 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *p_mi );
1105 * Set current audio track.
1107 * \param p_mi media player
1108 * \param i_track the track (int)
1109 * \return 0 on success, -1 on error
1111 VLC_PUBLIC_API int libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track );
1114 * Get current audio channel.
1116 * \param p_mi media player
1117 * \return the audio channel \see libvlc_audio_output_channel_t
1119 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_media_player_t *p_mi );
1122 * Set current audio channel.
1124 * \param p_mi media player
1125 * \param channel the audio channel, \see libvlc_audio_output_channel_t
1126 * \return 0 on success, -1 on error
1128 VLC_PUBLIC_API int libvlc_audio_set_channel( libvlc_media_player_t *p_mi, int channel );
1132 /** @} media_player */
1138 #endif /* VLC_LIBVLC_MEDIA_PLAYER_H */