]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_media_player.h
libvlc: fix doxygen comments.
[vlc] / include / vlc / libvlc_media_player.h
1 /*****************************************************************************
2  * libvlc_media_player.h:  libvlc_media_player external API
3  *****************************************************************************
4  * Copyright (C) 1998-2010 the VideoLAN team
5  * $Id$
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  *          Jean-Paul Saman <jpsaman@videolan.org>
9  *          Pierre d'Herbemont <pdherbemont@videolan.org>
10  *
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.
15  *
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.
20  *
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  *****************************************************************************/
25
26 /**
27  * \file
28  * This file defines libvlc_media_player external API
29  */
30
31 #ifndef VLC_LIBVLC_MEDIA_PLAYER_H
32 #define VLC_LIBVLC_MEDIA_PLAYER_H 1
33
34 # ifdef __cplusplus
35 extern "C" {
36 # endif
37
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  * @{
45  */
46
47 typedef struct libvlc_media_player_t libvlc_media_player_t;
48
49 /**
50  * Description for video, audio tracks and subtitles. It contains
51  * id, name (description string) and pointer to next record.
52  */
53 typedef struct libvlc_track_description_t
54 {
55     int   i_id;
56     char *psz_name;
57     struct libvlc_track_description_t *p_next;
58
59 } libvlc_track_description_t;
60
61 /**
62  * Description for audio output. It contains
63  * name, description and pointer to next record.
64  */
65 typedef struct libvlc_audio_output_t
66 {
67     char *psz_name;
68     char *psz_description;
69     struct libvlc_audio_output_t *p_next;
70
71 } libvlc_audio_output_t;
72
73 /**
74  * Rectangle type for video geometry
75  */
76 typedef struct libvlc_rectangle_t
77 {
78     int top, left;
79     int bottom, right;
80 } libvlc_rectangle_t;
81
82 /**
83  * Marq options definition
84  */
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;
97
98 /**
99  * Create an empty Media Player object
100  *
101  * \param p_libvlc_instance the libvlc instance in which the Media Player
102  *        should be created.
103  * \return a new media player object, or NULL on error.
104  */
105 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t *p_libvlc_instance );
106
107 /**
108  * Create a Media Player object from a Media
109  *
110  * \param p_md the media. Afterwards the p_md can be safely
111  *        destroyed.
112  * \return a new media player object, or NULL on error.
113  */
114 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new_from_media( libvlc_media_t *p_md );
115
116 /**
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.
122  *
123  * \param p_mi the Media Player to free
124  */
125 VLC_PUBLIC_API void libvlc_media_player_release( libvlc_media_player_t *p_mi );
126
127 /**
128  * Retain a reference to a media player object. Use
129  * libvlc_media_player_release() to decrement reference count.
130  *
131  * \param p_mi media player object
132  */
133 VLC_PUBLIC_API void libvlc_media_player_retain( libvlc_media_player_t *p_mi );
134
135 /**
136  * Set the media that will be used by the media_player. If any,
137  * previous md will be released.
138  *
139  * \param p_mi the Media Player
140  * \param p_md the Media. Afterwards the p_md can be safely
141  *        destroyed.
142  */
143 VLC_PUBLIC_API void libvlc_media_player_set_media( libvlc_media_player_t *p_mi,
144                                                    libvlc_media_t *p_md );
145
146 /**
147  * Get the media used by the media_player.
148  *
149  * \param p_mi the Media Player
150  * \return the media associated with p_mi, or NULL if no
151  *         media is associated
152  */
153 VLC_PUBLIC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t *p_mi );
154
155 /**
156  * Get the Event Manager from which the media player send event.
157  *
158  * \param p_mi the Media Player
159  * \return the event manager associated with p_mi
160  */
161 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *p_mi );
162
163 /**
164  * is_playing
165  *
166  * \param p_mi the Media Player
167  * \return 1 if the media player is playing, 0 otherwise
168  */
169 VLC_PUBLIC_API int libvlc_media_player_is_playing ( libvlc_media_player_t *p_mi );
170
171 /**
172  * Play
173  *
174  * \param p_mi the Media Player
175  * \return 0 if playback started (and was already started), or -1 on error.
176  */
177 VLC_PUBLIC_API int libvlc_media_player_play ( libvlc_media_player_t *p_mi );
178
179 /**
180  * Toggle pause (no effect if there is no media)
181  *
182  * \param p_mi the Media Player
183  */
184 VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *p_mi );
185
186 /**
187  * Stop (no effect if there is no media)
188  *
189  * \param p_mi the Media Player
190  */
191 VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *p_mi );
192
193 /**
194  * Set the NSView handler where the media player should render its video output.
195  *
196  * The object minimal_macosx expects is of kind NSObject and should
197  * respect the protocol:
198  *
199  * @begincode
200  * \@protocol VLCOpenGLVideoViewEmbedding <NSObject>
201  * - (void)addVoutSubview:(NSView *)view;
202  * - (void)removeVoutSubview:(NSView *)view;
203  * \@end
204  * @endcode
205  *
206  * You can find a live example in VLCVideoView in VLCKit.framework.
207  *
208  * \param p_mi the Media Player
209  * \param drawable the NSView handler
210  */
211 VLC_PUBLIC_API void libvlc_media_player_set_nsobject ( libvlc_media_player_t *p_mi, void * drawable );
212
213 /**
214  * Get the NSView handler previously set with libvlc_media_player_set_nsobject().
215  *
216  * \param p_mi the Media Player
217  * \return the NSView handler or 0 if none where set
218  */
219 VLC_PUBLIC_API void * libvlc_media_player_get_nsobject ( libvlc_media_player_t *p_mi );
220
221 /**
222  * Set the agl handler where the media player should render its video output.
223  *
224  * \param p_mi the Media Player
225  * \param drawable the agl handler
226  */
227 VLC_PUBLIC_API void libvlc_media_player_set_agl ( libvlc_media_player_t *p_mi, uint32_t drawable );
228
229 /**
230  * Get the agl handler previously set with libvlc_media_player_set_agl().
231  *
232  * \param p_mi the Media Player
233  * \return the agl handler or 0 if none where set
234  */
235 VLC_PUBLIC_API uint32_t libvlc_media_player_get_agl ( libvlc_media_player_t *p_mi );
236
237 /**
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
240  * no effects.
241  *
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
245  * with.
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.
249  *
250  * \param p_mi the Media Player
251  * \param drawable the ID of the X window
252  */
253 VLC_PUBLIC_API void libvlc_media_player_set_xwindow ( libvlc_media_player_t *p_mi, uint32_t drawable );
254
255 /**
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
259  * audio-only input).
260  *
261  * \param p_mi the Media Player
262  * \return an X window ID, or 0 if none where set.
263  */
264 VLC_PUBLIC_API uint32_t libvlc_media_player_get_xwindow ( libvlc_media_player_t *p_mi );
265
266 /**
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.
270  *
271  * \param p_mi the Media Player
272  * \param drawable windows handle of the drawable
273  */
274 VLC_PUBLIC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi, void *drawable );
275
276 /**
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.
280  *
281  * \param p_mi the Media Player
282  * \return a window handle or NULL if there are none.
283  */
284 VLC_PUBLIC_API void *libvlc_media_player_get_hwnd ( libvlc_media_player_t *p_mi );
285
286
287
288 /** \bug This might go away ... to be replaced by a broader system */
289
290 /**
291  * Get the current movie length (in ms).
292  *
293  * \param p_mi the Media Player
294  * \return the movie length (in ms), or -1 if there is no media.
295  */
296 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_length( libvlc_media_player_t *p_mi );
297
298 /**
299  * Get the current movie time (in ms).
300  *
301  * \param p_mi the Media Player
302  * \return the movie time (in ms), or -1 if there is no media.
303  */
304 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_time( libvlc_media_player_t *p_mi );
305
306 /**
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.
309  *
310  * \param p_mi the Media Player
311  * \param i_time the movie time (in ms).
312  */
313 VLC_PUBLIC_API void libvlc_media_player_set_time( libvlc_media_player_t *p_mi, libvlc_time_t i_time );
314
315 /**
316  * Get movie position.
317  *
318  * \param p_mi the Media Player
319  * \return movie position, or -1. in case of error
320  */
321 VLC_PUBLIC_API float libvlc_media_player_get_position( libvlc_media_player_t *p_mi );
322
323 /**
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.
326  *
327  * \param p_mi the Media Player
328  * \param f_pos the position
329  */
330 VLC_PUBLIC_API void libvlc_media_player_set_position( libvlc_media_player_t *p_mi, float f_pos );
331
332 /**
333  * Set movie chapter (if applicable).
334  *
335  * \param p_mi the Media Player
336  * \param i_chapter chapter number to play
337  */
338 VLC_PUBLIC_API void libvlc_media_player_set_chapter( libvlc_media_player_t *p_mi, int i_chapter );
339
340 /**
341  * Get movie chapter.
342  *
343  * \param p_mi the Media Player
344  * \return chapter number currently playing, or -1 if there is no media.
345  */
346 VLC_PUBLIC_API int libvlc_media_player_get_chapter( libvlc_media_player_t *p_mi );
347
348 /**
349  * Get movie chapter count
350  *
351  * \param p_mi the Media Player
352  * \return number of chapters in movie, or -1.
353  */
354 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count( libvlc_media_player_t *p_mi );
355
356 /**
357  * Is the player able to play
358  *
359  * \param p_mi the Media Player
360  * \return boolean
361  */
362 VLC_PUBLIC_API int libvlc_media_player_will_play( libvlc_media_player_t *p_mi );
363
364 /**
365  * Get title chapter count
366  *
367  * \param p_mi the Media Player
368  * \param i_title title
369  * \return number of chapters in title, or -1
370  */
371 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count_for_title(
372                        libvlc_media_player_t *p_mi, int i_title );
373
374 /**
375  * Set movie title
376  *
377  * \param p_mi the Media Player
378  * \param i_title title number to play
379  */
380 VLC_PUBLIC_API void libvlc_media_player_set_title( libvlc_media_player_t *p_mi, int i_title );
381
382 /**
383  * Get movie title
384  *
385  * \param p_mi the Media Player
386  * \return title number currently playing, or -1
387  */
388 VLC_PUBLIC_API int libvlc_media_player_get_title( libvlc_media_player_t *p_mi );
389
390 /**
391  * Get movie title count
392  *
393  * \param p_mi the Media Player
394  * \return title number count, or -1
395  */
396 VLC_PUBLIC_API int libvlc_media_player_get_title_count( libvlc_media_player_t *p_mi );
397
398 /**
399  * Set previous chapter (if applicable)
400  *
401  * \param p_mi the Media Player
402  */
403 VLC_PUBLIC_API void libvlc_media_player_previous_chapter( libvlc_media_player_t *p_mi );
404
405 /**
406  * Set next chapter (if applicable)
407  *
408  * \param p_mi the Media Player
409  */
410 VLC_PUBLIC_API void libvlc_media_player_next_chapter( libvlc_media_player_t *p_mi );
411
412 /**
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.
416  *
417  * \param p_mi the Media Player
418  * \return movie play rate
419  */
420 VLC_PUBLIC_API float libvlc_media_player_get_rate( libvlc_media_player_t *p_mi );
421
422 /**
423  * Set movie play rate
424  *
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)
429  */
430 VLC_PUBLIC_API int libvlc_media_player_set_rate( libvlc_media_player_t *p_mi, float rate );
431
432 /**
433  * Get current movie state
434  *
435  * \param p_mi the Media Player
436  * \return the current state of the media player (playing, paused, ...) \see libvlc_state_t
437  */
438 VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *p_mi );
439
440 /**
441  * Get movie fps rate
442  *
443  * \param p_mi the Media Player
444  * \return frames per second (fps) for this playing movie, or 0 if unspecified
445  */
446 VLC_PUBLIC_API float libvlc_media_player_get_fps( libvlc_media_player_t *p_mi );
447
448 /** end bug */
449
450 /**
451  * How many video outputs does this media player have?
452  *
453  * \param p_mi the media player
454  * \return the number of video outputs
455  */
456 VLC_PUBLIC_API unsigned libvlc_media_player_has_vout( libvlc_media_player_t *p_mi );
457
458 /**
459  * Is this media player seekable?
460  *
461  * \param p_mi the media player
462  * \return true if the media player can seek
463  */
464 VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi );
465
466 /**
467  * Can this media player be paused?
468  *
469  * \param p_mi the media player
470  * \return true if the media player can pause
471  */
472 VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi );
473
474
475 /**
476  * Display the next frame (if supported)
477  *
478  * \param p_mi the media player
479  */
480 VLC_PUBLIC_API void libvlc_media_player_next_frame( libvlc_media_player_t *p_mi );
481
482
483
484 /**
485  * Release (free) libvlc_track_description_t
486  *
487  * \param p_track_description the structure to release
488  */
489 VLC_PUBLIC_API void libvlc_track_description_release( libvlc_track_description_t *p_track_description );
490
491 /** \defgroup libvlc_video LibVLC video controls
492  * @{
493  */
494
495 /**
496  * Toggle fullscreen status on non-embedded video outputs.
497  *
498  * @warning The same limitations applies to this function
499  * as to libvlc_set_fullscreen().
500  *
501  * \param p_mi the media player
502  */
503 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *p_mi );
504
505 /**
506  * Enable or disable fullscreen.
507  *
508  * @warning With most window managers, only a top-level windows can be in
509  * full-screen mode. Hence, this function will not operate properly if
510  * libvlc_media_player_set_xid() was used to embed the video in a non-top-level
511  * window. In that case, the embedding window must be reparented to the root
512  * window <b>before</b> fullscreen mode is enabled. You will want to reparent
513  * it back to its normal parent when disabling fullscreen.
514  *
515  * \param p_mi the media player
516  * \param b_fullscreen boolean for fullscreen status
517  */
518 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *p_mi, int b_fullscreen );
519
520 /**
521  * Get current fullscreen status.
522  *
523  * \param p_mi the media player
524  * \return the fullscreen status (boolean)
525  */
526 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t *p_mi );
527
528 /**
529  * Enable or disable key press events handling, according to the LibVLC hotkeys
530  * configuration. By default and for historical reasons, keyboard events are
531  * handled by the LibVLC video widget.
532  *
533  * \note On X11, there can be only one subscriber for key press and mouse
534  * click events per window. If your application has subscribed to those events
535  * for the X window ID of the video widget, then LibVLC will not be able to
536  * handle key presses and mouse clicks in any case.
537  *
538  * \warning This function is only implemented for X11 at the moment.
539  *
540  * \param p_mi the media player
541  * \param on true to handle key press events, false to ignore them.
542  */
543 VLC_PUBLIC_API
544 void libvlc_video_set_key_input( libvlc_media_player_t *p_mi, unsigned on );
545
546 /**
547  * Enable or disable mouse click events handling. By default, those events are
548  * handled. This is needed for DVD menus to work, as well as a few video
549  * filters such as "puzzle".
550  *
551  * \note See also libvlc_video_set_key_input().
552  *
553  * \warning This function is only implemented for X11 at the moment.
554  *
555  * \param p_mi the media player
556  * \param on true to handle mouse click events, false to ignore them.
557  */
558 VLC_PUBLIC_API
559 void libvlc_video_set_mouse_input( libvlc_media_player_t *p_mi, unsigned on );
560
561 /**
562  * Get the pixel dimensions of a video.
563  *
564  * \param p_mi media player
565  * \param num number of the video (starting from, and most commonly 0)
566  * \param px pointer to get the pixel width [OUT]
567  * \param py pointer to get the pixel height [OUT]
568  * \return 0 on success, -1 if the specified video does not exist
569  */
570 VLC_PUBLIC_API
571 int libvlc_video_get_size( libvlc_media_player_t *p_mi, unsigned num,
572                            unsigned *px, unsigned *py );
573
574 /**
575  * Get current video height.
576  * You should use libvlc_video_get_size() instead.
577  *
578  * \param p_mi the media player
579  * \return the video pixel height or 0 if not applicable
580  */
581 VLC_DEPRECATED_API
582 int libvlc_video_get_height( libvlc_media_player_t *p_mi );
583
584 /**
585  * Get current video width.
586  * You should use libvlc_video_get_size() instead.
587  *
588  * \param p_mi the media player
589  * \return the video pixel width or 0 if not applicable
590  */
591 VLC_DEPRECATED_API
592 int libvlc_video_get_width( libvlc_media_player_t *p_mi );
593
594 /**
595  * Get the mouse pointer coordinates over a video.
596  * Coordinates are expressed in terms of the decoded video resolution,
597  * <b>not</b> in terms of pixels on the screen/viewport (to get the latter,
598  * you can query your windowing system directly).
599  *
600  * Either of the coordinates may be negative or larger than the corresponding
601  * dimension of the video, if the cursor is outside the rendering area.
602  *
603  * @warning The coordinates may be out-of-date if the pointer is not located
604  * on the video rendering area. LibVLC does not track the pointer if it is
605  * outside of the video widget.
606  *
607  * @note LibVLC does not support multiple pointers (it does of course support
608  * multiple input devices sharing the same pointer) at the moment.
609  *
610  * \param p_mi media player
611  * \param num number of the video (starting from, and most commonly 0)
612  * \param px pointer to get the abscissa [OUT]
613  * \param py pointer to get the ordinate [OUT]
614  * \return 0 on success, -1 if the specified video does not exist
615  */
616 VLC_PUBLIC_API
617 int libvlc_video_get_cursor( libvlc_media_player_t *p_mi, unsigned num,
618                              int *px, int *py );
619
620 /**
621  * Get the current video scaling factor.
622  * See also libvlc_video_set_scale().
623  *
624  * \param p_mi the media player
625  * \return the currently configured zoom factor, or 0. if the video is set
626  * to fit to the output window/drawable automatically.
627  */
628 VLC_PUBLIC_API float libvlc_video_get_scale( libvlc_media_player_t *p_mi );
629
630 /**
631  * Set the video scaling factor. That is the ratio of the number of pixels on
632  * screen to the number of pixels in the original decoded video in each
633  * dimension. Zero is a special value; it will adjust the video to the output
634  * window/drawable (in windowed mode) or the entire screen.
635  *
636  * Note that not all video outputs support scaling.
637  *
638  * \param p_mi the media player
639  * \param f_factor the scaling factor, or zero
640  */
641 VLC_PUBLIC_API void libvlc_video_set_scale( libvlc_media_player_t *p_mi, float f_factor );
642
643 /**
644  * Get current video aspect ratio.
645  *
646  * \param p_mi the media player
647  * \return the video aspect ratio or NULL if unspecified
648  * (the result must be released with free()).
649  */
650 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *p_mi );
651
652 /**
653  * Set new video aspect ratio.
654  *
655  * \param p_mi the media player
656  * \param psz_aspect new video aspect-ratio or NULL to reset to default
657  * \note Invalid aspect ratios are ignored.
658  */
659 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *p_mi, const char *psz_aspect );
660
661 /**
662  * Get current video subtitle.
663  *
664  * \param p_mi the media player
665  * \return the video subtitle selected, or -1 if none
666  */
667 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *p_mi );
668
669 /**
670  * Get the number of available video subtitles.
671  *
672  * \param p_mi the media player
673  * \return the number of available video subtitles
674  */
675 VLC_PUBLIC_API int libvlc_video_get_spu_count( libvlc_media_player_t *p_mi );
676
677 /**
678  * Get the description of available video subtitles.
679  *
680  * \param p_mi the media player
681  * \return list containing description of available video subtitles
682  */
683 VLC_PUBLIC_API libvlc_track_description_t *
684         libvlc_video_get_spu_description( libvlc_media_player_t *p_mi );
685
686 /**
687  * Set new video subtitle.
688  *
689  * \param p_mi the media player
690  * \param i_spu new video subtitle to select
691  * \return 0 on success, -1 if out of range
692  */
693 VLC_PUBLIC_API int libvlc_video_set_spu( libvlc_media_player_t *p_mi, unsigned i_spu );
694
695 /**
696  * Set new video subtitle file.
697  *
698  * \param p_mi the media player
699  * \param psz_subtitle new video subtitle file
700  * \return the success status (boolean)
701  */
702 VLC_PUBLIC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *p_mi, const char *psz_subtitle );
703
704 /**
705  * Get the description of available titles.
706  *
707  * \param p_mi the media player
708  * \return list containing description of available titles
709  */
710 VLC_PUBLIC_API libvlc_track_description_t *
711         libvlc_video_get_title_description( libvlc_media_player_t *p_mi );
712
713 /**
714  * Get the description of available chapters for specific title.
715  *
716  * \param p_mi the media player
717  * \param i_title selected title
718  * \return list containing description of available chapter for title i_title
719  */
720 VLC_PUBLIC_API libvlc_track_description_t *
721         libvlc_video_get_chapter_description( libvlc_media_player_t *p_mi, int i_title );
722
723 /**
724  * Get current crop filter geometry.
725  *
726  * \param p_mi the media player
727  * \return the crop filter geometry or NULL if unset
728  */
729 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *p_mi );
730
731 /**
732  * Set new crop filter geometry.
733  *
734  * \param p_mi the media player
735  * \param psz_geometry new crop filter geometry (NULL to unset)
736  */
737 VLC_PUBLIC_API
738 void libvlc_video_set_crop_geometry( libvlc_media_player_t *p_mi, const char *psz_geometry );
739
740 /**
741  * Get current teletext page requested.
742  *
743  * \param p_mi the media player
744  * \return the current teletext page requested.
745  */
746 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t *p_mi );
747
748 /**
749  * Set new teletext page to retrieve.
750  *
751  * \param p_mi the media player
752  * \param i_page teletex page number requested
753  */
754 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *p_mi, int i_page );
755
756 /**
757  * Toggle teletext transparent status on video output.
758  *
759  * \param p_mi the media player
760  */
761 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *p_mi );
762
763 /**
764  * Get number of available video tracks.
765  *
766  * \param p_mi media player
767  * \return the number of available video tracks (int)
768  */
769 VLC_PUBLIC_API int libvlc_video_get_track_count( libvlc_media_player_t *p_mi );
770
771 /**
772  * Get the description of available video tracks.
773  *
774  * \param p_mi media player
775  * \return list with description of available video tracks, or NULL on error
776  */
777 VLC_PUBLIC_API libvlc_track_description_t *
778         libvlc_video_get_track_description( libvlc_media_player_t *p_mi );
779
780 /**
781  * Get current video track.
782  *
783  * \param p_mi media player
784  * \return the video track (int) or -1 if none
785  */
786 VLC_PUBLIC_API int libvlc_video_get_track( libvlc_media_player_t *p_mi );
787
788 /**
789  * Set video track.
790  *
791  * \param p_mi media player
792  * \param i_track the track (int)
793  * \return 0 on success, -1 if out of range
794  */
795 VLC_PUBLIC_API
796 int libvlc_video_set_track( libvlc_media_player_t *p_mi, int i_track );
797
798 /**
799  * Take a snapshot of the current video window.
800  *
801  * If i_width AND i_height is 0, original size is used.
802  * If i_width XOR i_height is 0, original aspect-ratio is preserved.
803  *
804  * \param p_mi media player instance
805  * \param num number of video output (typically 0 for the first/only one)
806  * \param psz_filepath the path where to save the screenshot to
807  * \param i_width the snapshot's width
808  * \param i_height the snapshot's height
809  * \return 0 on success, -1 if the video was not found
810  */
811 VLC_PUBLIC_API
812 int libvlc_video_take_snapshot( libvlc_media_player_t *p_mi, unsigned num,
813                                 const char *psz_filepath, unsigned int i_width,
814                                 unsigned int i_height );
815
816 /**
817  * Enable or disable deinterlace filter
818  *
819  * \param p_mi libvlc media player
820  * \param psz_mode type of deinterlace filter, NULL to disable
821  */
822 VLC_PUBLIC_API void libvlc_video_set_deinterlace( libvlc_media_player_t *p_mi,
823                                                   const char *psz_mode );
824
825 /**
826  * Get an integer marquee option value
827  *
828  * \param p_mi libvlc media player
829  * \param option marq option to get \see libvlc_video_marquee_int_option_t
830  */
831 VLC_PUBLIC_API int libvlc_video_get_marquee_int( libvlc_media_player_t *p_mi,
832                                                  unsigned option );
833
834 /**
835  * Get a string marquee option value
836  *
837  * \param p_mi libvlc media player
838  * \param option marq option to get \see libvlc_video_marquee_string_option_t
839  */
840 VLC_PUBLIC_API char *libvlc_video_get_marquee_string( libvlc_media_player_t *p_mi,
841                                                       unsigned option );
842
843 /**
844  * Enable, disable or set an integer marquee option
845  *
846  * Setting libvlc_marquee_Enable has the side effect of enabling (arg !0)
847  * or disabling (arg 0) the marq filter.
848  *
849  * \param p_mi libvlc media player
850  * \param option marq option to set \see libvlc_video_marquee_int_option_t
851  * \param i_val marq option value
852  */
853 VLC_PUBLIC_API void libvlc_video_set_marquee_int( libvlc_media_player_t *p_mi,
854                                                   unsigned option, int i_val );
855
856 /**
857  * Set a marquee string option
858  *
859  * \param p_mi libvlc media player
860  * \param option marq option to set \see libvlc_video_marquee_string_option_t
861  * \param psz_text marq option value
862  */
863 VLC_PUBLIC_API void libvlc_video_set_marquee_string( libvlc_media_player_t *p_mi,
864                                                      unsigned option, const char *psz_text );
865
866 /** option values for libvlc_video_{get,set}_logo_{int,string} */
867 enum libvlc_video_logo_option_t {
868     libvlc_logo_enable,
869     libvlc_logo_file,           /**< string argument, "file,d,t;file,d,t;..." */
870     libvlc_logo_x,
871     libvlc_logo_y,
872     libvlc_logo_delay,
873     libvlc_logo_repeat,
874     libvlc_logo_opacity,
875     libvlc_logo_position,
876 };
877
878 /**
879  * Get integer logo option.
880  *
881  * \param p_mi libvlc media player instance
882  * \param option logo option to get, values of libvlc_video_logo_option_t
883  */
884 VLC_PUBLIC_API int libvlc_video_get_logo_int( libvlc_media_player_t *p_mi,
885                                               unsigned option );
886
887 /**
888  * Set logo option as integer. Options that take a different type value
889  * are ignored.
890  * Passing libvlc_logo_enable as option value has the side effect of
891  * starting (arg !0) or stopping (arg 0) the logo filter.
892  *
893  * \param p_mi libvlc media player instance
894  * \param option logo option to set, values of libvlc_video_logo_option_t
895  * \param value logo option value
896  */
897 VLC_PUBLIC_API void libvlc_video_set_logo_int( libvlc_media_player_t *p_mi,
898                                                unsigned option, int value );
899
900 /**
901  * Set logo option as string. Options that take a different type value
902  * are ignored.
903  *
904  * \param p_mi libvlc media player instance
905  * \param option logo option to set, values of libvlc_video_logo_option_t
906  * \param psz_value logo option value
907  */
908 VLC_PUBLIC_API void libvlc_video_set_logo_string( libvlc_media_player_t *p_mi,
909                                       unsigned option, const char *psz_value );
910
911
912 /** @} video */
913
914 /** \defgroup libvlc_audio LibVLC audio controls
915  * @{
916  */
917
918 /**
919  * Audio device types
920  */
921 typedef enum libvlc_audio_output_device_types_t {
922     libvlc_AudioOutputDevice_Error  = -1,
923     libvlc_AudioOutputDevice_Mono   =  1,
924     libvlc_AudioOutputDevice_Stereo =  2,
925     libvlc_AudioOutputDevice_2F2R   =  4,
926     libvlc_AudioOutputDevice_3F2R   =  5,
927     libvlc_AudioOutputDevice_5_1    =  6,
928     libvlc_AudioOutputDevice_6_1    =  7,
929     libvlc_AudioOutputDevice_7_1    =  8,
930     libvlc_AudioOutputDevice_SPDIF  = 10
931 } libvlc_audio_output_device_types_t;
932
933 /**
934  * Audio channels
935  */
936 typedef enum libvlc_audio_output_channel_t {
937     libvlc_AudioChannel_Error   = -1,
938     libvlc_AudioChannel_Stereo  =  1,
939     libvlc_AudioChannel_RStereo =  2,
940     libvlc_AudioChannel_Left    =  3,
941     libvlc_AudioChannel_Right   =  4,
942     libvlc_AudioChannel_Dolbys  =  5
943 } libvlc_audio_output_channel_t;
944
945
946 /**
947  * Get the list of available audio outputs
948  *
949  * \param p_instance libvlc instance
950  * \return list of available audio outputs. It must be freed it with
951 *          \see libvlc_audio_output_list_release \see libvlc_audio_output_t .
952  *         In case of error, NULL is returned.
953  */
954 VLC_PUBLIC_API libvlc_audio_output_t *
955         libvlc_audio_output_list_get( libvlc_instance_t *p_instance );
956
957 /**
958  * Free the list of available audio outputs
959  *
960  * \param p_list list with audio outputs for release
961  */
962 VLC_PUBLIC_API void libvlc_audio_output_list_release( libvlc_audio_output_t *p_list );
963
964 /**
965  * Set the audio output.
966  * Change will be applied after stop and play.
967  *
968  * \param p_mi media player
969  * \param psz_name name of audio output,
970  *               use psz_name of \see libvlc_audio_output_t
971  * \return true if function succeded
972  */
973 VLC_PUBLIC_API int libvlc_audio_output_set( libvlc_media_player_t *p_mi,
974                                             const char *psz_name );
975
976 /**
977  * Get count of devices for audio output, these devices are hardware oriented
978  * like analor or digital output of sound card
979  *
980  * \param p_instance libvlc instance
981  * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
982  * \return number of devices
983  */
984 VLC_PUBLIC_API int libvlc_audio_output_device_count( libvlc_instance_t *p_instance,
985                                                      const char *psz_audio_output );
986
987 /**
988  * Get long name of device, if not available short name given
989  *
990  * \param p_instance libvlc instance
991  * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
992  * \param i_device device index
993  * \return long name of device
994  */
995 VLC_PUBLIC_API char * libvlc_audio_output_device_longname( libvlc_instance_t *p_instance,
996                                                            const char *psz_audio_output,
997                                                            int i_device );
998
999 /**
1000  * Get id name of device
1001  *
1002  * \param p_instance libvlc instance
1003  * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1004  * \param i_device device index
1005  * \return id name of device, use for setting device, need to be free after use
1006  */
1007 VLC_PUBLIC_API char * libvlc_audio_output_device_id( libvlc_instance_t *p_instance,
1008                                                      const char *psz_audio_output,
1009                                                      int i_device );
1010
1011 /**
1012  * Set audio output device. Changes are only effective after stop and play.
1013  *
1014  * \param p_mi media player
1015  * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1016  * \param psz_device_id device
1017  */
1018 VLC_PUBLIC_API void libvlc_audio_output_device_set( libvlc_media_player_t *p_mi,
1019                                                     const char *psz_audio_output,
1020                                                     const char *psz_device_id );
1021
1022 /**
1023  * Get current audio device type. Device type describes something like
1024  * character of output sound - stereo sound, 2.1, 5.1 etc
1025  *
1026  * \param p_mi media player
1027  * \return the audio devices type \see libvlc_audio_output_device_types_t
1028  */
1029 VLC_PUBLIC_API int libvlc_audio_output_get_device_type( libvlc_media_player_t *p_mi );
1030
1031 /**
1032  * Set current audio device type.
1033  *
1034  * \param p_mi vlc instance
1035  * \param device_type the audio device type,
1036           according to \see libvlc_audio_output_device_types_t
1037  */
1038 VLC_PUBLIC_API void libvlc_audio_output_set_device_type( libvlc_media_player_t *p_mi,
1039                                                          int device_type );
1040
1041
1042 /**
1043  * Toggle mute status.
1044  *
1045  * \param p_mi media player
1046  */
1047 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_media_player_t *p_mi );
1048
1049 /**
1050  * Get current mute status.
1051  *
1052  * \param p_mi media player
1053  * \return the mute status (boolean)
1054  */
1055 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_media_player_t *p_mi );
1056
1057 /**
1058  * Set mute status.
1059  *
1060  * \param p_mi media player
1061  * \param status If status is true then mute, otherwise unmute
1062  */
1063 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_media_player_t *p_mi, int status );
1064
1065 /**
1066  * Get current audio level.
1067  *
1068  * \param p_mi media player
1069  * \return the audio level (int)
1070  */
1071 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_media_player_t *p_mi );
1072
1073 /**
1074  * Set current audio level.
1075  *
1076  * \param p_mi media player
1077  * \param i_volume the volume (int)
1078  * \return 0 if the volume was set, -1 if it was out of range
1079  */
1080 VLC_PUBLIC_API int libvlc_audio_set_volume( libvlc_media_player_t *p_mi, int i_volume );
1081
1082 /**
1083  * Get number of available audio tracks.
1084  *
1085  * \param p_mi media player
1086  * \return the number of available audio tracks (int), or -1 if unavailable
1087  */
1088 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *p_mi );
1089
1090 /**
1091  * Get the description of available audio tracks.
1092  *
1093  * \param p_mi media player
1094  * \return list with description of available audio tracks, or NULL
1095  */
1096 VLC_PUBLIC_API libvlc_track_description_t *
1097         libvlc_audio_get_track_description( libvlc_media_player_t *p_mi );
1098
1099 /**
1100  * Get current audio track.
1101  *
1102  * \param p_mi media player
1103  * \return the audio track (int), or -1 if none.
1104  */
1105 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *p_mi );
1106
1107 /**
1108  * Set current audio track.
1109  *
1110  * \param p_mi media player
1111  * \param i_track the track (int)
1112  * \return 0 on success, -1 on error
1113  */
1114 VLC_PUBLIC_API int libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track );
1115
1116 /**
1117  * Get current audio channel.
1118  *
1119  * \param p_mi media player
1120  * \return the audio channel \see libvlc_audio_output_channel_t
1121  */
1122 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_media_player_t *p_mi );
1123
1124 /**
1125  * Set current audio channel.
1126  *
1127  * \param p_mi media player
1128  * \param channel the audio channel, \see libvlc_audio_output_channel_t
1129  * \return 0 on success, -1 on error
1130  */
1131 VLC_PUBLIC_API int libvlc_audio_set_channel( libvlc_media_player_t *p_mi, int channel );
1132
1133 /** @} audio */
1134
1135 /** @} media_player */
1136
1137 # ifdef __cplusplus
1138 }
1139 # endif
1140
1141 #endif /* VLC_LIBVLC_MEDIA_PLAYER_H */