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