]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_media_player.h
libvlc_media_player.h: Remove trailing whitespaces.
[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 /**
507  * Release (free) libvlc_track_description_t
508  *
509  * \param p_track_description the structure to release
510  */
511 VLC_PUBLIC_API void libvlc_track_description_release( libvlc_track_description_t *p_track_description );
512
513 /** \defgroup libvlc_video libvlc_video
514  * \ingroup libvlc_media_player
515  * LibVLC Video handling
516  * @{
517  */
518
519 /**
520  * Toggle fullscreen status on a non-embedded video output.
521  *
522  * @warning The same limitations applies to this function
523  * as to libvlc_set_fullscreen().
524  *
525  * \param p_mediaplayer the media player
526  * \param p_e an initialized exception pointer
527  */
528 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
529
530 /**
531  * Enable or disable fullscreen on a non-embedded video output.
532  *
533  * @warning With most window managers, only a top-level windows can switch to
534  * full-screen mode. Hence, this function will not operate properly if
535  * libvlc_media_player_set_xid() or libvlc_media_player_set_hwnd() was
536  * used to embed the video in a non-LibVLC widget. If you want to to render an
537  * embedded LibVLC video full-screen, the parent embedding widget must expanded
538  * to full screen (LibVLC cannot take care of that).
539  * LibVLC will then automatically resize the video as appropriate.
540  *
541  * \param p_mediaplayer the media player
542  * \param b_fullscreen boolean for fullscreen status
543  * \param p_e an initialized exception pointer
544  */
545 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *, int, libvlc_exception_t * );
546
547 /**
548  * Get current fullscreen status.
549  *
550  * \param p_mediaplayer the media player
551  * \param p_e an initialized exception pointer
552  * \return the fullscreen status (boolean)
553  */
554 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
555
556 /**
557  * Enable or disable key press events handling, according to the LibVLC hotkeys
558  * configuration. By default and for historical reasons, keyboard events are
559  * handled by the LibVLC video widget.
560  *
561  * \note On X11, there can be only one subscriber for key press and mouse
562  * click events per window. If your application has subscribed to those events
563  * for the X window ID of the video widget, then LibVLC will not be able to
564  * handle key presses and mouse clicks in any case.
565  *
566  * \warning This function is only implemented for X11 at the moment.
567  *
568  * \param mp the media player
569  * \param on true to handle key press events, false to ignore them.
570  */
571 VLC_PUBLIC_API
572 void libvlc_video_set_key_input( libvlc_media_player_t *mp, unsigned on );
573
574 /**
575  * Enable or disable mouse click events handling. By default, those events are
576  * handled. This is needed for DVD menus to work, as well as a few video
577  * filters such as "puzzle".
578  *
579  * \note See also \func libvlc_video_set_key_input().
580  *
581  * \warning This function is only implemented for X11 at the moment.
582  *
583  * \param mp the media player
584  * \param on true to handle mouse click events, false to ignore them.
585  */
586 VLC_PUBLIC_API
587 void libvlc_video_set_mouse_input( libvlc_media_player_t *mp, unsigned on );
588
589 /**
590  * Get current video height.
591  *
592  * \param p_mediaplayer the media player
593  * \param p_e an initialized exception pointer
594  * \return the video height
595  */
596 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_player_t *, libvlc_exception_t * );
597
598 /**
599  * Get current video width.
600  *
601  * \param p_mediaplayer the media player
602  * \param p_e an initialized exception pointer
603  * \return the video width
604  */
605 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_player_t *, libvlc_exception_t * );
606
607 /**
608  * Get the current video scaling factor.
609  * See also libvlc_video_set_scale().
610  *
611  * \param p_mediaplayer the media player
612  * \param p_e an initialized exception pointer
613  * \return the currently configured zoom factor, or 0. if the video is set
614  * to fit to the output window/drawable automatically.
615  */
616 VLC_PUBLIC_API float libvlc_video_get_scale( libvlc_media_player_t *,
617                                              libvlc_exception_t *p_e );
618
619 /**
620  * Set the video scaling factor. That is the ratio of the number of pixels on
621  * screen to the number of pixels in the original decoded video in each
622  * dimension. Zero is a special value; it will adjust the video to the output
623  * window/drawable (in windowed mode) or the entire screen.
624  *
625  * Note that not all video outputs support scaling.
626  *
627  * \param p_mediaplayer the media player
628  * \param i_factor the scaling factor, or zero
629  * \param p_e an initialized exception pointer
630  */
631 VLC_PUBLIC_API void libvlc_video_set_scale( libvlc_media_player_t *, float,
632                                             libvlc_exception_t *p_e );
633
634 /**
635  * Get current video aspect ratio.
636  *
637  * \param p_mediaplayer the media player
638  * \param p_e an initialized exception pointer
639  * \return the video aspect ratio
640  */
641 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *, libvlc_exception_t * );
642
643 /**
644  * Set new video aspect ratio.
645  *
646  * \param p_mediaplayer the media player
647  * \param psz_aspect new video aspect-ratio
648  * \param p_e an initialized exception pointer
649  */
650 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *, const char *, libvlc_exception_t * );
651
652 /**
653  * Get current video subtitle.
654  *
655  * \param p_mediaplayer the media player
656  * \param p_e an initialized exception pointer
657  * \return the video subtitle selected
658  */
659 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *, libvlc_exception_t * );
660
661 /**
662  * Get the number of available video subtitles.
663  *
664  * \param p_mediaplayer the media player
665  * \param p_e an initialized exception pointer
666  * \return the number of available video subtitles
667  */
668 VLC_PUBLIC_API int libvlc_video_get_spu_count( libvlc_media_player_t *, libvlc_exception_t * );
669
670 /**
671  * Get the description of available video subtitles.
672  *
673  * \param p_mediaplayer the media player
674  * \param p_e an initialized exception pointer
675  * \return list containing description of available video subtitles
676  */
677 VLC_PUBLIC_API libvlc_track_description_t *
678         libvlc_video_get_spu_description( libvlc_media_player_t *, libvlc_exception_t * );
679
680 /**
681  * Set new video subtitle.
682  *
683  * \param p_mediaplayer the media player
684  * \param i_spu new video subtitle to select
685  * \param p_e an initialized exception pointer
686  */
687 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_player_t *, int , libvlc_exception_t * );
688
689 /**
690  * Set new video subtitle file.
691  *
692  * \param p_mediaplayer the media player
693  * \param psz_subtitle new video subtitle file
694  * \param p_e an initialized exception pointer
695  * \return the success status (boolean)
696  */
697 VLC_PUBLIC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *, const char *, libvlc_exception_t * );
698
699 /**
700  * Get the description of available titles.
701  *
702  * \param p_mediaplayer the media player
703  * \param p_e an initialized exception pointer
704  * \return list containing description of available titles
705  */
706 VLC_PUBLIC_API libvlc_track_description_t *
707         libvlc_video_get_title_description( libvlc_media_player_t *, libvlc_exception_t * );
708
709 /**
710  * Get the description of available chapters for specific title.
711  *
712  * \param p_mediaplayer the media player
713  * \param i_title selected title
714  * \param p_e an initialized exception pointer
715  * \return list containing description of available chapter for title i_title
716  */
717 VLC_PUBLIC_API libvlc_track_description_t *
718         libvlc_video_get_chapter_description( libvlc_media_player_t *, int, libvlc_exception_t * );
719
720 /**
721  * Get current crop filter geometry.
722  *
723  * \param p_mediaplayer the media player
724  * \param p_e an initialized exception pointer
725  * \return the crop filter geometry
726  */
727 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *, libvlc_exception_t * );
728
729 /**
730  * Set new crop filter geometry.
731  *
732  * \param p_mediaplayer the media player
733  * \param psz_geometry new crop filter geometry
734  * \param p_e an initialized exception pointer
735  */
736 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_player_t *, const char *, libvlc_exception_t * );
737
738 /**
739  * Toggle teletext transparent status on video output.
740  *
741  * \param p_mediaplayer the media player
742  * \param p_e an initialized exception pointer
743  */
744 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *, libvlc_exception_t * );
745
746 /**
747  * Get number of available video tracks.
748  *
749  * \param p_mi media player
750  * \param p_e an initialized exception
751  * \return the number of available video tracks (int)
752  */
753 VLC_PUBLIC_API int libvlc_video_get_track_count( libvlc_media_player_t *,  libvlc_exception_t * );
754
755 /**
756  * Get the description of available video tracks.
757  *
758  * \param p_mi media player
759  * \param p_e an initialized exception
760  * \return list with description of available video tracks
761  */
762 VLC_PUBLIC_API libvlc_track_description_t *
763         libvlc_video_get_track_description( libvlc_media_player_t *,  libvlc_exception_t * );
764
765 /**
766  * Get current video track.
767  *
768  * \param p_mi media player
769  * \param p_e an initialized exception pointer
770  * \return the video track (int)
771  */
772 VLC_PUBLIC_API int libvlc_video_get_track( libvlc_media_player_t *, libvlc_exception_t * );
773
774 /**
775  * Set video track.
776  *
777  * \param p_mi media player
778  * \param i_track the track (int)
779  * \param p_e an initialized exception pointer
780  */
781 VLC_PUBLIC_API void libvlc_video_set_track( libvlc_media_player_t *, int, libvlc_exception_t * );
782
783 /**
784  * Take a snapshot of the current video window.
785  *
786  * If i_width AND i_height is 0, original size is used.
787  * If i_width XOR i_height is 0, original aspect-ratio is preserved.
788  *
789  * \param p_mi media player instance
790  * \param psz_filepath the path where to save the screenshot to
791  * \param i_width the snapshot's width
792  * \param i_height the snapshot's height
793  * \param p_e an initialized exception pointer
794  */
795 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_player_t *, const char *,unsigned int, unsigned int, libvlc_exception_t * );
796
797 /**
798  * Enable or disable deinterlace filter
799  *
800  * \param p_mi libvlc media player
801  * \param b_enable boolean to enable or disable deinterlace filter
802  * \param psz_mode type of deinterlace filter to use
803  * \param p_e an initialized exception pointer
804  */
805 VLC_PUBLIC_API void libvlc_video_set_deinterlace( libvlc_media_player_t *,
806                                                   int , const char *,
807                                                   libvlc_exception_t *);
808
809 /**
810  * Get an integer option value
811  *
812  * \param p_mi libvlc media player
813  * \param option marq option to get \see libvlc_video_marquee_int_option_t
814  * \param p_e an initialized exception pointer
815  */
816 VLC_PUBLIC_API int libvlc_video_get_marquee_int( libvlc_media_player_t *,
817                                              unsigned, libvlc_exception_t * );
818
819 /**
820  * Get a string option value
821  *
822  * \param p_mi libvlc media player
823  * \param option marq option to get \see libvlc_video_marquee_string_option_t
824  * \param p_e an initialized exception pointer
825  */
826 VLC_PUBLIC_API char *libvlc_video_get_marquee_string( libvlc_media_player_t *,
827                                              unsigned, libvlc_exception_t * );
828
829 /**
830  * Enable, disable or set an integer marq option
831  *
832  * Setting libvlc_marquee_Enable has the side effect of enabling (arg !0)
833  * or disabling (arg 0) the marq filter.
834  *
835  * \param p_mi libvlc media player
836  * \param option marq option to set \see libvlc_video_marquee_int_option_t
837  * \param i_val marq option value
838  * \param p_e an initialized exception pointer
839  */
840 VLC_PUBLIC_API void libvlc_video_set_marquee_int( libvlc_media_player_t *,
841                                         unsigned, int, libvlc_exception_t * );
842
843 /**
844  * Set a marq string option
845  *
846  * \param p_mi libvlc media player
847  * \param option marq option to set \see libvlc_video_marquee_string_option_t
848  * \param psz_text marq option value
849  * \param p_e an initialized exception pointer
850  */
851 VLC_PUBLIC_API void libvlc_video_set_marquee_string( libvlc_media_player_t *,
852                                unsigned, const char *, libvlc_exception_t * );
853
854 enum libvlc_video_logo_option_t {
855     libvlc_logo_enable,
856     libvlc_logo_file,           /**< string argument, "file,d,t;file,d,t;..." */
857     libvlc_logo_x,
858     libvlc_logo_y,
859     libvlc_logo_delay,
860     libvlc_logo_repeat,
861     libvlc_logo_opacity,
862     libvlc_logo_position,
863 };
864
865 /**
866  * Get integer logo option.
867  *
868  * \param p_mi libvlc media player instance
869  * \param option logo option to get, values of libvlc_video_logo_option_t
870  * \param p_e an pointer to an initialized exception object
871  */
872 VLC_PUBLIC_API int libvlc_video_get_logo_int( libvlc_media_player_t *p_mi,
873                                  unsigned option, libvlc_exception_t *p_e );
874
875 /**
876  * Set logo option as integer. Options that take a different type value
877  * cause an invalid argument exception.
878  * Passing libvlc_logo_enable as option value has the side effect of
879  * starting (arg !0) or stopping (arg 0) the logo filter.
880  *
881  * \param p_mi libvlc media player instance
882  * \param option logo option to set, values of libvlc_video_logo_option_t
883  * \param value logo option value
884  * \param p_e an pointer to an initialized exception object
885  */
886 VLC_PUBLIC_API void libvlc_video_set_logo_int( libvlc_media_player_t *p_mi,
887                         unsigned option, int value, libvlc_exception_t *p_e );
888
889 /**
890  * Set logo option as string. Options that take a different type value
891  * cause an invalid argument exception.
892  *
893  * \param p_mi libvlc media player instance
894  * \param option logo option to set, values of libvlc_video_logo_option_t
895  * \param psz_value logo option value
896  * \param p_e an pointer to an initialized exception object
897  */
898 VLC_PUBLIC_API void libvlc_video_set_logo_string( libvlc_media_player_t *p_mi,
899             unsigned option, const char *psz_value, libvlc_exception_t *p_e );
900
901 /** @} video */
902
903 /** \defgroup libvlc_audio libvlc_audio
904  * \ingroup libvlc_media_player
905  * LibVLC Audio handling
906  * @{
907  */
908
909 /**
910  * Audio device types
911  */
912 typedef enum libvlc_audio_output_device_types_t {
913     libvlc_AudioOutputDevice_Error  = -1,
914     libvlc_AudioOutputDevice_Mono   =  1,
915     libvlc_AudioOutputDevice_Stereo =  2,
916     libvlc_AudioOutputDevice_2F2R   =  4,
917     libvlc_AudioOutputDevice_3F2R   =  5,
918     libvlc_AudioOutputDevice_5_1    =  6,
919     libvlc_AudioOutputDevice_6_1    =  7,
920     libvlc_AudioOutputDevice_7_1    =  8,
921     libvlc_AudioOutputDevice_SPDIF  = 10
922 } libvlc_audio_output_device_types_t;
923
924 /**
925  * Audio channels
926  */
927 typedef enum libvlc_audio_output_channel_t {
928     libvlc_AudioChannel_Error   = -1,
929     libvlc_AudioChannel_Stereo  =  1,
930     libvlc_AudioChannel_RStereo =  2,
931     libvlc_AudioChannel_Left    =  3,
932     libvlc_AudioChannel_Right   =  4,
933     libvlc_AudioChannel_Dolbys  =  5
934 } libvlc_audio_output_channel_t;
935
936
937 /**
938  * Get the list of available audio outputs
939  *
940  * \param p_instance libvlc instance
941  * \param p_e an initialized exception pointer
942  * \return list of available audio outputs, at the end free it with
943 *          \see libvlc_audio_output_list_release \see libvlc_audio_output_t
944  */
945 VLC_PUBLIC_API libvlc_audio_output_t *
946         libvlc_audio_output_list_get( libvlc_instance_t *,
947                                       libvlc_exception_t * );
948
949 /**
950  * Free the list of available audio outputs
951  *
952  * \param p_list list with audio outputs for release
953  */
954 VLC_PUBLIC_API void libvlc_audio_output_list_release( libvlc_audio_output_t * );
955
956 /**
957  * Set the audio output.
958  * Change will be applied after stop and play.
959  *
960  * \param p_instance libvlc instance
961  * \param psz_name name of audio output,
962  *               use psz_name of \see libvlc_audio_output_t
963  * \return true if function succeded
964  */
965 VLC_PUBLIC_API int libvlc_audio_output_set( libvlc_instance_t *,
966                                             const char * );
967
968 /**
969  * Get count of devices for audio output, these devices are hardware oriented
970  * like analor or digital output of sound card
971  *
972  * \param p_instance libvlc instance
973  * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
974  * \return number of devices
975  */
976 VLC_PUBLIC_API int libvlc_audio_output_device_count( libvlc_instance_t *,
977                                                      const char * );
978
979 /**
980  * Get long name of device, if not available short name given
981  *
982  * \param p_instance libvlc instance
983  * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
984  * \param i_device device index
985  * \return long name of device
986  */
987 VLC_PUBLIC_API char * libvlc_audio_output_device_longname( libvlc_instance_t *,
988                                                            const char *,
989                                                            int );
990
991 /**
992  * Get id name of device
993  *
994  * \param p_instance libvlc instance
995  * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
996  * \param i_device device index
997  * \return id name of device, use for setting device, need to be free after use
998  */
999 VLC_PUBLIC_API char * libvlc_audio_output_device_id( libvlc_instance_t *,
1000                                                      const char *,
1001                                                      int );
1002
1003 /**
1004  * Set device for using
1005  *
1006  * \param p_instance libvlc instance
1007  * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
1008  * \param psz_device_id device
1009  */
1010 VLC_PUBLIC_API void libvlc_audio_output_device_set( libvlc_instance_t *,
1011                                                     const char *,
1012                                                     const char * );
1013
1014 /**
1015  * Get current audio device type. Device type describes something like
1016  * character of output sound - stereo sound, 2.1, 5.1 etc
1017  *
1018  * \param p_instance vlc instance
1019  * \param p_e an initialized exception pointer
1020  * \return the audio devices type \see libvlc_audio_output_device_types_t
1021  */
1022 VLC_PUBLIC_API int libvlc_audio_output_get_device_type(
1023         libvlc_instance_t *, libvlc_exception_t * );
1024
1025 /**
1026  * Set current audio device type.
1027  *
1028  * \param p_instance vlc instance
1029  * \param device_type the audio device type,
1030           according to \see libvlc_audio_output_device_types_t
1031  * \param p_e an initialized exception pointer
1032  */
1033 VLC_PUBLIC_API void libvlc_audio_output_set_device_type( libvlc_instance_t *,
1034                                                          int,
1035                                                          libvlc_exception_t * );
1036
1037
1038 /**
1039  * Toggle mute status.
1040  *
1041  * \param p_instance libvlc instance
1042  */
1043 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t * );
1044
1045 /**
1046  * Get current mute status.
1047  *
1048  * \param p_instance libvlc instance
1049  * \return the mute status (boolean)
1050  */
1051 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_instance_t * );
1052
1053 /**
1054  * Set mute status.
1055  *
1056  * \param p_instance libvlc instance
1057  * \param status If status is true then mute, otherwise unmute
1058  */
1059 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, int );
1060
1061 /**
1062  * Get current audio level.
1063  *
1064  * \param p_instance libvlc instance
1065  * \param p_e an initialized exception pointer
1066  * \return the audio level (int)
1067  */
1068 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t * );
1069
1070 /**
1071  * Set current audio level.
1072  *
1073  * \param p_instance libvlc instance
1074  * \param i_volume the volume (int)
1075  * \param p_e an initialized exception pointer
1076  */
1077 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
1078
1079 /**
1080  * Get number of available audio tracks.
1081  *
1082  * \param p_mi media player
1083  * \param p_e an initialized exception
1084  * \return the number of available audio tracks (int)
1085  */
1086 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *,  libvlc_exception_t * );
1087
1088 /**
1089  * Get the description of available audio tracks.
1090  *
1091  * \param p_mi media player
1092  * \param p_e an initialized exception
1093  * \return list with description of available audio tracks
1094  */
1095 VLC_PUBLIC_API libvlc_track_description_t *
1096         libvlc_audio_get_track_description( libvlc_media_player_t *,  libvlc_exception_t * );
1097
1098 /**
1099  * Get current audio track.
1100  *
1101  * \param p_mi media player
1102  * \param p_e an initialized exception pointer
1103  * \return the audio track (int)
1104  */
1105 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *, libvlc_exception_t * );
1106
1107 /**
1108  * Set current audio track.
1109  *
1110  * \param p_mi media player
1111  * \param i_track the track (int)
1112  * \param p_e an initialized exception pointer
1113  */
1114 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_player_t *, int, libvlc_exception_t * );
1115
1116 /**
1117  * Get current audio channel.
1118  *
1119  * \param p_instance vlc instance
1120  * \param p_e an initialized exception pointer
1121  * \return the audio channel \see libvlc_audio_output_channel_t
1122  */
1123 VLC_PUBLIC_API int
1124     libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
1125
1126 /**
1127  * Set current audio channel.
1128  *
1129  * \param p_instance vlc instance
1130  * \param channel the audio channel, \see libvlc_audio_output_channel_t
1131  * \param p_e an initialized exception pointer
1132  */
1133 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *,
1134                                               int,
1135                                               libvlc_exception_t * );
1136
1137 /** @} audio */
1138
1139 /** @} media_player */
1140
1141 # ifdef __cplusplus
1142 }
1143 # endif
1144
1145 #endif /* VLC_LIBVLC_MEDIA_PLAYER_H */