]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_media_player.h
Merge branch '1.0'
[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 /**
81  * Create an empty Media Player object
82  *
83  * \param p_libvlc_instance the libvlc instance in which the Media Player
84  *        should be created.
85  * \param p_e an initialized exception pointer
86  */
87 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t *, libvlc_exception_t * );
88
89 /**
90  * Create a Media Player object from a Media
91  *
92  * \param p_md the media. Afterwards the p_md can be safely
93  *        destroyed.
94  * \param p_e an initialized exception pointer
95  */
96 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new_from_media( libvlc_media_t *, libvlc_exception_t * );
97
98 /**
99  * Release a media_player after use
100  * Decrement the reference count of a media player object. If the
101  * reference count is 0, then libvlc_media_player_release() will
102  * release the media player object. If the media player object
103  * has been released, then it should not be used again.
104  *
105  * \param p_mi the Media Player to free
106  */
107 VLC_PUBLIC_API void libvlc_media_player_release( libvlc_media_player_t * );
108
109 /**
110  * Retain a reference to a media player object. Use
111  * libvlc_media_player_release() to decrement reference count.
112  *
113  * \param p_mi media player object
114  */
115 VLC_PUBLIC_API void libvlc_media_player_retain( libvlc_media_player_t * );
116
117 /**
118  * Set the media that will be used by the media_player. If any,
119  * previous md will be released.
120  *
121  * \param p_mi the Media Player
122  * \param p_md the Media. Afterwards the p_md can be safely
123  *        destroyed.
124  * \param p_e an initialized exception pointer
125  */
126 VLC_PUBLIC_API void libvlc_media_player_set_media( libvlc_media_player_t *, libvlc_media_t *, libvlc_exception_t * );
127
128 /**
129  * Get the media used by the media_player.
130  *
131  * \param p_mi the Media Player
132  * \param p_e an initialized exception pointer
133  * \return the media associated with p_mi, or NULL if no
134  *         media is associated
135  */
136 VLC_PUBLIC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t *, libvlc_exception_t * );
137
138 /**
139  * Get the Event Manager from which the media player send event.
140  *
141  * \param p_mi the Media Player
142  * \param p_e an initialized exception pointer
143  * \return the event manager associated with p_mi
144  */
145 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *, libvlc_exception_t * );
146
147 /**
148  * is_playing
149  *
150  * \param p_mi the Media Player
151  * \param p_e an initialized exception pointer
152  * \return 1 if the media player is playing, 0 otherwise
153  */
154 VLC_PUBLIC_API int libvlc_media_player_is_playing ( libvlc_media_player_t *, libvlc_exception_t * );
155
156 /**
157  * Play
158  *
159  * \param p_mi the Media Player
160  * \param p_e an initialized exception pointer
161  */
162 VLC_PUBLIC_API void libvlc_media_player_play ( libvlc_media_player_t *, libvlc_exception_t * );
163
164 /**
165  * Pause
166  *
167  * \param p_mi the Media Player
168  * \param p_e an initialized exception pointer
169  */
170 VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *, libvlc_exception_t * );
171
172 /**
173  * Stop
174  *
175  * \param p_mi the Media Player
176  * \param p_e an initialized exception pointer
177  */
178 VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *, libvlc_exception_t * );
179
180 /**
181  * Set the agl handler where the media player should render its video output.
182  *
183  * \param p_mi the Media Player
184  * \param drawable the agl handler
185  * \param p_e an initialized exception pointer
186  */
187 VLC_PUBLIC_API void libvlc_media_player_set_nsobject ( libvlc_media_player_t *p_mi, void * drawable, libvlc_exception_t *p_e );
188
189 /**
190  * Get the agl handler previously set with libvlc_media_player_set_agl().
191  *
192  * \return the agl handler or 0 if none where set
193  */
194 VLC_PUBLIC_API void * libvlc_media_player_get_nsobject ( libvlc_media_player_t *p_mi );
195         
196 /**
197  * Set the agl handler where the media player should render its video output.
198  *
199  * \param p_mi the Media Player
200  * \param drawable the agl handler
201  * \param p_e an initialized exception pointer
202  */
203 VLC_PUBLIC_API void libvlc_media_player_set_agl ( libvlc_media_player_t *p_mi, uint32_t drawable, libvlc_exception_t *p_e );
204
205 /**
206  * Get the agl handler previously set with libvlc_media_player_set_agl().
207  *
208  * \return the agl handler or 0 if none where set
209  */
210 VLC_PUBLIC_API uint32_t libvlc_media_player_get_agl ( libvlc_media_player_t *p_mi );
211
212 /**
213  * Set an X Window System drawable where the media player should render its
214  * video output. If LibVLC was built without X11 output support, then this has
215  * no effects.
216  *
217  * The specified identifier must correspond to an existing Input/Output class
218  * X11 window. Pixmaps are <b>not</b> supported. The caller shall ensure that
219  * the X11 server is the same as the one the VLC instance has been configured
220  * with.
221  * If XVideo is <b>not</b> used, it is assumed that the drawable has the
222  * following properties in common with the default X11 screen: depth, scan line
223  * pad, black pixel. This is a bug.
224  *
225  * \param p_mi the Media Player
226  * \param drawable the ID of the X window
227  * \param p_e an initialized exception pointer
228  */
229 VLC_PUBLIC_API void libvlc_media_player_set_xwindow ( libvlc_media_player_t *p_mi, uint32_t drawable, libvlc_exception_t *p_e );
230
231 /**
232  * Get the X Window System window identifier previously set with
233  * libvlc_media_player_set_xwindow(). Note that this will return the identifier
234  * even if VLC is not currently using it (for instance if it is playing an
235  * audio-only input).
236  *
237  * \return an X window ID, or 0 if none where set.
238  */
239 VLC_PUBLIC_API uint32_t libvlc_media_player_get_xwindow ( libvlc_media_player_t *p_mi );
240
241 /**
242  * Set a Win32/Win64 API window handle (HWND) where the media player should
243  * render its video output. If LibVLC was built without Win32/Win64 API output
244  * support, then this has no effects.
245  *
246  * \param p_mi the Media Player
247  * \param drawable windows handle of the drawable
248  * \param p_e an initialized exception pointer
249  */
250 VLC_PUBLIC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi, void *drawable, libvlc_exception_t *p_e );
251
252 /**
253  * Get the Windows API window handle (HWND) previously set with
254  * libvlc_media_player_set_hwnd(). The handle will be returned even if LibVLC
255  * is not currently outputting any video to it.
256  *
257  * \return a window handle or NULL if there are none.
258  */
259 VLC_PUBLIC_API void *libvlc_media_player_get_hwnd ( libvlc_media_player_t *p_mi );
260
261
262
263 /** \bug This might go away ... to be replaced by a broader system */
264
265 /**
266  * Get the current movie length (in ms).
267  *
268  * \param p_mi the Media Player
269  * \param p_e an initialized exception pointer
270  * \return the movie length (in ms).
271  */
272 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_length( libvlc_media_player_t *, libvlc_exception_t *);
273
274 /**
275  * Get the current movie time (in ms).
276  *
277  * \param p_mi the Media Player
278  * \param p_e an initialized exception pointer
279  * \return the movie time (in ms).
280  */
281 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_time( libvlc_media_player_t *, libvlc_exception_t *);
282
283 /**
284  * Set the movie time (in ms).
285  *
286  * \param p_mi the Media Player
287  * \param the movie time (in ms).
288  * \param p_e an initialized exception pointer
289  */
290 VLC_PUBLIC_API void libvlc_media_player_set_time( libvlc_media_player_t *, libvlc_time_t, libvlc_exception_t *);
291
292 /**
293  * Get movie position.
294  *
295  * \param p_mi the Media Player
296  * \param p_e an initialized exception pointer
297  * \return movie position
298  */
299 VLC_PUBLIC_API float libvlc_media_player_get_position( libvlc_media_player_t *, libvlc_exception_t *);
300
301 /**
302  * Set movie position.
303  *
304  * \param p_mi the Media Player
305  * \param p_e an initialized exception pointer
306  * \return movie position
307  */
308 VLC_PUBLIC_API void libvlc_media_player_set_position( libvlc_media_player_t *, float, libvlc_exception_t *);
309
310 /**
311  * Set movie chapter
312  *
313  * \param p_mi the Media Player
314  * \param i_chapter chapter number to play
315  * \param p_e an initialized exception pointer
316  */
317 VLC_PUBLIC_API void libvlc_media_player_set_chapter( libvlc_media_player_t *, int, libvlc_exception_t *);
318
319 /**
320  * Get movie chapter
321  *
322  * \param p_mi the Media Player
323  * \param p_e an initialized exception pointer
324  * \return chapter number currently playing
325  */
326 VLC_PUBLIC_API int libvlc_media_player_get_chapter( libvlc_media_player_t *, libvlc_exception_t * );
327
328 /**
329  * Get movie chapter count
330  *
331  * \param p_mi the Media Player
332  * \param p_e an initialized exception pointer
333  * \return number of chapters in movie
334  */
335 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count( libvlc_media_player_t *, libvlc_exception_t *);
336 VLC_PUBLIC_API int libvlc_media_player_will_play        ( libvlc_media_player_t *, libvlc_exception_t *);
337
338 /**
339  * Get title chapter count
340  *
341  * \param p_mi the Media Player
342  * \param i_title title
343  * \param p_e an initialized exception pointer
344  * \return number of chapters in title
345  */
346 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count_for_title(
347                        libvlc_media_player_t *, int, libvlc_exception_t *);
348
349 /**
350  * Set movie title
351  *
352  * \param p_mi the Media Player
353  * \param i_title title number to play
354  * \param p_e an initialized exception pointer
355  */
356 VLC_PUBLIC_API void libvlc_media_player_set_title( libvlc_media_player_t *, int, libvlc_exception_t *);
357
358 /**
359  * Get movie title
360  *
361  * \param p_mi the Media Player
362  * \param p_e an initialized exception pointer
363  * \return title number currently playing
364  */
365 VLC_PUBLIC_API int libvlc_media_player_get_title( libvlc_media_player_t *, libvlc_exception_t *);
366
367 /**
368  * Get movie title count
369  *
370  * \param p_mi the Media Player
371  * \param p_e an initialized exception pointer
372  * \return title number count
373  */
374 VLC_PUBLIC_API int libvlc_media_player_get_title_count( libvlc_media_player_t *, libvlc_exception_t *);
375
376 /**
377  * Set previous chapter
378  *
379  * \param p_mi the Media Player
380  * \param p_e an initialized exception pointer
381  */
382 VLC_PUBLIC_API void libvlc_media_player_previous_chapter( libvlc_media_player_t *, libvlc_exception_t *);
383
384 /**
385  * Set next chapter
386  *
387  * \param p_mi the Media Player
388  * \param p_e an initialized exception pointer
389  */
390 VLC_PUBLIC_API void libvlc_media_player_next_chapter( libvlc_media_player_t *, libvlc_exception_t *);
391
392 /**
393  * Get movie play rate
394  *
395  * \param p_mi the Media Player
396  * \param p_e an initialized exception pointer
397  * \return movie play rate
398  */
399 VLC_PUBLIC_API float libvlc_media_player_get_rate( libvlc_media_player_t *, libvlc_exception_t *);
400
401 /**
402  * Set movie play rate
403  *
404  * \param p_mi the Media Player
405  * \param movie play rate to set
406  * \param p_e an initialized exception pointer
407  */
408 VLC_PUBLIC_API void libvlc_media_player_set_rate( libvlc_media_player_t *, float, libvlc_exception_t *);
409
410 /**
411  * Get current movie state
412  *
413  * \param p_mi the Media Player
414  * \param p_e an initialized exception pointer
415  * \return current movie state as libvlc_state_t
416  */
417 VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *, libvlc_exception_t *);
418
419 /**
420  * Get movie fps rate
421  *
422  * \param p_mi the Media Player
423  * \param p_e an initialized exception pointer
424  * \return frames per second (fps) for this playing movie
425  */
426 VLC_PUBLIC_API float libvlc_media_player_get_fps( libvlc_media_player_t *, libvlc_exception_t *);
427
428 /** end bug */
429
430 /**
431  * Does this media player have a video output?
432  *
433  * \param p_md the media player
434  * \param p_e an initialized exception pointer
435  */
436 VLC_PUBLIC_API int  libvlc_media_player_has_vout( libvlc_media_player_t *, libvlc_exception_t *);
437
438 /**
439  * Is this media player seekable?
440  *
441  * \param p_input the input
442  * \param p_e an initialized exception pointer
443  */
444 VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
445
446 /**
447  * Can this media player be paused?
448  *
449  * \param p_input the input
450  * \param p_e an initialized exception pointer
451  */
452 VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
453
454 /**
455  * Release (free) libvlc_track_description_t
456  *
457  * \param p_track_description the structure to release
458  */
459 VLC_PUBLIC_API void libvlc_track_description_release( libvlc_track_description_t *p_track_description );
460
461 /** \defgroup libvlc_video libvlc_video
462  * \ingroup libvlc_media_player
463  * LibVLC Video handling
464  * @{
465  */
466
467 /**
468  * Toggle fullscreen status on video output.
469  *
470  * \param p_mediaplayer the media player
471  * \param p_e an initialized exception pointer
472  */
473 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
474
475 /**
476  * Enable or disable fullscreen on a video output.
477  *
478  * \param p_mediaplayer the media player
479  * \param b_fullscreen boolean for fullscreen status
480  * \param p_e an initialized exception pointer
481  */
482 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *, int, libvlc_exception_t * );
483
484 /**
485  * Get current fullscreen status.
486  *
487  * \param p_mediaplayer the media player
488  * \param p_e an initialized exception pointer
489  * \return the fullscreen status (boolean)
490  */
491 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
492
493 /**
494  * Get current video height.
495  *
496  * \param p_mediaplayer the media player
497  * \param p_e an initialized exception pointer
498  * \return the video height
499  */
500 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_player_t *, libvlc_exception_t * );
501
502 /**
503  * Get current video width.
504  *
505  * \param p_mediaplayer the media player
506  * \param p_e an initialized exception pointer
507  * \return the video width
508  */
509 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_player_t *, libvlc_exception_t * );
510
511 /**
512  * Get the current video scaling factor.
513  * See also libvlc_video_set_scale().
514  *
515  * \param p_mediaplayer the media player
516  * \return the currently configured zoom factor, or 0. if the video is set
517  * to fit to the output window/drawable automatically.
518  */
519 VLC_PUBLIC_API float libvlc_video_get_scale( libvlc_media_player_t *,
520                                              libvlc_exception_t *p_e );
521
522 /**
523  * Set the video scaling factor. That is the ratio of the number of pixels on
524  * screen to the number of pixels in the original decoded video in each
525  * dimension. Zero is a special value; it will adjust the video to the output
526  * window/drawable (in windowed mode) or the entire screen.
527  *
528  * Note that not all video outputs support scaling.
529  *
530  * \param p_mediaplayer the media player
531  * \param i_factor the scaling factor, or zero
532  */
533 VLC_PUBLIC_API void libvlc_video_set_scale( libvlc_media_player_t *, float,
534                                             libvlc_exception_t *p_e );
535
536 /**
537  * Get current video aspect ratio.
538  *
539  * \param p_mediaplayer the media player
540  * \param p_e an initialized exception pointer
541  * \return the video aspect ratio
542  */
543 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *, libvlc_exception_t * );
544
545 /**
546  * Set new video aspect ratio.
547  *
548  * \param p_mediaplayer the media player
549  * \param psz_aspect new video aspect-ratio
550  * \param p_e an initialized exception pointer
551  */
552 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *, char *, libvlc_exception_t * );
553
554 /**
555  * Get current video subtitle.
556  *
557  * \param p_mediaplayer the media player
558  * \param p_e an initialized exception pointer
559  * \return the video subtitle selected
560  */
561 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *, libvlc_exception_t * );
562
563 /**
564  * Get the number of available video subtitles.
565  *
566  * \param p_mediaplayer the media player
567  * \param p_e an initialized exception pointer
568  * \return the number of available video subtitles
569  */
570 VLC_PUBLIC_API int libvlc_video_get_spu_count( libvlc_media_player_t *, libvlc_exception_t * );
571
572 /**
573  * Get the description of available video subtitles.
574  *
575  * \param p_mediaplayer the media player
576  * \param p_e an initialized exception pointer
577  * \return list containing description of available video subtitles
578  */
579 VLC_PUBLIC_API libvlc_track_description_t *
580         libvlc_video_get_spu_description( libvlc_media_player_t *, libvlc_exception_t * );
581
582 /**
583  * Set new video subtitle.
584  *
585  * \param p_mediaplayer the media player
586  * \param i_spu new video subtitle to select
587  * \param p_e an initialized exception pointer
588  */
589 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_player_t *, int , libvlc_exception_t * );
590
591 /**
592  * Set new video subtitle file.
593  *
594  * \param p_mediaplayer the media player
595  * \param psz_subtitle new video subtitle file
596  * \param p_e an initialized exception pointer
597  * \return the success status (boolean)
598  */
599 VLC_PUBLIC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *, char *, libvlc_exception_t * );
600
601 /**
602  * Get the description of available titles.
603  *
604  * \param p_mediaplayer the media player
605  * \param p_e an initialized exception pointer
606  * \return list containing description of available titles
607  */
608 VLC_PUBLIC_API libvlc_track_description_t *
609         libvlc_video_get_title_description( libvlc_media_player_t *, libvlc_exception_t * );
610
611 /**
612  * Get the description of available chapters for specific title.
613  *
614  * \param p_mediaplayer the media player
615  * \param i_title selected title
616  * \param p_e an initialized exception pointer
617  * \return list containing description of available chapter for title i_title
618  */
619 VLC_PUBLIC_API libvlc_track_description_t *
620         libvlc_video_get_chapter_description( libvlc_media_player_t *, int, libvlc_exception_t * );
621
622 /**
623  * Get current crop filter geometry.
624  *
625  * \param p_mediaplayer the media player
626  * \param p_e an initialized exception pointer
627  * \return the crop filter geometry
628  */
629 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *, libvlc_exception_t * );
630
631 /**
632  * Set new crop filter geometry.
633  *
634  * \param p_mediaplayer the media player
635  * \param psz_geometry new crop filter geometry
636  * \param p_e an initialized exception pointer
637  */
638 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_player_t *, char *, libvlc_exception_t * );
639
640 /**
641  * Toggle teletext transparent status on video output.
642  *
643  * \param p_mediaplayer the media player
644  * \param p_e an initialized exception pointer
645  */
646 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *, libvlc_exception_t * );
647
648 /**
649  * Get current teletext page requested.
650  *
651  * \param p_mediaplayer the media player
652  * \param p_e an initialized exception pointer
653  * \return the current teletext page requested.
654  */
655 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t *, libvlc_exception_t * );
656
657 /**
658  * Set new teletext page to retrieve.
659  *
660  * \param p_mediaplayer the media player
661  * \param i_page teletex page number requested
662  * \param p_e an initialized exception pointer
663  */
664 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *, int, libvlc_exception_t * );
665
666 /**
667  * Get number of available video tracks.
668  *
669  * \param p_mi media player
670  * \param p_e an initialized exception
671  * \return the number of available video tracks (int)
672  */
673 VLC_PUBLIC_API int libvlc_video_get_track_count( libvlc_media_player_t *,  libvlc_exception_t * );
674
675 /**
676  * Get the description of available video tracks.
677  *
678  * \param p_mi media player
679  * \param p_e an initialized exception
680  * \return list with description of available video tracks
681  */
682 VLC_PUBLIC_API libvlc_track_description_t *
683         libvlc_video_get_track_description( libvlc_media_player_t *,  libvlc_exception_t * );
684
685 /**
686  * Get current video track.
687  *
688  * \param p_mi media player
689  * \param p_e an initialized exception pointer
690  * \return the video track (int)
691  */
692 VLC_PUBLIC_API int libvlc_video_get_track( libvlc_media_player_t *, libvlc_exception_t * );
693
694 /**
695  * Set video track.
696  *
697  * \param p_mi media player
698  * \param i_track the track (int)
699  * \param p_e an initialized exception pointer
700  */
701 VLC_PUBLIC_API void libvlc_video_set_track( libvlc_media_player_t *, int, libvlc_exception_t * );
702
703 /**
704  * Take a snapshot of the current video window.
705  *
706  * If i_width AND i_height is 0, original size is used.
707  * If i_width XOR i_height is 0, original aspect-ratio is preserved.
708  *
709  * \param p_mi media player instance
710  * \param psz_filepath the path where to save the screenshot to
711  * \param i_width the snapshot's width
712  * \param i_height the snapshot's height
713  * \param p_e an initialized exception pointer
714  */
715 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_player_t *, const char *,unsigned int, unsigned int, libvlc_exception_t * );
716
717 /** @} video */
718
719 /** \defgroup libvlc_audio libvlc_audio
720  * \ingroup libvlc_media_player
721  * LibVLC Audio handling
722  * @{
723  */
724
725 /**
726  * Audio device types
727  */
728 typedef enum libvlc_audio_output_device_types_t {
729     libvlc_AudioOutputDevice_Error  = -1,
730     libvlc_AudioOutputDevice_Mono   =  1,
731     libvlc_AudioOutputDevice_Stereo =  2,
732     libvlc_AudioOutputDevice_2F2R   =  4,
733     libvlc_AudioOutputDevice_3F2R   =  5,
734     libvlc_AudioOutputDevice_5_1    =  6,
735     libvlc_AudioOutputDevice_6_1    =  7,
736     libvlc_AudioOutputDevice_7_1    =  8,
737     libvlc_AudioOutputDevice_SPDIF  = 10
738 } libvlc_audio_output_device_types_t;
739
740 /**
741  * Audio channels
742  */
743 typedef enum libvlc_audio_output_channel_t {
744     libvlc_AudioChannel_Error   = -1,
745     libvlc_AudioChannel_Stereo  =  1,
746     libvlc_AudioChannel_RStereo =  2,
747     libvlc_AudioChannel_Left    =  3,
748     libvlc_AudioChannel_Right   =  4,
749     libvlc_AudioChannel_Dolbys  =  5
750 } libvlc_audio_output_channel_t;
751
752
753 /**
754  * Get the list of available audio outputs
755  *
756  * \param p_instance libvlc instance
757  * \param p_e an initialized exception pointer
758  * \return list of available audio outputs, at the end free it with
759 *          \see libvlc_audio_output_list_release \see libvlc_audio_output_t
760  */
761 VLC_PUBLIC_API libvlc_audio_output_t *
762         libvlc_audio_output_list_get( libvlc_instance_t *,
763                                       libvlc_exception_t * );
764
765 /**
766  * Free the list of available audio outputs
767  *
768  * \param p_list list with audio outputs for release
769  */
770 VLC_PUBLIC_API void libvlc_audio_output_list_release( libvlc_audio_output_t * );
771
772 /**
773  * Set the audio output.
774  * Change will be applied after stop and play.
775  *
776  * \param p_instance libvlc instance
777  * \param psz_name name of audio output,
778  *               use psz_name of \see libvlc_audio_output_t
779  * \return true if function succeded
780  */
781 VLC_PUBLIC_API int libvlc_audio_output_set( libvlc_instance_t *,
782                                             const char * );
783
784 /**
785  * Get count of devices for audio output, these devices are hardware oriented
786  * like analor or digital output of sound card
787  *
788  * \param p_instance libvlc instance
789  * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
790  * \return number of devices
791  */
792 VLC_PUBLIC_API int libvlc_audio_output_device_count( libvlc_instance_t *,
793                                                      const char * );
794
795 /**
796  * Get long name of device, if not available short name given
797  *
798  * \param p_instance libvlc instance
799  * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
800  * \param i_device device index
801  * \return long name of device
802  */
803 VLC_PUBLIC_API char * libvlc_audio_output_device_longname( libvlc_instance_t *,
804                                                            const char *,
805                                                            int );
806
807 /**
808  * Get id name of device
809  *
810  * \param p_instance libvlc instance
811  * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
812  * \param i_device device index
813  * \return id name of device, use for setting device, need to be free after use
814  */
815 VLC_PUBLIC_API char * libvlc_audio_output_device_id( libvlc_instance_t *,
816                                                      const char *,
817                                                      int );
818
819 /**
820  * Set device for using
821  *
822  * \param p_instance libvlc instance
823  * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
824  * \param psz_device_id device
825  */
826 VLC_PUBLIC_API void libvlc_audio_output_device_set( libvlc_instance_t *,
827                                                     const char *,
828                                                     const char * );
829
830 /**
831  * Get current audio device type. Device type describes something like
832  * character of output sound - stereo sound, 2.1, 5.1 etc
833  *
834  * \param p_instance vlc instance
835  * \param p_e an initialized exception pointer
836  * \return the audio devices type \see libvlc_audio_output_device_types_t
837  */
838 VLC_PUBLIC_API int libvlc_audio_output_get_device_type(
839         libvlc_instance_t *, libvlc_exception_t * );
840
841 /**
842  * Set current audio device type.
843  *
844  * \param p_instance vlc instance
845  * \param device_type the audio device type,
846           according to \see libvlc_audio_output_device_types_t
847  * \param p_e an initialized exception pointer
848  */
849 VLC_PUBLIC_API void libvlc_audio_output_set_device_type( libvlc_instance_t *,
850                                                          int,
851                                                          libvlc_exception_t * );
852
853
854 /**
855  * Toggle mute status.
856  *
857  * \param p_instance libvlc instance
858  * \param p_e an initialized exception pointer
859  */
860 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
861
862 /**
863  * Get current mute status.
864  *
865  * \param p_instance libvlc instance
866  * \param p_e an initialized exception pointer
867  * \return the mute status (boolean)
868  */
869 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
870
871 /**
872  * Set mute status.
873  *
874  * \param p_instance libvlc instance
875  * \param status If status is true then mute, otherwise unmute
876  * \param p_e an initialized exception pointer
877  */
878 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, int , libvlc_exception_t * );
879
880 /**
881  * Get current audio level.
882  *
883  * \param p_instance libvlc instance
884  * \param p_e an initialized exception pointer
885  * \return the audio level (int)
886  */
887 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
888
889 /**
890  * Set current audio level.
891  *
892  * \param p_instance libvlc instance
893  * \param i_volume the volume (int)
894  * \param p_e an initialized exception pointer
895  */
896 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
897
898 /**
899  * Get number of available audio tracks.
900  *
901  * \param p_mi media player
902  * \param p_e an initialized exception
903  * \return the number of available audio tracks (int)
904  */
905 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *,  libvlc_exception_t * );
906
907  /**
908  * Get the description of available audio tracks.
909  *
910  * \param p_mi media player
911  * \param p_e an initialized exception
912  * \return list with description of available audio tracks
913  */
914 VLC_PUBLIC_API libvlc_track_description_t *
915         libvlc_audio_get_track_description( libvlc_media_player_t *,  libvlc_exception_t * );
916
917 /**
918  * Get current audio track.
919  *
920  * \param p_mi media player
921  * \param p_e an initialized exception pointer
922  * \return the audio track (int)
923  */
924 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *, libvlc_exception_t * );
925
926 /**
927  * Set current audio track.
928  *
929  * \param p_mi media player
930  * \param i_track the track (int)
931  * \param p_e an initialized exception pointer
932  */
933 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_player_t *, int, libvlc_exception_t * );
934
935 /**
936  * Get current audio channel.
937  *
938  * \param p_instance vlc instance
939  * \param p_e an initialized exception pointer
940  * \return the audio channel \see libvlc_audio_output_channel_t
941  */
942 VLC_PUBLIC_API int
943     libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
944
945 /**
946  * Set current audio channel.
947  *
948  * \param p_instance vlc instance
949  * \param channel the audio channel, \see libvlc_audio_output_channel_t
950  * \param p_e an initialized exception pointer
951  */
952 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *,
953                                               int,
954                                               libvlc_exception_t * );
955
956 /** @} audio */
957
958 /** @} media_player */
959
960 #endif /* VLC_LIBVLC_MEDIA_PLAYER_H */