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