1 /*****************************************************************************
2 * libvlc.h: libvlc_* new external API
3 *****************************************************************************
4 * Copyright (C) 1998-2005 the VideoLAN team
5 * $Id: vlc.h 13701 2005-12-12 17:58:56Z zorglub $
7 * Authors: Clément Stenac <zorglub@videolan.org>
8 * Jean-Paul Saman <jpsaman _at_ m2x _dot_ nl>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
26 * \defgroup libvlc Libvlc
27 * This is libvlc, the base library of the VLC program.
37 #include <vlc/libvlc_structures.h>
43 /*****************************************************************************
45 *****************************************************************************/
46 /** defgroup libvlc_exception Exceptions
48 * LibVLC Exceptions handling
53 * Initialize an exception structure. This can be called several times to reuse
54 * an exception structure.
55 * \param p_exception the exception to initialize
57 VLC_PUBLIC_API void libvlc_exception_init( libvlc_exception_t *p_exception );
60 * Has an exception been raised ?
61 * \param p_exception the exception to query
62 * \return 0 if no exception raised, 1 else
64 VLC_PUBLIC_API int libvlc_exception_raised( libvlc_exception_t *p_exception );
68 * \param p_exception the exception to raise
69 * \param psz_message the exception message
71 VLC_PUBLIC_API void libvlc_exception_raise( libvlc_exception_t *p_exception, const char *psz_format, ... );
74 * Clear an exception object so it can be reused.
75 * The exception object must be initialized
76 * \param p_exception the exception to clear
78 VLC_PUBLIC_API void libvlc_exception_clear( libvlc_exception_t * );
81 * Get exception message
82 * \param p_exception the exception to query
83 * \return the exception message or NULL if not applicable (exception not raised
86 VLC_PUBLIC_API char* libvlc_exception_get_message( libvlc_exception_t *p_exception );
90 /*****************************************************************************
92 *****************************************************************************/
94 /** defgroup libvlc_core Core
101 * Create an initialized libvlc instance
102 * \param argc the number of arguments
103 * \param argv command-line-type arguments
104 * \param exception an initialized exception pointer
106 VLC_PUBLIC_API libvlc_instance_t * libvlc_new( int , char **, libvlc_exception_t *);
109 * Returns a libvlc instance identifier for legacy APIs. Use of this
110 * function is discouraged, you should convert your program to use the
112 * \param p_instance the instance
114 VLC_PUBLIC_API int libvlc_get_vlc_id( libvlc_instance_t *p_instance );
117 * Destroy a libvlc instance.
118 * \param p_instance the instance to destroy
120 VLC_PUBLIC_API void libvlc_destroy( libvlc_instance_t *, libvlc_exception_t * );
125 /*****************************************************************************
127 *****************************************************************************/
128 /** defgroup libvlc_media_descriptor Media Descriptor
130 * LibVLC Media Descriptor
135 * Create a media descriptor with the given mrl.
136 * \param p_instance the instance
137 * \param psz_mrl the mrl to read
139 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_descriptor_new(
140 libvlc_instance_t *p_instance,
141 const char * psz_mrl,
142 libvlc_exception_t *p_e );
144 VLC_PUBLIC_API void libvlc_media_descriptor_retain(
145 libvlc_media_descriptor_t *p_meta_desc );
147 VLC_PUBLIC_API void libvlc_media_descriptor_release(
148 libvlc_media_descriptor_t *p_meta_desc );
150 VLC_PUBLIC_API char * libvlc_media_descriptor_get_mrl( libvlc_media_descriptor_t * p_md,
151 libvlc_exception_t * p_e );
154 * Read the meta of the media descriptor.
155 * \param p_meta_desc the media descriptor to read
156 * \param p_meta_desc the meta to read
158 VLC_PUBLIC_API char * libvlc_media_descriptor_get_meta(
159 libvlc_media_descriptor_t *p_meta_desc,
160 libvlc_meta_t e_meta,
161 libvlc_exception_t *p_e );
165 /*****************************************************************************
167 *****************************************************************************/
168 /** defgroup libvlc_playlist Playlist
170 * LibVLC Playlist handling
177 VLC_PUBLIC_API void libvlc_playlist_loop( libvlc_instance_t* , vlc_bool_t,
178 libvlc_exception_t * );
181 * Start playing. You can give some additionnal playlist item options
182 * that will be added to the item before playing it.
183 * \param p_instance the instance
184 * \param i_id the item to play. If this is a negative number, the next
185 * item will be selected. Else, the item with the given ID will be played
186 * \param i_options the number of options to add to the item
187 * \param ppsz_options the options to add to the item
188 * \param p_exception an initialized exception
190 VLC_PUBLIC_API void libvlc_playlist_play( libvlc_instance_t*, int, int, char **,
191 libvlc_exception_t * );
194 * Pause a running playlist, resume if it was stopped
195 * \param p_instance the instance to pause
196 * \param p_exception an initialized exception
198 VLC_PUBLIC_API void libvlc_playlist_pause( libvlc_instance_t *, libvlc_exception_t * );
201 * Checks if the playlist is running
202 * \param p_instance the instance
203 * \param p_exception an initialized exception
204 * \return 0 if the playlist is stopped or paused, 1 if it is running
206 VLC_PUBLIC_API int libvlc_playlist_isplaying( libvlc_instance_t *, libvlc_exception_t * );
209 * Get the number of items in the playlist
210 * \param p_instance the instance
211 * \param p_exception an initialized exception
212 * \return the number of items
214 VLC_PUBLIC_API int libvlc_playlist_items_count( libvlc_instance_t *, libvlc_exception_t * );
217 * Lock the playlist instance
218 * \param p_instance the instance
220 VLC_PUBLIC_API void libvlc_playlist_lock( libvlc_instance_t * );
223 * Unlock the playlist instance
224 * \param p_instance the instance
226 VLC_PUBLIC_API void libvlc_playlist_unlock( libvlc_instance_t * );
230 * \param p_instance the instance to stop
231 * \param p_exception an initialized exception
233 VLC_PUBLIC_API void libvlc_playlist_stop( libvlc_instance_t *, libvlc_exception_t * );
236 * Go to next playlist item (starts playback if it was stopped)
237 * \param p_instance the instance to use
238 * \param p_exception an initialized exception
240 VLC_PUBLIC_API void libvlc_playlist_next( libvlc_instance_t *, libvlc_exception_t * );
243 * Go to previous playlist item (starts playback if it was stopped)
244 * \param p_instance the instance to use
245 * \param p_exception an initialized exception
247 VLC_PUBLIC_API void libvlc_playlist_prev( libvlc_instance_t *, libvlc_exception_t * );
250 * Remove all playlist items
251 * \param p_instance the instance
252 * \param p_exception an initialized exception
254 VLC_PUBLIC_API void libvlc_playlist_clear( libvlc_instance_t *, libvlc_exception_t * );
257 * Add an item at the end of the playlist
258 * If you need more advanced options, \see libvlc_playlist_add_extended
259 * \param p_instance the instance
260 * \param psz_uri the URI to open, using VLC format
261 * \param psz_name a name that you might want to give or NULL
262 * \return the identifier of the new item
264 VLC_PUBLIC_API int libvlc_playlist_add( libvlc_instance_t *, const char *, const char *,
265 libvlc_exception_t * );
268 * Add an item at the end of the playlist, with additional input options
269 * \param p_instance the instance
270 * \param psz_uri the URI to open, using VLC format
271 * \param psz_name a name that you might want to give or NULL
272 * \param i_options the number of options to add
273 * \param ppsz_options strings representing the options to add
274 * \param p_exception an initialized exception
275 * \return the identifier of the new item
277 VLC_PUBLIC_API int libvlc_playlist_add_extended( libvlc_instance_t *, const char *,
278 const char *, int, const char **,
279 libvlc_exception_t * );
282 * Delete the playlist item with the given ID.
283 * \param p_instance the instance
284 * \param i_id the id to remove
285 * \param p_exception an initialized exception
288 VLC_PUBLIC_API int libvlc_playlist_delete_item( libvlc_instance_t *, int,
289 libvlc_exception_t * );
291 /* Get the input that is currently being played by the playlist
292 * \param p_instance the instance to use
293 * \param p_exception an initialized excecption
294 * \return an input object
296 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_playlist_get_media_instance(
297 libvlc_instance_t *, libvlc_exception_t * );
301 /*****************************************************************************
303 *****************************************************************************/
304 /** defgroup libvlc_media_instance Media Instance
306 * LibVLC Media Instance
310 /** Create an empty Media Instance object
311 * \param p_libvlc_instance the libvlc instance in which the Media Instance
312 * should be (not used for now).
314 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new( libvlc_instance_t *, libvlc_exception_t * );
316 /** Create a Media Instance object from a Media Descriptor
317 * \param p_md the media descriptor. Afterwards the p_md can safely be
320 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new_from_media_descriptor( libvlc_media_descriptor_t *, libvlc_exception_t * );
322 /** Release a media_instance after use
323 * \param p_mi the Media Instance to free
325 VLC_PUBLIC_API void libvlc_media_instance_release( libvlc_media_instance_t * );
326 VLC_PUBLIC_API void libvlc_media_instance_retain( libvlc_media_instance_t * );
328 /** Set the media descriptor that will be used by the media_instance. If any,
329 * previous md will be released.
330 * \param p_mi the Media Instance
331 * \param p_md the Media Descriptor. Afterwards the p_md can safely be
334 VLC_PUBLIC_API void libvlc_media_instance_set_media_descriptor( libvlc_media_instance_t *, libvlc_media_descriptor_t *, libvlc_exception_t * );
336 /** Get the media descriptor used by the media_instance (if any). A copy of
337 * the md is returned. NULL is returned if no media instance is associated.
338 * \param p_mi the Media Instance
340 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_instance_get_media_descriptor( libvlc_media_instance_t *, libvlc_exception_t * );
342 /** Get the Event Manager from which the media instance send event.
343 * \param p_mi the Media Instance
345 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_instance_event_manager ( libvlc_media_instance_t *, libvlc_exception_t * );
347 VLC_PUBLIC_API void libvlc_media_instance_play ( libvlc_media_instance_t *, libvlc_exception_t * );
348 VLC_PUBLIC_API void libvlc_media_instance_pause ( libvlc_media_instance_t *, libvlc_exception_t * );
349 VLC_PUBLIC_API void libvlc_media_instance_stop ( libvlc_media_instance_t *, libvlc_exception_t * );
351 VLC_PUBLIC_API void libvlc_media_instance_set_drawable ( libvlc_media_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
353 /// \bug This might go away ... to be replaced by a broader system
354 VLC_PUBLIC_API vlc_int64_t libvlc_media_instance_get_length ( libvlc_media_instance_t *, libvlc_exception_t *);
355 VLC_PUBLIC_API vlc_int64_t libvlc_media_instance_get_time ( libvlc_media_instance_t *, libvlc_exception_t *);
356 VLC_PUBLIC_API void libvlc_media_instance_set_time ( libvlc_media_instance_t *, vlc_int64_t, libvlc_exception_t *);
357 VLC_PUBLIC_API float libvlc_media_instance_get_position ( libvlc_media_instance_t *, libvlc_exception_t *);
358 VLC_PUBLIC_API void libvlc_media_instance_set_position ( libvlc_media_instance_t *, float, libvlc_exception_t *);
359 VLC_PUBLIC_API vlc_bool_t libvlc_media_instance_will_play ( libvlc_media_instance_t *, libvlc_exception_t *);
360 VLC_PUBLIC_API float libvlc_media_instance_get_rate ( libvlc_media_instance_t *, libvlc_exception_t *);
361 VLC_PUBLIC_API void libvlc_media_instance_set_rate ( libvlc_media_instance_t *, float, libvlc_exception_t *);
362 VLC_PUBLIC_API int libvlc_media_instance_get_state ( libvlc_media_instance_t *, libvlc_exception_t *);
365 * Does this input have a video output ?
366 * \param p_input the input
367 * \param p_exception an initialized exception
369 VLC_PUBLIC_API vlc_bool_t libvlc_media_instance_has_vout( libvlc_media_instance_t *, libvlc_exception_t *);
370 VLC_PUBLIC_API float libvlc_media_instance_get_fps( libvlc_media_instance_t *, libvlc_exception_t *);
375 /*****************************************************************************
377 *****************************************************************************/
378 /** defgroup libvlc_tag_query Tag Query
383 VLC_PUBLIC_API libvlc_tag_query_t *
384 libvlc_tag_query_new( libvlc_instance_t *, libvlc_exception_t * );
387 libvlc_tag_query_release( libvlc_tag_query_t * );
390 libvlc_tag_query_retain( libvlc_tag_query_t * );
392 VLC_PUBLIC_API vlc_bool_t
393 libvlc_tag_query_match( libvlc_tag_query_t *, libvlc_media_descriptor_t *,
394 libvlc_exception_t * );
398 /*****************************************************************************
400 *****************************************************************************/
401 /** defgroup libvlc_media_list MediaList
406 VLC_PUBLIC_API libvlc_media_list_t *
407 libvlc_media_list_new( libvlc_instance_t *, libvlc_exception_t * );
410 libvlc_media_list_release( libvlc_media_list_t * );
413 libvlc_media_list_retain( libvlc_media_list_t * );
416 libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist,
417 const char * psz_uri,
418 libvlc_exception_t * p_e );
421 libvlc_media_list_set_name( libvlc_media_list_t *,
422 const char * psz_name,
423 libvlc_exception_t *);
425 VLC_PUBLIC_API char *
426 libvlc_media_list_name( libvlc_media_list_t *,
427 libvlc_exception_t *);
430 libvlc_media_list_add_media_descriptor( libvlc_media_list_t *,
431 libvlc_media_descriptor_t *,
432 libvlc_exception_t * );
434 libvlc_media_list_insert_media_descriptor( libvlc_media_list_t *,
435 libvlc_media_descriptor_t *,
437 libvlc_exception_t * );
439 libvlc_media_list_remove_index( libvlc_media_list_t *, int,
440 libvlc_exception_t * );
443 libvlc_media_list_count( libvlc_media_list_t * p_mlist,
444 libvlc_exception_t * p_e );
446 VLC_PUBLIC_API libvlc_media_descriptor_t *
447 libvlc_media_list_item_at_index( libvlc_media_list_t *, int,
448 libvlc_exception_t * );
450 libvlc_media_list_index_of_item( libvlc_media_list_t *,
451 libvlc_media_descriptor_t *,
452 libvlc_exception_t * );
455 libvlc_media_list_lock( libvlc_media_list_t * );
457 libvlc_media_list_unlock( libvlc_media_list_t * );
459 VLC_PUBLIC_API libvlc_event_manager_t *
460 libvlc_media_list_event_manager( libvlc_media_list_t *,
461 libvlc_exception_t * );
463 VLC_PUBLIC_API libvlc_media_list_t *
464 libvlc_media_list_dynamic_sublist( libvlc_media_list_t *,
465 libvlc_tag_query_t *,
466 libvlc_exception_t * );
470 /*****************************************************************************
472 *****************************************************************************/
473 /** defgroup libvlc_media_library Media Library
475 * LibVLC Media Library
478 VLC_PUBLIC_API libvlc_media_library_t *
479 libvlc_media_library_new( libvlc_instance_t * p_inst,
480 libvlc_exception_t * p_e );
482 libvlc_media_library_release( libvlc_media_library_t * p_mlib );
484 libvlc_media_library_retain( libvlc_media_library_t * p_mlib );
488 libvlc_media_library_load( libvlc_media_library_t * p_mlib,
489 libvlc_exception_t * p_e );
492 libvlc_media_library_save( libvlc_media_library_t * p_mlib,
493 libvlc_exception_t * p_e );
495 VLC_PUBLIC_API libvlc_media_list_t *
496 libvlc_media_library_media_list( libvlc_media_library_t * p_mlib,
497 libvlc_exception_t * p_e );
502 /*****************************************************************************
504 *****************************************************************************/
505 /** defgroup libvlc_media_list_player MediaListPlayer
507 * LibVLC Media List Player
510 VLC_PUBLIC_API libvlc_media_list_player_t *
511 libvlc_media_list_player_new( libvlc_instance_t * p_instance,
512 libvlc_exception_t * p_e );
514 libvlc_media_list_player_release( libvlc_media_list_player_t * p_mlp );
517 libvlc_media_list_player_set_media_instance(
518 libvlc_media_list_player_t * p_mlp,
519 libvlc_media_instance_t * p_mi,
520 libvlc_exception_t * p_e );
523 libvlc_media_list_player_set_media_list(
524 libvlc_media_list_player_t * p_mlp,
525 libvlc_media_list_t * p_mlist,
526 libvlc_exception_t * p_e );
529 libvlc_media_list_player_play( libvlc_media_list_player_t * p_mlp,
530 libvlc_exception_t * p_e );
533 libvlc_media_list_player_play_item_at_index(
534 libvlc_media_list_player_t * p_mlp,
536 libvlc_exception_t * p_e );
539 libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp,
540 libvlc_exception_t * p_e );
542 libvlc_media_list_player_next( libvlc_media_list_player_t * p_mlp,
543 libvlc_exception_t * p_e );
547 /** defgroup libvlc_video Video
549 * LibVLC Video handling
554 * Does this input have a video output ?
555 * \param p_input the input
556 * \param p_exception an initialized exception
558 VLC_PUBLIC_API vlc_bool_t libvlc_input_has_vout( libvlc_media_instance_t *, libvlc_exception_t *);
559 VLC_PUBLIC_API float libvlc_input_get_fps( libvlc_media_instance_t *, libvlc_exception_t *);
562 * Toggle fullscreen status on video output
563 * \param p_input the input
564 * \param p_exception an initialized exception
566 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_instance_t *, libvlc_exception_t * );
569 * Enable or disable fullscreen on a video output
570 * \param p_input the input
571 * \param b_fullscreen boolean for fullscreen status
572 * \param p_exception an initialized exception
574 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_instance_t *, int, libvlc_exception_t * );
577 * Get current fullscreen status
578 * \param p_input the input
579 * \param p_exception an initialized exception
580 * \return the fullscreen status (boolean)
582 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_instance_t *, libvlc_exception_t * );
585 * Get current video height
586 * \param p_input the input
587 * \param p_exception an initialized exception
588 * \return the video height
590 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_instance_t *, libvlc_exception_t * );
593 * Get current video width
594 * \param p_input the input
595 * \param p_exception an initialized exception
596 * \return the video width
598 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_instance_t *, libvlc_exception_t * );
601 * Get current video aspect ratio
602 * \param p_input the input
603 * \param p_exception an initialized exception
604 * \return the video aspect ratio
606 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_instance_t *, libvlc_exception_t * );
609 * Set new video aspect ratio
610 * \param p_input the input
611 * \param psz_aspect new video aspect-ratio
612 * \param p_exception an initialized exception
614 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_instance_t *, char *, libvlc_exception_t * );
617 * Get current video subtitle
618 * \param p_input the input
619 * \param p_exception an initialized exception
620 * \return the video subtitle selected
622 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_instance_t *, libvlc_exception_t * );
625 * Set new video subtitle
626 * \param p_input the input
627 * \param i_spu new video subtitle to select
628 * \param p_exception an initialized exception
630 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_instance_t *, int , libvlc_exception_t * );
633 * Get current crop filter geometry
634 * \param p_input the input
635 * \param p_exception an initialized exception
636 * \return the crop filter geometry
638 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_instance_t *, libvlc_exception_t * );
641 * Set new crop filter geometry
642 * \param p_input the input
643 * \param psz_geometry new crop filter geometry
644 * \param p_exception an initialized exception
646 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_instance_t *, char *, libvlc_exception_t * );
649 * Get current teletext page requested.
650 * \param p_input the input
651 * \param p_exception an initialized exception
652 * \return the current teletext page requested.
654 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_instance_t *, libvlc_exception_t * );
657 * Set new teletext page to retrieve
658 * \param p_input the input
659 * \param i_page teletex page number requested
660 * \param p_exception an initialized exception
662 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_instance_t *, int, libvlc_exception_t * );
665 * Take a snapshot of the current video window
666 * \param p_input the input
667 * \param psz_filepath the path where to save the screenshot to
668 * \param p_exception an initialized exception
670 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_instance_t *, char *, libvlc_exception_t * );
672 VLC_PUBLIC_API int libvlc_video_destroy( libvlc_media_instance_t *, libvlc_exception_t *);
675 * Resize the current video output window
676 * \param p_instance libvlc instance
677 * \param width new width for video output window
678 * \param height new height for video output window
679 * \param p_exception an initialized exception
680 * \return the success status (boolean)
682 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_instance_t *, int, int, libvlc_exception_t *);
685 * change the parent for the current the video output
686 * \param p_instance libvlc instance
687 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
688 * \param p_exception an initialized exception
689 * \return the success status (boolean)
691 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
694 * Tell windowless video output to redraw rectangular area (MacOS X only)
695 * \param p_instance libvlc instance
696 * \param area coordinates within video drawable
697 * \param p_exception an initialized exception
699 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_instance_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
702 * Set the default video output parent
703 * this settings will be used as default for all video outputs
704 * \param p_instance libvlc instance
705 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
706 * \param p_exception an initialized exception
708 VLC_PUBLIC_API void libvlc_video_set_parent( libvlc_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
711 * Set the default video output parent
712 * this settings will be used as default for all video outputs
713 * \param p_instance libvlc instance
714 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
715 * \param p_exception an initialized exception
717 VLC_PUBLIC_API libvlc_drawable_t libvlc_video_get_parent( libvlc_instance_t *, libvlc_exception_t * );
720 * Set the default video output size
721 * this settings will be used as default for all video outputs
722 * \param p_instance libvlc instance
723 * \param width new width for video drawable
724 * \param height new height for video drawable
725 * \param p_exception an initialized exception
727 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
730 * Set the default video output viewport for a windowless video output (MacOS X only)
731 * this settings will be used as default for all video outputs
732 * \param p_instance libvlc instance
733 * \param view coordinates within video drawable
734 * \param clip coordinates within video drawable
735 * \param p_exception an initialized exception
737 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
741 /** defgroup libvlc_audio Audio
743 * LibVLC Audio handling
749 * \param p_instance libvlc instance
750 * \param p_exception an initialized exception
753 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
756 * Get current mute status
757 * \param p_instance libvlc instance
758 * \param p_exception an initialized exception
759 * \return the mute status (boolean)
761 VLC_PUBLIC_API vlc_bool_t libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
765 * \param p_instance libvlc instance
766 * \param status If status is VLC_TRUE then mute, otherwise unmute
767 * \param p_exception an initialized exception
770 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, vlc_bool_t , libvlc_exception_t * );
773 * Get current audio level
774 * \param p_instance libvlc instance
775 * \param p_exception an initialized exception
776 * \return the audio level (int)
778 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
781 * Set current audio level
782 * \param p_instance libvlc instance
783 * \param i_volume the volume (int)
784 * \param p_exception an initialized exception
786 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
789 + * Get current audio track
790 + * \param p_input input instance
791 + * \param p_exception an initialized exception
792 + * \return the audio track (int)
794 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_instance_t *, libvlc_exception_t * );
797 * Set current audio track
798 * \param p_input input instance
799 * \param i_track the track (int)
800 * \param p_exception an initialized exception
802 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_instance_t *, int, libvlc_exception_t * );
805 * Get current audio channel
806 * \param p_instance input instance
807 * \param p_exception an initialized exception
808 * \return the audio channel (int)
810 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
813 * Set current audio channel
814 * \param p_instance input instance
815 * \param i_channel the audio channel (int)
816 * \param p_exception an initialized exception
818 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
822 /*****************************************************************************
823 * Services/Media Discovery
824 *****************************************************************************/
825 /** defgroup libvlc_media_discoverer Media Discoverer
827 * LibVLC Media Discoverer
831 VLC_PUBLIC_API libvlc_media_discoverer_t *
832 libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
833 const char * psz_name,
834 libvlc_exception_t * p_e );
835 VLC_PUBLIC_API void libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
836 VLC_PUBLIC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
838 VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( );
842 /*****************************************************************************
844 *****************************************************************************/
845 /** defgroup libvlc_vlm VLM
852 * Add a broadcast, with one input
853 * \param p_instance the instance
854 * \param psz_name the name of the new broadcast
855 * \param psz_input the input MRL
856 * \param psz_output the output MRL (the parameter to the "sout" variable)
857 * \param i_options number of additional options
858 * \param ppsz_options additional options
859 * \param b_enabled boolean for enabling the new broadcast
860 * \param b_loop Should this broadcast be played in loop ?
861 * \param p_exception an initialized exception
863 VLC_PUBLIC_API void libvlc_vlm_add_broadcast( libvlc_instance_t *, char *, char *, char* ,
864 int, char **, int, int, libvlc_exception_t * );
867 * Delete a media (vod or broadcast)
868 * \param p_instance the instance
869 * \param psz_name the media to delete
870 * \param p_exception an initialized exception
872 VLC_PUBLIC_API void libvlc_vlm_del_media( libvlc_instance_t *, char *, libvlc_exception_t * );
875 * Enable or disable a media (vod or broadcast)
876 * \param p_instance the instance
877 * \param psz_name the media to work on
878 * \param b_enabled the new status
879 * \param p_exception an initialized exception
881 VLC_PUBLIC_API void libvlc_vlm_set_enabled( libvlc_instance_t *, char *, int,
882 libvlc_exception_t *);
885 * Set the output for a media
886 * \param p_instance the instance
887 * \param psz_name the media to work on
888 * \param psz_output the output MRL (the parameter to the "sout" variable)
889 * \param p_exception an initialized exception
891 VLC_PUBLIC_API void libvlc_vlm_set_output( libvlc_instance_t *, char *, char*,
892 libvlc_exception_t *);
895 * Set a media's input MRL. This will delete all existing inputs and
896 * add the specified one.
897 * \param p_instance the instance
898 * \param psz_name the media to work on
899 * \param psz_input the input MRL
900 * \param p_exception an initialized exception
902 VLC_PUBLIC_API void libvlc_vlm_set_input( libvlc_instance_t *, char *, char*,
903 libvlc_exception_t *);
906 * Add a media's input MRL. This will add the specified one.
907 * \param p_instance the instance
908 * \param psz_name the media to work on
909 * \param psz_input the input MRL
910 * \param p_exception an initialized exception
912 VLC_PUBLIC_API void libvlc_vlm_add_input( libvlc_instance_t *, char *, char *,
913 libvlc_exception_t *p_exception );
915 * Set output for a media
916 * \param p_instance the instance
917 * \param psz_name the media to work on
918 * \param b_loop the new status
919 * \param p_exception an initialized exception
921 VLC_PUBLIC_API void libvlc_vlm_set_loop( libvlc_instance_t *, char *, int,
922 libvlc_exception_t *);
925 * Edit the parameters of a media. This will delete all existing inputs and
926 * add the specified one.
927 * \param p_instance the instance
928 * \param psz_name the name of the new broadcast
929 * \param psz_input the input MRL
930 * \param psz_output the output MRL (the parameter to the "sout" variable)
931 * \param i_options number of additional options
932 * \param ppsz_options additional options
933 * \param b_enabled boolean for enabling the new broadcast
934 * \param b_loop Should this broadcast be played in loop ?
935 * \param p_exception an initialized exception
937 VLC_PUBLIC_API void libvlc_vlm_change_media( libvlc_instance_t *, char *, char *, char* ,
938 int, char **, int, int, libvlc_exception_t * );
941 * Plays the named broadcast.
942 * \param p_instance the instance
943 * \param psz_name the name of the broadcast
944 * \param p_exception an initialized exception
946 VLC_PUBLIC_API void libvlc_vlm_play_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
949 * Stops the named broadcast.
950 * \param p_instance the instance
951 * \param psz_name the name of the broadcast
952 * \param p_exception an initialized exception
954 VLC_PUBLIC_API void libvlc_vlm_stop_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
957 * Pauses the named broadcast.
958 * \param p_instance the instance
959 * \param psz_name the name of the broadcast
960 * \param p_exception an initialized exception
962 VLC_PUBLIC_API void libvlc_vlm_pause_media( libvlc_instance_t *, char *, libvlc_exception_t * );
965 * Seeks in the named broadcast.
966 * \param p_instance the instance
967 * \param psz_name the name of the broadcast
968 * \param f_percentage the percentage to seek to
969 * \param p_exception an initialized exception
971 VLC_PUBLIC_API void libvlc_vlm_seek_media( libvlc_instance_t *, char *,
972 float, libvlc_exception_t * );
975 * Return information of the named broadcast.
976 * \param p_instance the instance
977 * \param psz_name the name of the broadcast
978 * \param p_exception an initialized exception
980 VLC_PUBLIC_API char* libvlc_vlm_show_media( libvlc_instance_t *, char *, libvlc_exception_t * );
982 #define LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( attr, returnType, getType, default)\
983 returnType libvlc_vlm_get_media_## attr( libvlc_instance_t *, \
984 char *, int , libvlc_exception_t * );
986 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( position, float, Float, -1);
987 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( time, int, Integer, -1);
988 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( length, int, Integer, -1);
989 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( rate, int, Integer, -1);
990 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( title, int, Integer, 0);
991 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( chapter, int, Integer, 0);
992 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( seekable, int, Bool, 0);
994 #undef LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
998 /*****************************************************************************
999 * Message log handling
1000 *****************************************************************************/
1002 /** defgroup libvlc_log Log
1004 * LibVLC Message Logging
1009 * Returns the VLC messaging verbosity level
1010 * \param p_instance libvlc instance
1011 * \param exception an initialized exception pointer
1013 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
1014 libvlc_exception_t *p_e );
1017 * Set the VLC messaging verbosity level
1018 * \param p_log libvlc log instance
1019 * \param exception an initialized exception pointer
1021 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
1022 libvlc_exception_t *p_e );
1025 * Open an instance to VLC message log
1026 * \param p_instance libvlc instance
1027 * \param exception an initialized exception pointer
1029 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( const libvlc_instance_t *, libvlc_exception_t *);
1032 * Close an instance of VLC message log
1033 * \param p_log libvlc log instance
1034 * \param exception an initialized exception pointer
1036 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
1039 * Returns the number of messages in log
1040 * \param p_log libvlc log instance
1041 * \param exception an initialized exception pointer
1043 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
1046 * Clear all messages in log
1047 * the log should be cleared on a regular basis to avoid clogging
1048 * \param p_log libvlc log instance
1049 * \param exception an initialized exception pointer
1051 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
1054 * Allocate and returns a new iterator to messages in log
1055 * \param p_log libvlc log instance
1056 * \param exception an initialized exception pointer
1058 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
1061 * Releases a previoulsy allocated iterator
1062 * \param p_log libvlc log iterator
1063 * \param exception an initialized exception pointer
1065 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1068 * Returns whether log iterator has more messages
1069 * \param p_log libvlc log iterator
1070 * \param exception an initialized exception pointer
1072 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1075 * Returns next log message
1076 * the content of message must not be freed
1077 * \param p_log libvlc log iterator
1078 * \param exception an initialized exception pointer
1080 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
1081 struct libvlc_log_message_t *buffer,
1082 libvlc_exception_t *p_e );
1086 /*****************************************************************************
1088 *****************************************************************************/
1090 /** defgroup libvlc_callbacks Callbacks
1097 * Register for an event notification
1098 * \param p_event_manager the event manager to which you want to attach to
1099 * Generally it is obtained by vlc_my_object_event_manager() where my_object
1100 * Is the object you want to listen to.
1101 * \param i_event_type the desired event to which we want to listen
1102 * \param f_callback the function to call when i_event_type occurs
1103 * \param user_data user provided data to carry with the event
1104 * \param p_e an initialized exception pointer
1106 VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
1107 libvlc_event_type_t i_event_type,
1108 libvlc_callback_t f_callback,
1110 libvlc_exception_t *p_e );
1113 * Unregister an event notification
1114 * \param p_event_manager the event manager
1115 * \param i_event_type the desired event to which we want to unregister
1116 * \param f_callback the function to call when i_event_type occurs
1117 * \param p_e an initialized exception pointer
1119 VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
1120 libvlc_event_type_t i_event_type,
1121 libvlc_callback_t f_callback,
1123 libvlc_exception_t *p_e );
1127 * Get an event type name
1128 * \param i_event_type the desired event
1130 #define libvlc_event_type_name(a) #a
1139 #endif /* <vlc/libvlc.h> */