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