]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_media_player.h
Rename VLC_{PUBLIC,DEPRECATED}_API to LIBVLC_{API,DEPRECATED}
[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  * Navigation mode
100  */
101 typedef enum libvlc_navigate_mode_t
102 {
103     libvlc_navigate_activate = 0,
104     libvlc_navigate_up,
105     libvlc_navigate_down,
106     libvlc_navigate_left,
107     libvlc_navigate_right
108 } libvlc_navigate_mode_t;
109
110 /**
111  * Create an empty Media Player object
112  *
113  * \param p_libvlc_instance the libvlc instance in which the Media Player
114  *        should be created.
115  * \return a new media player object, or NULL on error.
116  */
117 LIBVLC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t *p_libvlc_instance );
118
119 /**
120  * Create a Media Player object from a Media
121  *
122  * \param p_md the media. Afterwards the p_md can be safely
123  *        destroyed.
124  * \return a new media player object, or NULL on error.
125  */
126 LIBVLC_API libvlc_media_player_t * libvlc_media_player_new_from_media( libvlc_media_t *p_md );
127
128 /**
129  * Release a media_player after use
130  * Decrement the reference count of a media player object. If the
131  * reference count is 0, then libvlc_media_player_release() will
132  * release the media player object. If the media player object
133  * has been released, then it should not be used again.
134  *
135  * \param p_mi the Media Player to free
136  */
137 LIBVLC_API void libvlc_media_player_release( libvlc_media_player_t *p_mi );
138
139 /**
140  * Retain a reference to a media player object. Use
141  * libvlc_media_player_release() to decrement reference count.
142  *
143  * \param p_mi media player object
144  */
145 LIBVLC_API void libvlc_media_player_retain( libvlc_media_player_t *p_mi );
146
147 /**
148  * Set the media that will be used by the media_player. If any,
149  * previous md will be released.
150  *
151  * \param p_mi the Media Player
152  * \param p_md the Media. Afterwards the p_md can be safely
153  *        destroyed.
154  */
155 LIBVLC_API void libvlc_media_player_set_media( libvlc_media_player_t *p_mi,
156                                                    libvlc_media_t *p_md );
157
158 /**
159  * Get the media used by the media_player.
160  *
161  * \param p_mi the Media Player
162  * \return the media associated with p_mi, or NULL if no
163  *         media is associated
164  */
165 LIBVLC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t *p_mi );
166
167 /**
168  * Get the Event Manager from which the media player send event.
169  *
170  * \param p_mi the Media Player
171  * \return the event manager associated with p_mi
172  */
173 LIBVLC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *p_mi );
174
175 /**
176  * is_playing
177  *
178  * \param p_mi the Media Player
179  * \return 1 if the media player is playing, 0 otherwise
180  */
181 LIBVLC_API int libvlc_media_player_is_playing ( libvlc_media_player_t *p_mi );
182
183 /**
184  * Play
185  *
186  * \param p_mi the Media Player
187  * \return 0 if playback started (and was already started), or -1 on error.
188  */
189 LIBVLC_API int libvlc_media_player_play ( libvlc_media_player_t *p_mi );
190
191 /**
192  * Pause or resume (no effect if there is no media)
193  *
194  * \param mp the Media Player
195  * \param do_pause play/resume if zero, pause if non-zero
196  * \version LibVLC 1.1.1 or later
197  */
198 LIBVLC_API void libvlc_media_player_set_pause ( libvlc_media_player_t *mp,
199                                                     int do_pause );
200
201 /**
202  * Toggle pause (no effect if there is no media)
203  *
204  * \param p_mi the Media Player
205  */
206 LIBVLC_API void libvlc_media_player_pause ( libvlc_media_player_t *p_mi );
207
208 /**
209  * Stop (no effect if there is no media)
210  *
211  * \param p_mi the Media Player
212  */
213 LIBVLC_API void libvlc_media_player_stop ( libvlc_media_player_t *p_mi );
214
215 /**
216  * Callback prototype to allocate and lock a picture buffer.
217  *
218  * Whenever a new video frame needs to be decoded, the lock callback is
219  * invoked. Depending on the video chroma, one or three pixel planes of
220  * adequate dimensions must be returned via the second parameter. Those
221  * planes must be aligned on 32-bytes boundaries.
222  *
223  * \param opaque private pointer as passed to libvlc_video_set_callbacks() [IN]
224  * \param planes start address of the pixel planes (LibVLC allocates the array
225  *             of void pointers, this callback must initialize the array) [OUT]
226  * \return a private pointer for the display and unlock callbacks to identify
227  *         the picture buffers
228  */
229 typedef void *(*libvlc_video_lock_cb)(void *opaque, void **planes);
230
231 /**
232  * Callback prototype to unlock a picture buffer.
233  *
234  * When the video frame decoding is complete, the unlock callback is invoked.
235  * This callback might not be needed at all. It is only an indication that the
236  * application can now read the pixel values if it needs to.
237  *
238  * \warning A picture buffer is unlocked after the picture is decoded,
239  * but before the picture is displayed.
240  *
241  * \param opaque private pointer as passed to libvlc_video_set_callbacks() [IN]
242  * \param picture private pointer returned from the @ref libvlc_video_lock_cb
243  *                callback [IN]
244  * \param planes pixel planes as defined by the @ref libvlc_video_lock_cb
245  *               callback (this parameter is only for convenience) [IN]
246  */
247 typedef void (*libvlc_video_unlock_cb)(void *opaque, void *picture,
248                                        void *const *planes);
249
250 /**
251  * Callback prototype to display a picture.
252  *
253  * When the video frame needs to be shown, as determined by the media playback
254  * clock, the display callback is invoked.
255  *
256  * \param opaque private pointer as passed to libvlc_video_set_callbacks() [IN]
257  * \param picture private pointer returned from the @ref libvlc_video_lock_cb
258  *                callback [IN]
259  */
260 typedef void (*libvlc_video_display_cb)(void *opaque, void *picture);
261
262 /**
263  * Callback prototype to configure picture buffers format.
264  * This callback gets the format of the video as output by the video decoder
265  * and the chain of video filters (if any). It can opt to change any parameter
266  * as it needs. In that case, LibVLC will attempt to convert the video format
267  * (rescaling and chroma conversion) but these operations can be CPU intensive.
268  *
269  * \param opaque pointer to the private pointer passed to
270  *               libvlc_video_set_callbacks() [IN/OUT]
271  * \param chroma pointer to the 4 bytes video format identifier [IN/OUT]
272  * \param width pointer to the pixel width [IN/OUT]
273  * \param height pointer to the pixel height [IN/OUT]
274  * \param pitches table of scanline pitches in bytes for each pixel plane
275  *                (the table is allocated by LibVLC) [OUT]
276  * \param lines table of scanlines count for each plane [OUT]
277  * \return the number of picture buffers allocated, 0 indicates failure
278  *
279  * \note
280  * For each pixels plane, the scanline pitch must be bigger than or equal to
281  * the number of bytes per pixel multiplied by the pixel width.
282  * Similarly, the number of scanlines must be bigger than of equal to
283  * the pixel height.
284  * Furthermore, we recommend that pitches and lines be multiple of 32
285  * to not break assumption that might be made by various optimizations
286  * in the video decoders, video filters and/or video converters.
287  */
288 typedef unsigned (*libvlc_video_format_cb)(void **opaque, char *chroma,
289                                            unsigned *width, unsigned *height,
290                                            unsigned *pitches,
291                                            unsigned *lines);
292
293 /**
294  * Callback prototype to configure picture buffers format.
295  *
296  * \param opaque private pointer as passed to libvlc_video_set_callbacks()
297  *               (and possibly modified by @ref libvlc_video_format_cb) [IN]
298  */
299 typedef void (*libvlc_video_cleanup_cb)(void *opaque);
300
301
302 /**
303  * Set callbacks and private data to render decoded video to a custom area
304  * in memory.
305  * Use libvlc_video_set_format() or libvlc_video_set_format_callbacks()
306  * to configure the decoded format.
307  *
308  * \param mp the media player
309  * \param lock callback to lock video memory (must not be NULL)
310  * \param unlock callback to unlock video memory (or NULL if not needed)
311  * \param display callback to display video (or NULL if not needed)
312  * \param opaque private pointer for the three callbacks (as first parameter)
313  * \version LibVLC 1.1.1 or later
314  */
315 LIBVLC_API
316 void libvlc_video_set_callbacks( libvlc_media_player_t *mp,
317                                  libvlc_video_lock_cb lock,
318                                  libvlc_video_unlock_cb unlock,
319                                  libvlc_video_display_cb display,
320                                  void *opaque );
321
322 /**
323  * Set decoded video chroma and dimensions.
324  * This only works in combination with libvlc_video_set_callbacks(),
325  * and is mutually exclusive with libvlc_video_set_format_callbacks().
326  *
327  * \param mp the media player
328  * \param chroma a four-characters string identifying the chroma
329  *               (e.g. "RV32" or "YUYV")
330  * \param width pixel width
331  * \param height pixel height
332  * \param pitch line pitch (in bytes)
333  * \version LibVLC 1.1.1 or later
334  * \bug All pixel planes are expected to have the same pitch.
335  * To use the YCbCr color space with chrominance subsampling,
336  * consider using libvlc_video_set_format_callbacks() instead.
337  */
338 LIBVLC_API
339 void libvlc_video_set_format( libvlc_media_player_t *mp, const char *chroma,
340                               unsigned width, unsigned height,
341                               unsigned pitch );
342
343 /**
344  * Set decoded video chroma and dimensions. This only works in combination with
345  * libvlc_video_set_callbacks().
346  *
347  * \param mp the media player
348  * \param setup callback to select the video format (cannot be NULL)
349  * \param cleanup callback to release any allocated resources (or NULL)
350  * \version LibVLC 1.2.0 or later
351  */
352 LIBVLC_API
353 void libvlc_video_set_format_callbacks( libvlc_media_player_t *mp,
354                                         libvlc_video_format_cb setup,
355                                         libvlc_video_cleanup_cb cleanup );
356
357 /**
358  * Set the NSView handler where the media player should render its video output.
359  *
360  * Use the vout called "macosx".
361  *
362  * The drawable is an NSObject that follow the VLCOpenGLVideoViewEmbedding
363  * protocol:
364  *
365  * @begincode
366  * \@protocol VLCOpenGLVideoViewEmbedding <NSObject>
367  * - (void)addVoutSubview:(NSView *)view;
368  * - (void)removeVoutSubview:(NSView *)view;
369  * \@end
370  * @endcode
371  *
372  * Or it can be an NSView object.
373  *
374  * If you want to use it along with Qt4 see the QMacCocoaViewContainer. Then
375  * the following code should work:
376  * @begincode
377  * {
378  *     NSView *video = [[NSView alloc] init];
379  *     QMacCocoaViewContainer *container = new QMacCocoaViewContainer(video, parent);
380  *     libvlc_media_player_set_nsobject(mp, video);
381  *     [video release];
382  * }
383  * @endcode
384  *
385  * You can find a live example in VLCVideoView in VLCKit.framework.
386  *
387  * \param p_mi the Media Player
388  * \param drawable the drawable that is either an NSView or an object following
389  * the VLCOpenGLVideoViewEmbedding protocol.
390  */
391 LIBVLC_API void libvlc_media_player_set_nsobject ( libvlc_media_player_t *p_mi, void * drawable );
392
393 /**
394  * Get the NSView handler previously set with libvlc_media_player_set_nsobject().
395  *
396  * \param p_mi the Media Player
397  * \return the NSView handler or 0 if none where set
398  */
399 LIBVLC_API void * libvlc_media_player_get_nsobject ( libvlc_media_player_t *p_mi );
400
401 /**
402  * Set the agl handler where the media player should render its video output.
403  *
404  * \param p_mi the Media Player
405  * \param drawable the agl handler
406  */
407 LIBVLC_API void libvlc_media_player_set_agl ( libvlc_media_player_t *p_mi, uint32_t drawable );
408
409 /**
410  * Get the agl handler previously set with libvlc_media_player_set_agl().
411  *
412  * \param p_mi the Media Player
413  * \return the agl handler or 0 if none where set
414  */
415 LIBVLC_API uint32_t libvlc_media_player_get_agl ( libvlc_media_player_t *p_mi );
416
417 /**
418  * Set an X Window System drawable where the media player should render its
419  * video output. If LibVLC was built without X11 output support, then this has
420  * no effects.
421  *
422  * The specified identifier must correspond to an existing Input/Output class
423  * X11 window. Pixmaps are <b>not</b> supported. The caller shall ensure that
424  * the X11 server is the same as the one the VLC instance has been configured
425  * with. This function must be called before video playback is started;
426  * otherwise it will only take effect after playback stop and restart.
427  *
428  * \param p_mi the Media Player
429  * \param drawable the ID of the X window
430  */
431 LIBVLC_API void libvlc_media_player_set_xwindow ( libvlc_media_player_t *p_mi, uint32_t drawable );
432
433 /**
434  * Get the X Window System window identifier previously set with
435  * libvlc_media_player_set_xwindow(). Note that this will return the identifier
436  * even if VLC is not currently using it (for instance if it is playing an
437  * audio-only input).
438  *
439  * \param p_mi the Media Player
440  * \return an X window ID, or 0 if none where set.
441  */
442 LIBVLC_API uint32_t libvlc_media_player_get_xwindow ( libvlc_media_player_t *p_mi );
443
444 /**
445  * Set a Win32/Win64 API window handle (HWND) where the media player should
446  * render its video output. If LibVLC was built without Win32/Win64 API output
447  * support, then this has no effects.
448  *
449  * \param p_mi the Media Player
450  * \param drawable windows handle of the drawable
451  */
452 LIBVLC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi, void *drawable );
453
454 /**
455  * Get the Windows API window handle (HWND) previously set with
456  * libvlc_media_player_set_hwnd(). The handle will be returned even if LibVLC
457  * is not currently outputting any video to it.
458  *
459  * \param p_mi the Media Player
460  * \return a window handle or NULL if there are none.
461  */
462 LIBVLC_API void *libvlc_media_player_get_hwnd ( libvlc_media_player_t *p_mi );
463
464
465
466 /** \bug This might go away ... to be replaced by a broader system */
467
468 /**
469  * Get the current movie length (in ms).
470  *
471  * \param p_mi the Media Player
472  * \return the movie length (in ms), or -1 if there is no media.
473  */
474 LIBVLC_API libvlc_time_t libvlc_media_player_get_length( libvlc_media_player_t *p_mi );
475
476 /**
477  * Get the current movie time (in ms).
478  *
479  * \param p_mi the Media Player
480  * \return the movie time (in ms), or -1 if there is no media.
481  */
482 LIBVLC_API libvlc_time_t libvlc_media_player_get_time( libvlc_media_player_t *p_mi );
483
484 /**
485  * Set the movie time (in ms). This has no effect if no media is being played.
486  * Not all formats and protocols support this.
487  *
488  * \param p_mi the Media Player
489  * \param i_time the movie time (in ms).
490  */
491 LIBVLC_API void libvlc_media_player_set_time( libvlc_media_player_t *p_mi, libvlc_time_t i_time );
492
493 /**
494  * Get movie position.
495  *
496  * \param p_mi the Media Player
497  * \return movie position, or -1. in case of error
498  */
499 LIBVLC_API float libvlc_media_player_get_position( libvlc_media_player_t *p_mi );
500
501 /**
502  * Set movie position. This has no effect if playback is not enabled.
503  * This might not work depending on the underlying input format and protocol.
504  *
505  * \param p_mi the Media Player
506  * \param f_pos the position
507  */
508 LIBVLC_API void libvlc_media_player_set_position( libvlc_media_player_t *p_mi, float f_pos );
509
510 /**
511  * Set movie chapter (if applicable).
512  *
513  * \param p_mi the Media Player
514  * \param i_chapter chapter number to play
515  */
516 LIBVLC_API void libvlc_media_player_set_chapter( libvlc_media_player_t *p_mi, int i_chapter );
517
518 /**
519  * Get movie chapter.
520  *
521  * \param p_mi the Media Player
522  * \return chapter number currently playing, or -1 if there is no media.
523  */
524 LIBVLC_API int libvlc_media_player_get_chapter( libvlc_media_player_t *p_mi );
525
526 /**
527  * Get movie chapter count
528  *
529  * \param p_mi the Media Player
530  * \return number of chapters in movie, or -1.
531  */
532 LIBVLC_API int libvlc_media_player_get_chapter_count( libvlc_media_player_t *p_mi );
533
534 /**
535  * Is the player able to play
536  *
537  * \param p_mi the Media Player
538  * \return boolean
539  */
540 LIBVLC_API int libvlc_media_player_will_play( libvlc_media_player_t *p_mi );
541
542 /**
543  * Get title chapter count
544  *
545  * \param p_mi the Media Player
546  * \param i_title title
547  * \return number of chapters in title, or -1
548  */
549 LIBVLC_API int libvlc_media_player_get_chapter_count_for_title(
550                        libvlc_media_player_t *p_mi, int i_title );
551
552 /**
553  * Set movie title
554  *
555  * \param p_mi the Media Player
556  * \param i_title title number to play
557  */
558 LIBVLC_API void libvlc_media_player_set_title( libvlc_media_player_t *p_mi, int i_title );
559
560 /**
561  * Get movie title
562  *
563  * \param p_mi the Media Player
564  * \return title number currently playing, or -1
565  */
566 LIBVLC_API int libvlc_media_player_get_title( libvlc_media_player_t *p_mi );
567
568 /**
569  * Get movie title count
570  *
571  * \param p_mi the Media Player
572  * \return title number count, or -1
573  */
574 LIBVLC_API int libvlc_media_player_get_title_count( libvlc_media_player_t *p_mi );
575
576 /**
577  * Set previous chapter (if applicable)
578  *
579  * \param p_mi the Media Player
580  */
581 LIBVLC_API void libvlc_media_player_previous_chapter( libvlc_media_player_t *p_mi );
582
583 /**
584  * Set next chapter (if applicable)
585  *
586  * \param p_mi the Media Player
587  */
588 LIBVLC_API void libvlc_media_player_next_chapter( libvlc_media_player_t *p_mi );
589
590 /**
591  * Get the requested movie play rate.
592  * @warning Depending on the underlying media, the requested rate may be
593  * different from the real playback rate.
594  *
595  * \param p_mi the Media Player
596  * \return movie play rate
597  */
598 LIBVLC_API float libvlc_media_player_get_rate( libvlc_media_player_t *p_mi );
599
600 /**
601  * Set movie play rate
602  *
603  * \param p_mi the Media Player
604  * \param rate movie play rate to set
605  * \return -1 if an error was detected, 0 otherwise (but even then, it might
606  * not actually work depending on the underlying media protocol)
607  */
608 LIBVLC_API int libvlc_media_player_set_rate( libvlc_media_player_t *p_mi, float rate );
609
610 /**
611  * Get current movie state
612  *
613  * \param p_mi the Media Player
614  * \return the current state of the media player (playing, paused, ...) \see libvlc_state_t
615  */
616 LIBVLC_API libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *p_mi );
617
618 /**
619  * Get movie fps rate
620  *
621  * \param p_mi the Media Player
622  * \return frames per second (fps) for this playing movie, or 0 if unspecified
623  */
624 LIBVLC_API float libvlc_media_player_get_fps( libvlc_media_player_t *p_mi );
625
626 /** end bug */
627
628 /**
629  * How many video outputs does this media player have?
630  *
631  * \param p_mi the media player
632  * \return the number of video outputs
633  */
634 LIBVLC_API unsigned libvlc_media_player_has_vout( libvlc_media_player_t *p_mi );
635
636 /**
637  * Is this media player seekable?
638  *
639  * \param p_mi the media player
640  * \return true if the media player can seek
641  */
642 LIBVLC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi );
643
644 /**
645  * Can this media player be paused?
646  *
647  * \param p_mi the media player
648  * \return true if the media player can pause
649  */
650 LIBVLC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi );
651
652
653 /**
654  * Display the next frame (if supported)
655  *
656  * \param p_mi the media player
657  */
658 LIBVLC_API void libvlc_media_player_next_frame( libvlc_media_player_t *p_mi );
659
660 /**
661  * Navigate through DVD Menu
662  *
663  * \param p_mi the Media Player
664  * \param navigate the Navigation mode
665  * \version libVLC 1.2.0 or later
666  */
667 LIBVLC_API void libvlc_media_player_navigate( libvlc_media_player_t* p_mi,
668                                                   unsigned navigate );
669
670 /**
671  * Release (free) libvlc_track_description_t
672  *
673  * \param p_track_description the structure to release
674  */
675 LIBVLC_API void libvlc_track_description_release( libvlc_track_description_t *p_track_description );
676
677 /** \defgroup libvlc_video LibVLC video controls
678  * @{
679  */
680
681 /**
682  * Toggle fullscreen status on non-embedded video outputs.
683  *
684  * @warning The same limitations applies to this function
685  * as to libvlc_set_fullscreen().
686  *
687  * \param p_mi the media player
688  */
689 LIBVLC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *p_mi );
690
691 /**
692  * Enable or disable fullscreen.
693  *
694  * @warning With most window managers, only a top-level windows can be in
695  * full-screen mode. Hence, this function will not operate properly if
696  * libvlc_media_player_set_xwindow() was used to embed the video in a
697  * non-top-level window. In that case, the embedding window must be reparented
698  * to the root window <b>before</b> fullscreen mode is enabled. You will want
699  * to reparent it back to its normal parent when disabling fullscreen.
700  *
701  * \param p_mi the media player
702  * \param b_fullscreen boolean for fullscreen status
703  */
704 LIBVLC_API void libvlc_set_fullscreen( libvlc_media_player_t *p_mi, int b_fullscreen );
705
706 /**
707  * Get current fullscreen status.
708  *
709  * \param p_mi the media player
710  * \return the fullscreen status (boolean)
711  */
712 LIBVLC_API int libvlc_get_fullscreen( libvlc_media_player_t *p_mi );
713
714 /**
715  * Enable or disable key press events handling, according to the LibVLC hotkeys
716  * configuration. By default and for historical reasons, keyboard events are
717  * handled by the LibVLC video widget.
718  *
719  * \note On X11, there can be only one subscriber for key press and mouse
720  * click events per window. If your application has subscribed to those events
721  * for the X window ID of the video widget, then LibVLC will not be able to
722  * handle key presses and mouse clicks in any case.
723  *
724  * \warning This function is only implemented for X11 and Win32 at the moment.
725  *
726  * \param p_mi the media player
727  * \param on true to handle key press events, false to ignore them.
728  */
729 LIBVLC_API
730 void libvlc_video_set_key_input( libvlc_media_player_t *p_mi, unsigned on );
731
732 /**
733  * Enable or disable mouse click events handling. By default, those events are
734  * handled. This is needed for DVD menus to work, as well as a few video
735  * filters such as "puzzle".
736  *
737  * \note See also libvlc_video_set_key_input().
738  *
739  * \warning This function is only implemented for X11 and Win32 at the moment.
740  *
741  * \param p_mi the media player
742  * \param on true to handle mouse click events, false to ignore them.
743  */
744 LIBVLC_API
745 void libvlc_video_set_mouse_input( libvlc_media_player_t *p_mi, unsigned on );
746
747 /**
748  * Get the pixel dimensions of a video.
749  *
750  * \param p_mi media player
751  * \param num number of the video (starting from, and most commonly 0)
752  * \param px pointer to get the pixel width [OUT]
753  * \param py pointer to get the pixel height [OUT]
754  * \return 0 on success, -1 if the specified video does not exist
755  */
756 LIBVLC_API
757 int libvlc_video_get_size( libvlc_media_player_t *p_mi, unsigned num,
758                            unsigned *px, unsigned *py );
759
760 /**
761  * Get current video height.
762  * \deprecated Use libvlc_video_get_size() instead.
763  *
764  * \param p_mi the media player
765  * \return the video pixel height or 0 if not applicable
766  */
767 LIBVLC_DEPRECATED
768 int libvlc_video_get_height( libvlc_media_player_t *p_mi );
769
770 /**
771  * Get current video width.
772  * \deprecated Use libvlc_video_get_size() instead.
773  *
774  * \param p_mi the media player
775  * \return the video pixel width or 0 if not applicable
776  */
777 LIBVLC_DEPRECATED
778 int libvlc_video_get_width( libvlc_media_player_t *p_mi );
779
780 /**
781  * Get the mouse pointer coordinates over a video.
782  * Coordinates are expressed in terms of the decoded video resolution,
783  * <b>not</b> in terms of pixels on the screen/viewport (to get the latter,
784  * you can query your windowing system directly).
785  *
786  * Either of the coordinates may be negative or larger than the corresponding
787  * dimension of the video, if the cursor is outside the rendering area.
788  *
789  * @warning The coordinates may be out-of-date if the pointer is not located
790  * on the video rendering area. LibVLC does not track the pointer if it is
791  * outside of the video widget.
792  *
793  * @note LibVLC does not support multiple pointers (it does of course support
794  * multiple input devices sharing the same pointer) at the moment.
795  *
796  * \param p_mi media player
797  * \param num number of the video (starting from, and most commonly 0)
798  * \param px pointer to get the abscissa [OUT]
799  * \param py pointer to get the ordinate [OUT]
800  * \return 0 on success, -1 if the specified video does not exist
801  */
802 LIBVLC_API
803 int libvlc_video_get_cursor( libvlc_media_player_t *p_mi, unsigned num,
804                              int *px, int *py );
805
806 /**
807  * Get the current video scaling factor.
808  * See also libvlc_video_set_scale().
809  *
810  * \param p_mi the media player
811  * \return the currently configured zoom factor, or 0. if the video is set
812  * to fit to the output window/drawable automatically.
813  */
814 LIBVLC_API float libvlc_video_get_scale( libvlc_media_player_t *p_mi );
815
816 /**
817  * Set the video scaling factor. That is the ratio of the number of pixels on
818  * screen to the number of pixels in the original decoded video in each
819  * dimension. Zero is a special value; it will adjust the video to the output
820  * window/drawable (in windowed mode) or the entire screen.
821  *
822  * Note that not all video outputs support scaling.
823  *
824  * \param p_mi the media player
825  * \param f_factor the scaling factor, or zero
826  */
827 LIBVLC_API void libvlc_video_set_scale( libvlc_media_player_t *p_mi, float f_factor );
828
829 /**
830  * Get current video aspect ratio.
831  *
832  * \param p_mi the media player
833  * \return the video aspect ratio or NULL if unspecified
834  * (the result must be released with free() or libvlc_free()).
835  */
836 LIBVLC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *p_mi );
837
838 /**
839  * Set new video aspect ratio.
840  *
841  * \param p_mi the media player
842  * \param psz_aspect new video aspect-ratio or NULL to reset to default
843  * \note Invalid aspect ratios are ignored.
844  */
845 LIBVLC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *p_mi, const char *psz_aspect );
846
847 /**
848  * Get current video subtitle.
849  *
850  * \param p_mi the media player
851  * \return the video subtitle selected, or -1 if none
852  */
853 LIBVLC_API int libvlc_video_get_spu( libvlc_media_player_t *p_mi );
854
855 /**
856  * Get the number of available video subtitles.
857  *
858  * \param p_mi the media player
859  * \return the number of available video subtitles
860  */
861 LIBVLC_API int libvlc_video_get_spu_count( libvlc_media_player_t *p_mi );
862
863 /**
864  * Get the description of available video subtitles.
865  *
866  * \param p_mi the media player
867  * \return list containing description of available video subtitles
868  */
869 LIBVLC_API libvlc_track_description_t *
870         libvlc_video_get_spu_description( libvlc_media_player_t *p_mi );
871
872 /**
873  * Set new video subtitle.
874  *
875  * \param p_mi the media player
876  * \param i_spu new video subtitle to select
877  * \return 0 on success, -1 if out of range
878  */
879 LIBVLC_API int libvlc_video_set_spu( libvlc_media_player_t *p_mi, unsigned i_spu );
880
881 /**
882  * Set new video subtitle file.
883  *
884  * \param p_mi the media player
885  * \param psz_subtitle new video subtitle file
886  * \return the success status (boolean)
887  */
888 LIBVLC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *p_mi, const char *psz_subtitle );
889
890 /**
891  * Get the description of available titles.
892  *
893  * \param p_mi the media player
894  * \return list containing description of available titles
895  */
896 LIBVLC_API libvlc_track_description_t *
897         libvlc_video_get_title_description( libvlc_media_player_t *p_mi );
898
899 /**
900  * Get the description of available chapters for specific title.
901  *
902  * \param p_mi the media player
903  * \param i_title selected title
904  * \return list containing description of available chapter for title i_title
905  */
906 LIBVLC_API libvlc_track_description_t *
907         libvlc_video_get_chapter_description( libvlc_media_player_t *p_mi, int i_title );
908
909 /**
910  * Get current crop filter geometry.
911  *
912  * \param p_mi the media player
913  * \return the crop filter geometry or NULL if unset
914  */
915 LIBVLC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *p_mi );
916
917 /**
918  * Set new crop filter geometry.
919  *
920  * \param p_mi the media player
921  * \param psz_geometry new crop filter geometry (NULL to unset)
922  */
923 LIBVLC_API
924 void libvlc_video_set_crop_geometry( libvlc_media_player_t *p_mi, const char *psz_geometry );
925
926 /**
927  * Get current teletext page requested.
928  *
929  * \param p_mi the media player
930  * \return the current teletext page requested.
931  */
932 LIBVLC_API int libvlc_video_get_teletext( libvlc_media_player_t *p_mi );
933
934 /**
935  * Set new teletext page to retrieve.
936  *
937  * \param p_mi the media player
938  * \param i_page teletex page number requested
939  */
940 LIBVLC_API void libvlc_video_set_teletext( libvlc_media_player_t *p_mi, int i_page );
941
942 /**
943  * Toggle teletext transparent status on video output.
944  *
945  * \param p_mi the media player
946  */
947 LIBVLC_API void libvlc_toggle_teletext( libvlc_media_player_t *p_mi );
948
949 /**
950  * Get number of available video tracks.
951  *
952  * \param p_mi media player
953  * \return the number of available video tracks (int)
954  */
955 LIBVLC_API int libvlc_video_get_track_count( libvlc_media_player_t *p_mi );
956
957 /**
958  * Get the description of available video tracks.
959  *
960  * \param p_mi media player
961  * \return list with description of available video tracks, or NULL on error
962  */
963 LIBVLC_API libvlc_track_description_t *
964         libvlc_video_get_track_description( libvlc_media_player_t *p_mi );
965
966 /**
967  * Get current video track.
968  *
969  * \param p_mi media player
970  * \return the video track (int) or -1 if none
971  */
972 LIBVLC_API int libvlc_video_get_track( libvlc_media_player_t *p_mi );
973
974 /**
975  * Set video track.
976  *
977  * \param p_mi media player
978  * \param i_track the track (int)
979  * \return 0 on success, -1 if out of range
980  */
981 LIBVLC_API
982 int libvlc_video_set_track( libvlc_media_player_t *p_mi, int i_track );
983
984 /**
985  * Take a snapshot of the current video window.
986  *
987  * If i_width AND i_height is 0, original size is used.
988  * If i_width XOR i_height is 0, original aspect-ratio is preserved.
989  *
990  * \param p_mi media player instance
991  * \param num number of video output (typically 0 for the first/only one)
992  * \param psz_filepath the path where to save the screenshot to
993  * \param i_width the snapshot's width
994  * \param i_height the snapshot's height
995  * \return 0 on success, -1 if the video was not found
996  */
997 LIBVLC_API
998 int libvlc_video_take_snapshot( libvlc_media_player_t *p_mi, unsigned num,
999                                 const char *psz_filepath, unsigned int i_width,
1000                                 unsigned int i_height );
1001
1002 /**
1003  * Enable or disable deinterlace filter
1004  *
1005  * \param p_mi libvlc media player
1006  * \param psz_mode type of deinterlace filter, NULL to disable
1007  */
1008 LIBVLC_API void libvlc_video_set_deinterlace( libvlc_media_player_t *p_mi,
1009                                                   const char *psz_mode );
1010
1011 /**
1012  * Get an integer marquee option value
1013  *
1014  * \param p_mi libvlc media player
1015  * \param option marq option to get \see libvlc_video_marquee_int_option_t
1016  */
1017 LIBVLC_API int libvlc_video_get_marquee_int( libvlc_media_player_t *p_mi,
1018                                                  unsigned option );
1019
1020 /**
1021  * Get a string marquee option value
1022  *
1023  * \param p_mi libvlc media player
1024  * \param option marq option to get \see libvlc_video_marquee_string_option_t
1025  */
1026 LIBVLC_API char *libvlc_video_get_marquee_string( libvlc_media_player_t *p_mi,
1027                                                       unsigned option );
1028
1029 /**
1030  * Enable, disable or set an integer marquee option
1031  *
1032  * Setting libvlc_marquee_Enable has the side effect of enabling (arg !0)
1033  * or disabling (arg 0) the marq filter.
1034  *
1035  * \param p_mi libvlc media player
1036  * \param option marq option to set \see libvlc_video_marquee_int_option_t
1037  * \param i_val marq option value
1038  */
1039 LIBVLC_API void libvlc_video_set_marquee_int( libvlc_media_player_t *p_mi,
1040                                                   unsigned option, int i_val );
1041
1042 /**
1043  * Set a marquee string option
1044  *
1045  * \param p_mi libvlc media player
1046  * \param option marq option to set \see libvlc_video_marquee_string_option_t
1047  * \param psz_text marq option value
1048  */
1049 LIBVLC_API void libvlc_video_set_marquee_string( libvlc_media_player_t *p_mi,
1050                                                      unsigned option, const char *psz_text );
1051
1052 /** option values for libvlc_video_{get,set}_logo_{int,string} */
1053 enum libvlc_video_logo_option_t {
1054     libvlc_logo_enable,
1055     libvlc_logo_file,           /**< string argument, "file,d,t;file,d,t;..." */
1056     libvlc_logo_x,
1057     libvlc_logo_y,
1058     libvlc_logo_delay,
1059     libvlc_logo_repeat,
1060     libvlc_logo_opacity,
1061     libvlc_logo_position
1062 };
1063
1064 /**
1065  * Get integer logo option.
1066  *
1067  * \param p_mi libvlc media player instance
1068  * \param option logo option to get, values of libvlc_video_logo_option_t
1069  */
1070 LIBVLC_API int libvlc_video_get_logo_int( libvlc_media_player_t *p_mi,
1071                                               unsigned option );
1072
1073 /**
1074  * Set logo option as integer. Options that take a different type value
1075  * are ignored.
1076  * Passing libvlc_logo_enable as option value has the side effect of
1077  * starting (arg !0) or stopping (arg 0) the logo filter.
1078  *
1079  * \param p_mi libvlc media player instance
1080  * \param option logo option to set, values of libvlc_video_logo_option_t
1081  * \param value logo option value
1082  */
1083 LIBVLC_API void libvlc_video_set_logo_int( libvlc_media_player_t *p_mi,
1084                                                unsigned option, int value );
1085
1086 /**
1087  * Set logo option as string. Options that take a different type value
1088  * are ignored.
1089  *
1090  * \param p_mi libvlc media player instance
1091  * \param option logo option to set, values of libvlc_video_logo_option_t
1092  * \param psz_value logo option value
1093  */
1094 LIBVLC_API void libvlc_video_set_logo_string( libvlc_media_player_t *p_mi,
1095                                       unsigned option, const char *psz_value );
1096
1097
1098 /** option values for libvlc_video_{get,set}_adjust_{int,float,bool} */
1099 enum libvlc_video_adjust_option_t {
1100     libvlc_adjust_Enable = 0,
1101     libvlc_adjust_Contrast,
1102     libvlc_adjust_Brightness,
1103     libvlc_adjust_Hue,
1104     libvlc_adjust_Saturation,
1105     libvlc_adjust_Gamma
1106 };
1107
1108 /**
1109  * Get integer adjust option.
1110  *
1111  * \param p_mi libvlc media player instance
1112  * \param option adjust option to get, values of libvlc_video_adjust_option_t
1113  * \version LibVLC 1.1.1 and later.
1114  */
1115 LIBVLC_API int libvlc_video_get_adjust_int( libvlc_media_player_t *p_mi,
1116                                                 unsigned option );
1117
1118 /**
1119  * Set adjust option as integer. Options that take a different type value
1120  * are ignored.
1121  * Passing libvlc_adjust_enable as option value has the side effect of
1122  * starting (arg !0) or stopping (arg 0) the adjust filter.
1123  *
1124  * \param p_mi libvlc media player instance
1125  * \param option adust option to set, values of libvlc_video_adjust_option_t
1126  * \param value adjust option value
1127  * \version LibVLC 1.1.1 and later.
1128  */
1129 LIBVLC_API void libvlc_video_set_adjust_int( libvlc_media_player_t *p_mi,
1130                                                  unsigned option, int value );
1131
1132 /**
1133  * Get float adjust option.
1134  *
1135  * \param p_mi libvlc media player instance
1136  * \param option adjust option to get, values of libvlc_video_adjust_option_t
1137  * \version LibVLC 1.1.1 and later.
1138  */
1139 LIBVLC_API float libvlc_video_get_adjust_float( libvlc_media_player_t *p_mi,
1140                                                     unsigned option );
1141
1142 /**
1143  * Set adjust option as float. Options that take a different type value
1144  * are ignored.
1145  *
1146  * \param p_mi libvlc media player instance
1147  * \param option adust option to set, values of libvlc_video_adjust_option_t
1148  * \param value adjust option value
1149  * \version LibVLC 1.1.1 and later.
1150  */
1151 LIBVLC_API void libvlc_video_set_adjust_float( libvlc_media_player_t *p_mi,
1152                                                    unsigned option, float value );
1153
1154 /** @} video */
1155
1156 /** \defgroup libvlc_audio LibVLC audio controls
1157  * @{
1158  */
1159
1160 /**
1161  * Audio device types
1162  */
1163 typedef enum libvlc_audio_output_device_types_t {
1164     libvlc_AudioOutputDevice_Error  = -1,
1165     libvlc_AudioOutputDevice_Mono   =  1,
1166     libvlc_AudioOutputDevice_Stereo =  2,
1167     libvlc_AudioOutputDevice_2F2R   =  4,
1168     libvlc_AudioOutputDevice_3F2R   =  5,
1169     libvlc_AudioOutputDevice_5_1    =  6,
1170     libvlc_AudioOutputDevice_6_1    =  7,
1171     libvlc_AudioOutputDevice_7_1    =  8,
1172     libvlc_AudioOutputDevice_SPDIF  = 10
1173 } libvlc_audio_output_device_types_t;
1174
1175 /**
1176  * Audio channels
1177  */
1178 typedef enum libvlc_audio_output_channel_t {
1179     libvlc_AudioChannel_Error   = -1,
1180     libvlc_AudioChannel_Stereo  =  1,
1181     libvlc_AudioChannel_RStereo =  2,
1182     libvlc_AudioChannel_Left    =  3,
1183     libvlc_AudioChannel_Right   =  4,
1184     libvlc_AudioChannel_Dolbys  =  5
1185 } libvlc_audio_output_channel_t;
1186
1187
1188 /**
1189  * Get the list of available audio outputs
1190  *
1191  * \param p_instance libvlc instance
1192  * \return list of available audio outputs. It must be freed it with
1193 *          \see libvlc_audio_output_list_release \see libvlc_audio_output_t .
1194  *         In case of error, NULL is returned.
1195  */
1196 LIBVLC_API libvlc_audio_output_t *
1197         libvlc_audio_output_list_get( libvlc_instance_t *p_instance );
1198
1199 /**
1200  * Free the list of available audio outputs
1201  *
1202  * \param p_list list with audio outputs for release
1203  */
1204 LIBVLC_API void libvlc_audio_output_list_release( libvlc_audio_output_t *p_list );
1205
1206 /**
1207  * Set the audio output.
1208  * Change will be applied after stop and play.
1209  *
1210  * \param p_mi media player
1211  * \param psz_name name of audio output,
1212  *               use psz_name of \see libvlc_audio_output_t
1213  * \return true if function succeded
1214  */
1215 LIBVLC_API int libvlc_audio_output_set( libvlc_media_player_t *p_mi,
1216                                             const char *psz_name );
1217
1218 /**
1219  * Get count of devices for audio output, these devices are hardware oriented
1220  * like analor or digital output of sound card
1221  *
1222  * \param p_instance libvlc instance
1223  * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1224  * \return number of devices
1225  */
1226 LIBVLC_API int libvlc_audio_output_device_count( libvlc_instance_t *p_instance,
1227                                                      const char *psz_audio_output );
1228
1229 /**
1230  * Get long name of device, if not available short name given
1231  *
1232  * \param p_instance libvlc instance
1233  * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1234  * \param i_device device index
1235  * \return long name of device
1236  */
1237 LIBVLC_API char * libvlc_audio_output_device_longname( libvlc_instance_t *p_instance,
1238                                                            const char *psz_audio_output,
1239                                                            int i_device );
1240
1241 /**
1242  * Get id name of device
1243  *
1244  * \param p_instance libvlc instance
1245  * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1246  * \param i_device device index
1247  * \return id name of device, use for setting device, need to be free after use
1248  */
1249 LIBVLC_API char * libvlc_audio_output_device_id( libvlc_instance_t *p_instance,
1250                                                      const char *psz_audio_output,
1251                                                      int i_device );
1252
1253 /**
1254  * Set audio output device. Changes are only effective after stop and play.
1255  *
1256  * \param p_mi media player
1257  * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1258  * \param psz_device_id device
1259  */
1260 LIBVLC_API void libvlc_audio_output_device_set( libvlc_media_player_t *p_mi,
1261                                                     const char *psz_audio_output,
1262                                                     const char *psz_device_id );
1263
1264 /**
1265  * Get current audio device type. Device type describes something like
1266  * character of output sound - stereo sound, 2.1, 5.1 etc
1267  *
1268  * \param p_mi media player
1269  * \return the audio devices type \see libvlc_audio_output_device_types_t
1270  */
1271 LIBVLC_API int libvlc_audio_output_get_device_type( libvlc_media_player_t *p_mi );
1272
1273 /**
1274  * Set current audio device type.
1275  *
1276  * \param p_mi vlc instance
1277  * \param device_type the audio device type,
1278           according to \see libvlc_audio_output_device_types_t
1279  */
1280 LIBVLC_API void libvlc_audio_output_set_device_type( libvlc_media_player_t *p_mi,
1281                                                          int device_type );
1282
1283
1284 /**
1285  * Toggle mute status.
1286  *
1287  * \param p_mi media player
1288  */
1289 LIBVLC_API void libvlc_audio_toggle_mute( libvlc_media_player_t *p_mi );
1290
1291 /**
1292  * Get current mute status.
1293  *
1294  * \param p_mi media player
1295  * \return the mute status (boolean)
1296  */
1297 LIBVLC_API int libvlc_audio_get_mute( libvlc_media_player_t *p_mi );
1298
1299 /**
1300  * Set mute status.
1301  *
1302  * \param p_mi media player
1303  * \param status If status is true then mute, otherwise unmute
1304  */
1305 LIBVLC_API void libvlc_audio_set_mute( libvlc_media_player_t *p_mi, int status );
1306
1307 /**
1308  * Get current audio level.
1309  *
1310  * \param p_mi media player
1311  * \return the audio level (int)
1312  */
1313 LIBVLC_API int libvlc_audio_get_volume( libvlc_media_player_t *p_mi );
1314
1315 /**
1316  * Set current audio level.
1317  *
1318  * \param p_mi media player
1319  * \param i_volume the volume (int)
1320  * \return 0 if the volume was set, -1 if it was out of range
1321  */
1322 LIBVLC_API int libvlc_audio_set_volume( libvlc_media_player_t *p_mi, int i_volume );
1323
1324 /**
1325  * Get number of available audio tracks.
1326  *
1327  * \param p_mi media player
1328  * \return the number of available audio tracks (int), or -1 if unavailable
1329  */
1330 LIBVLC_API int libvlc_audio_get_track_count( libvlc_media_player_t *p_mi );
1331
1332 /**
1333  * Get the description of available audio tracks.
1334  *
1335  * \param p_mi media player
1336  * \return list with description of available audio tracks, or NULL
1337  */
1338 LIBVLC_API libvlc_track_description_t *
1339         libvlc_audio_get_track_description( libvlc_media_player_t *p_mi );
1340
1341 /**
1342  * Get current audio track.
1343  *
1344  * \param p_mi media player
1345  * \return the audio track (int), or -1 if none.
1346  */
1347 LIBVLC_API int libvlc_audio_get_track( libvlc_media_player_t *p_mi );
1348
1349 /**
1350  * Set current audio track.
1351  *
1352  * \param p_mi media player
1353  * \param i_track the track (int)
1354  * \return 0 on success, -1 on error
1355  */
1356 LIBVLC_API int libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track );
1357
1358 /**
1359  * Get current audio channel.
1360  *
1361  * \param p_mi media player
1362  * \return the audio channel \see libvlc_audio_output_channel_t
1363  */
1364 LIBVLC_API int libvlc_audio_get_channel( libvlc_media_player_t *p_mi );
1365
1366 /**
1367  * Set current audio channel.
1368  *
1369  * \param p_mi media player
1370  * \param channel the audio channel, \see libvlc_audio_output_channel_t
1371  * \return 0 on success, -1 on error
1372  */
1373 LIBVLC_API int libvlc_audio_set_channel( libvlc_media_player_t *p_mi, int channel );
1374
1375 /**
1376  * Get current audio delay.
1377  *
1378  * \param p_mi media player
1379  * \return the audio delay (microseconds)
1380  * \version LibVLC 1.1.1 or later
1381  */
1382 LIBVLC_API int64_t libvlc_audio_get_delay( libvlc_media_player_t *p_mi );
1383
1384 /**
1385  * Set current audio delay. The audio delay will be reset to zero each time the media changes.
1386  *
1387  * \param p_mi media player
1388  * \param i_delay the audio delay (microseconds)
1389  * \return 0 on success, -1 on error
1390  * \version LibVLC 1.1.1 or later
1391  */
1392 LIBVLC_API int libvlc_audio_set_delay( libvlc_media_player_t *p_mi, int64_t i_delay );
1393
1394 /** @} audio */
1395
1396 /** @} media_player */
1397
1398 # ifdef __cplusplus
1399 }
1400 # endif
1401
1402 #endif /* VLC_LIBVLC_MEDIA_PLAYER_H */