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