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