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