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 * );
124 /*****************************************************************************
126 *****************************************************************************/
127 /** defgroup libvlc_tree Tree
129 * LibVLC Tree. A tree holds an item plus several subtrees.
132 VLC_PUBLIC_API libvlc_tree_t *
133 libvlc_tree_new_with_media_list_as_item( libvlc_media_list_t * p_mlist,
134 libvlc_exception_t * p_e );
136 VLC_PUBLIC_API libvlc_tree_t *
137 libvlc_tree_new_with_string_as_item( const char * psz,
138 libvlc_exception_t * p_e );
140 libvlc_tree_release( libvlc_tree_t * p_tree );
143 libvlc_tree_retain( libvlc_tree_t * p_tree );
145 VLC_PUBLIC_API char *
146 libvlc_tree_item_as_string( libvlc_tree_t * p_tree,
147 libvlc_exception_t * p_e );
149 VLC_PUBLIC_API libvlc_media_list_t *
150 libvlc_tree_item_as_media_list( libvlc_tree_t * p_tree,
151 libvlc_exception_t * p_e );
154 libvlc_tree_subtree_count( libvlc_tree_t * p_tree, libvlc_exception_t * p_e );
156 VLC_PUBLIC_API libvlc_tree_t *
157 libvlc_tree_subtree_at_index( libvlc_tree_t * p_tree,
159 libvlc_exception_t * p_e );
162 libvlc_tree_insert_subtree_at_index( libvlc_tree_t * p_tree,
163 libvlc_tree_t * p_subtree,
165 libvlc_exception_t * p_e );
168 libvlc_tree_remove_subtree_at_index( libvlc_tree_t * p_tree,
170 libvlc_exception_t * p_e );
176 /*****************************************************************************
178 *****************************************************************************/
179 /** defgroup libvlc_media_descriptor Media Descriptor
181 * LibVLC Media Descriptor
186 * Create a media descriptor with the given mrl.
187 * \param p_instance the instance
188 * \param psz_mrl the mrl to read
190 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_descriptor_new(
191 libvlc_instance_t *p_instance,
192 const char * psz_mrl,
193 libvlc_exception_t *p_e );
195 VLC_PUBLIC_API void libvlc_media_descriptor_retain(
196 libvlc_media_descriptor_t *p_meta_desc );
198 VLC_PUBLIC_API void libvlc_media_descriptor_release(
199 libvlc_media_descriptor_t *p_meta_desc );
201 VLC_PUBLIC_API char * libvlc_media_descriptor_get_mrl( libvlc_media_descriptor_t * p_md,
202 libvlc_exception_t * p_e );
205 * Read the meta of the media descriptor.
206 * \param p_meta_desc the media descriptor to read
207 * \param p_meta_desc the meta to read
209 VLC_PUBLIC_API char * libvlc_media_descriptor_get_meta(
210 libvlc_media_descriptor_t *p_meta_desc,
211 libvlc_meta_t e_meta,
212 libvlc_exception_t *p_e );
215 VLC_PUBLIC_API void libvlc_media_descriptor_add_tag( libvlc_media_descriptor_t *p_md,
217 const libvlc_tag_t tag,
218 libvlc_exception_t *p_e );
220 VLC_PUBLIC_API void libvlc_media_descriptor_remove_tag( libvlc_media_descriptor_t *p_md,
222 const libvlc_tag_t tag,
223 libvlc_exception_t *p_e );
226 libvlc_media_descriptor_tags_count_for_key( libvlc_media_descriptor_t *p_md,
228 libvlc_exception_t *p_e );
230 VLC_PUBLIC_API libvlc_tag_t
231 libvlc_media_descriptor_tag_at_index_for_key( libvlc_media_descriptor_t *p_md,
234 libvlc_exception_t *p_e );
238 /*****************************************************************************
240 *****************************************************************************/
241 /** defgroup libvlc_playlist Playlist
243 * LibVLC Playlist handling
250 VLC_PUBLIC_API void libvlc_playlist_loop( libvlc_instance_t* , vlc_bool_t,
251 libvlc_exception_t * );
254 * Start playing. You can give some additionnal playlist item options
255 * that will be added to the item before playing it.
256 * \param p_instance the instance
257 * \param i_id the item to play. If this is a negative number, the next
258 * item will be selected. Else, the item with the given ID will be played
259 * \param i_options the number of options to add to the item
260 * \param ppsz_options the options to add to the item
261 * \param p_exception an initialized exception
263 VLC_PUBLIC_API void libvlc_playlist_play( libvlc_instance_t*, int, int, char **,
264 libvlc_exception_t * );
267 * Pause a running playlist, resume if it was stopped
268 * \param p_instance the instance to pause
269 * \param p_exception an initialized exception
271 VLC_PUBLIC_API void libvlc_playlist_pause( libvlc_instance_t *, libvlc_exception_t * );
274 * Checks if the playlist is running
275 * \param p_instance the instance
276 * \param p_exception an initialized exception
277 * \return 0 if the playlist is stopped or paused, 1 if it is running
279 VLC_PUBLIC_API int libvlc_playlist_isplaying( libvlc_instance_t *, libvlc_exception_t * );
282 * Get the number of items in the playlist
283 * \param p_instance the instance
284 * \param p_exception an initialized exception
285 * \return the number of items
287 VLC_PUBLIC_API int libvlc_playlist_items_count( libvlc_instance_t *, libvlc_exception_t * );
290 * Lock the playlist instance
291 * \param p_instance the instance
293 VLC_PUBLIC_API void libvlc_playlist_lock( libvlc_instance_t * );
296 * Unlock the playlist instance
297 * \param p_instance the instance
299 VLC_PUBLIC_API void libvlc_playlist_unlock( libvlc_instance_t * );
303 * \param p_instance the instance to stop
304 * \param p_exception an initialized exception
306 VLC_PUBLIC_API void libvlc_playlist_stop( libvlc_instance_t *, libvlc_exception_t * );
309 * Go to next playlist item (starts playback if it was stopped)
310 * \param p_instance the instance to use
311 * \param p_exception an initialized exception
313 VLC_PUBLIC_API void libvlc_playlist_next( libvlc_instance_t *, libvlc_exception_t * );
316 * Go to previous playlist item (starts playback if it was stopped)
317 * \param p_instance the instance to use
318 * \param p_exception an initialized exception
320 VLC_PUBLIC_API void libvlc_playlist_prev( libvlc_instance_t *, libvlc_exception_t * );
323 * Remove all playlist items
324 * \param p_instance the instance
325 * \param p_exception an initialized exception
327 VLC_PUBLIC_API void libvlc_playlist_clear( libvlc_instance_t *, libvlc_exception_t * );
330 * Add an item at the end of the playlist
331 * If you need more advanced options, \see libvlc_playlist_add_extended
332 * \param p_instance the instance
333 * \param psz_uri the URI to open, using VLC format
334 * \param psz_name a name that you might want to give or NULL
335 * \return the identifier of the new item
337 VLC_PUBLIC_API int libvlc_playlist_add( libvlc_instance_t *, const char *, const char *,
338 libvlc_exception_t * );
341 * Add an item at the end of the playlist, with additional input options
342 * \param p_instance the instance
343 * \param psz_uri the URI to open, using VLC format
344 * \param psz_name a name that you might want to give or NULL
345 * \param i_options the number of options to add
346 * \param ppsz_options strings representing the options to add
347 * \param p_exception an initialized exception
348 * \return the identifier of the new item
350 VLC_PUBLIC_API int libvlc_playlist_add_extended( libvlc_instance_t *, const char *,
351 const char *, int, const char **,
352 libvlc_exception_t * );
355 * Delete the playlist item with the given ID.
356 * \param p_instance the instance
357 * \param i_id the id to remove
358 * \param p_exception an initialized exception
361 VLC_PUBLIC_API int libvlc_playlist_delete_item( libvlc_instance_t *, int,
362 libvlc_exception_t * );
364 /* Get the input that is currently being played by the playlist
365 * \param p_instance the instance to use
366 * \param p_exception an initialized excecption
367 * \return an input object
369 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_playlist_get_media_instance(
370 libvlc_instance_t *, libvlc_exception_t * );
374 /*****************************************************************************
376 *****************************************************************************/
377 /** defgroup libvlc_media_instance Media Instance
379 * LibVLC Media Instance
383 /** Create an empty Media Instance object
384 * \param p_libvlc_instance the libvlc instance in which the Media Instance
385 * should be (not used for now).
387 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new( libvlc_instance_t *, libvlc_exception_t * );
389 /** Create a Media Instance object from a Media Descriptor
390 * \param p_md the media descriptor. Afterwards the p_md can safely be
393 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new_from_media_descriptor( libvlc_media_descriptor_t *, libvlc_exception_t * );
395 /** Release a media_instance after use
396 * \param p_mi the Media Instance to free
398 VLC_PUBLIC_API void libvlc_media_instance_release( libvlc_media_instance_t * );
399 VLC_PUBLIC_API void libvlc_media_instance_retain( libvlc_media_instance_t * );
401 /** Set the media descriptor that will be used by the media_instance. If any,
402 * previous md will be released.
403 * \param p_mi the Media Instance
404 * \param p_md the Media Descriptor. Afterwards the p_md can safely be
407 VLC_PUBLIC_API void libvlc_media_instance_set_media_descriptor( libvlc_media_instance_t *, libvlc_media_descriptor_t *, libvlc_exception_t * );
409 /** Get the media descriptor used by the media_instance (if any). A copy of
410 * the md is returned. NULL is returned if no media instance is associated.
411 * \param p_mi the Media Instance
413 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_instance_get_media_descriptor( libvlc_media_instance_t *, libvlc_exception_t * );
415 /** Get the Event Manager from which the media instance send event.
416 * \param p_mi the Media Instance
418 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_instance_event_manager ( libvlc_media_instance_t *, libvlc_exception_t * );
420 VLC_PUBLIC_API void libvlc_media_instance_play ( libvlc_media_instance_t *, libvlc_exception_t * );
421 VLC_PUBLIC_API void libvlc_media_instance_pause ( libvlc_media_instance_t *, libvlc_exception_t * );
422 VLC_PUBLIC_API void libvlc_media_instance_stop ( libvlc_media_instance_t *, libvlc_exception_t * );
424 VLC_PUBLIC_API void libvlc_media_instance_set_drawable ( libvlc_media_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
426 /// \bug This might go away ... to be replaced by a broader system
427 VLC_PUBLIC_API vlc_int64_t libvlc_media_instance_get_length ( libvlc_media_instance_t *, libvlc_exception_t *);
428 VLC_PUBLIC_API vlc_int64_t libvlc_media_instance_get_time ( libvlc_media_instance_t *, libvlc_exception_t *);
429 VLC_PUBLIC_API void libvlc_media_instance_set_time ( libvlc_media_instance_t *, vlc_int64_t, libvlc_exception_t *);
430 VLC_PUBLIC_API float libvlc_media_instance_get_position ( libvlc_media_instance_t *, libvlc_exception_t *);
431 VLC_PUBLIC_API void libvlc_media_instance_set_position ( libvlc_media_instance_t *, float, libvlc_exception_t *);
432 VLC_PUBLIC_API vlc_bool_t libvlc_media_instance_will_play ( libvlc_media_instance_t *, libvlc_exception_t *);
433 VLC_PUBLIC_API float libvlc_media_instance_get_rate ( libvlc_media_instance_t *, libvlc_exception_t *);
434 VLC_PUBLIC_API void libvlc_media_instance_set_rate ( libvlc_media_instance_t *, float, libvlc_exception_t *);
435 VLC_PUBLIC_API int libvlc_media_instance_get_state ( libvlc_media_instance_t *, libvlc_exception_t *);
438 * Does this input have a video output ?
439 * \param p_input the input
440 * \param p_exception an initialized exception
442 VLC_PUBLIC_API vlc_bool_t libvlc_media_instance_has_vout( libvlc_media_instance_t *, libvlc_exception_t *);
443 VLC_PUBLIC_API float libvlc_media_instance_get_fps( libvlc_media_instance_t *, libvlc_exception_t *);
448 /*****************************************************************************
450 *****************************************************************************/
451 /** defgroup libvlc_tag_query Tag Query
456 VLC_PUBLIC_API libvlc_tag_query_t *
457 libvlc_tag_query_new( libvlc_instance_t *, libvlc_exception_t * );
460 libvlc_tag_query_release( libvlc_tag_query_t * );
463 libvlc_tag_query_retain( libvlc_tag_query_t * );
465 VLC_PUBLIC_API vlc_bool_t
466 libvlc_tag_query_match( libvlc_tag_query_t *, libvlc_media_descriptor_t *,
467 libvlc_exception_t * );
471 /*****************************************************************************
473 *****************************************************************************/
474 /** defgroup libvlc_media_list MediaList
479 VLC_PUBLIC_API libvlc_media_list_t *
480 libvlc_media_list_new( libvlc_instance_t *, libvlc_exception_t * );
483 libvlc_media_list_release( libvlc_media_list_t * );
486 libvlc_media_list_retain( libvlc_media_list_t * );
489 libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist,
490 const char * psz_uri,
491 libvlc_exception_t * p_e );
494 libvlc_media_list_set_name( libvlc_media_list_t *,
495 const char * psz_name,
496 libvlc_exception_t *);
498 VLC_PUBLIC_API char *
499 libvlc_media_list_name( libvlc_media_list_t *,
500 libvlc_exception_t *);
503 libvlc_media_list_add_media_descriptor( libvlc_media_list_t *,
504 libvlc_media_descriptor_t *,
505 libvlc_exception_t * );
507 libvlc_media_list_insert_media_descriptor( libvlc_media_list_t *,
508 libvlc_media_descriptor_t *,
510 libvlc_exception_t * );
512 libvlc_media_list_remove_index( libvlc_media_list_t *, int,
513 libvlc_exception_t * );
516 libvlc_media_list_count( libvlc_media_list_t * p_mlist,
517 libvlc_exception_t * p_e );
519 VLC_PUBLIC_API libvlc_media_descriptor_t *
520 libvlc_media_list_item_at_index( libvlc_media_list_t *, int,
521 libvlc_exception_t * );
523 libvlc_media_list_index_of_item( libvlc_media_list_t *,
524 libvlc_media_descriptor_t *,
525 libvlc_exception_t * );
528 libvlc_media_list_lock( libvlc_media_list_t * );
530 libvlc_media_list_unlock( libvlc_media_list_t * );
532 VLC_PUBLIC_API libvlc_event_manager_t *
533 libvlc_media_list_event_manager( libvlc_media_list_t *,
534 libvlc_exception_t * );
536 VLC_PUBLIC_API libvlc_media_list_t *
537 libvlc_media_list_dynamic_sublist( libvlc_media_list_t *,
538 libvlc_tag_query_t *,
539 libvlc_exception_t * );
543 /*****************************************************************************
545 *****************************************************************************/
546 /** defgroup libvlc_media_library Media Library
548 * LibVLC Media Library
551 VLC_PUBLIC_API libvlc_media_library_t *
552 libvlc_media_library_new( libvlc_instance_t * p_inst,
553 libvlc_exception_t * p_e );
555 libvlc_media_library_release( libvlc_media_library_t * p_mlib );
557 libvlc_media_library_retain( libvlc_media_library_t * p_mlib );
561 libvlc_media_library_load( libvlc_media_library_t * p_mlib,
562 libvlc_exception_t * p_e );
565 libvlc_media_library_save( libvlc_media_library_t * p_mlib,
566 libvlc_exception_t * p_e );
568 VLC_PUBLIC_API libvlc_media_list_t *
569 libvlc_media_library_media_list( libvlc_media_library_t * p_mlib,
570 libvlc_exception_t * p_e );
575 /*****************************************************************************
577 *****************************************************************************/
578 /** defgroup libvlc_media_list_player MediaListPlayer
580 * LibVLC Media List Player
583 VLC_PUBLIC_API libvlc_media_list_player_t *
584 libvlc_media_list_player_new( libvlc_instance_t * p_instance,
585 libvlc_exception_t * p_e );
587 libvlc_media_list_player_release( libvlc_media_list_player_t * p_mlp );
590 libvlc_media_list_player_set_media_instance(
591 libvlc_media_list_player_t * p_mlp,
592 libvlc_media_instance_t * p_mi,
593 libvlc_exception_t * p_e );
596 libvlc_media_list_player_set_media_list(
597 libvlc_media_list_player_t * p_mlp,
598 libvlc_media_list_t * p_mlist,
599 libvlc_exception_t * p_e );
602 libvlc_media_list_player_play( libvlc_media_list_player_t * p_mlp,
603 libvlc_exception_t * p_e );
606 libvlc_media_list_player_play_item_at_index(
607 libvlc_media_list_player_t * p_mlp,
609 libvlc_exception_t * p_e );
612 libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp,
613 libvlc_exception_t * p_e );
615 libvlc_media_list_player_next( libvlc_media_list_player_t * p_mlp,
616 libvlc_exception_t * p_e );
620 /** defgroup libvlc_video Video
622 * LibVLC Video handling
627 * Does this input have a video output ?
628 * \param p_input the input
629 * \param p_exception an initialized exception
631 VLC_PUBLIC_API vlc_bool_t libvlc_input_has_vout( libvlc_media_instance_t *, libvlc_exception_t *);
632 VLC_PUBLIC_API float libvlc_input_get_fps( libvlc_media_instance_t *, libvlc_exception_t *);
635 * Toggle fullscreen status on video output
636 * \param p_input the input
637 * \param p_exception an initialized exception
639 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_instance_t *, libvlc_exception_t * );
642 * Enable or disable fullscreen on a video output
643 * \param p_input the input
644 * \param b_fullscreen boolean for fullscreen status
645 * \param p_exception an initialized exception
647 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_instance_t *, int, libvlc_exception_t * );
650 * Get current fullscreen status
651 * \param p_input the input
652 * \param p_exception an initialized exception
653 * \return the fullscreen status (boolean)
655 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_instance_t *, libvlc_exception_t * );
658 * Get current video height
659 * \param p_input the input
660 * \param p_exception an initialized exception
661 * \return the video height
663 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_instance_t *, libvlc_exception_t * );
666 * Get current video width
667 * \param p_input the input
668 * \param p_exception an initialized exception
669 * \return the video width
671 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_instance_t *, libvlc_exception_t * );
674 * Get current video aspect ratio
675 * \param p_input the input
676 * \param p_exception an initialized exception
677 * \return the video aspect ratio
679 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_instance_t *, libvlc_exception_t * );
682 * Set new video aspect ratio
683 * \param p_input the input
684 * \param psz_aspect new video aspect-ratio
685 * \param p_exception an initialized exception
687 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_instance_t *, char *, libvlc_exception_t * );
690 * Get current video subtitle
691 * \param p_input the input
692 * \param p_exception an initialized exception
693 * \return the video subtitle selected
695 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_instance_t *, libvlc_exception_t * );
698 * Set new video subtitle
699 * \param p_input the input
700 * \param i_spu new video subtitle to select
701 * \param p_exception an initialized exception
703 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_instance_t *, int , libvlc_exception_t * );
706 * Get current crop filter geometry
707 * \param p_input the input
708 * \param p_exception an initialized exception
709 * \return the crop filter geometry
711 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_instance_t *, libvlc_exception_t * );
714 * Set new crop filter geometry
715 * \param p_input the input
716 * \param psz_geometry new crop filter geometry
717 * \param p_exception an initialized exception
719 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_instance_t *, char *, libvlc_exception_t * );
722 * Get current teletext page requested.
723 * \param p_input the input
724 * \param p_exception an initialized exception
725 * \return the current teletext page requested.
727 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_instance_t *, libvlc_exception_t * );
730 * Set new teletext page to retrieve
731 * \param p_input the input
732 * \param i_page teletex page number requested
733 * \param p_exception an initialized exception
735 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_instance_t *, int, libvlc_exception_t * );
738 * Take a snapshot of the current video window
739 * \param p_input the input
740 * \param psz_filepath the path where to save the screenshot to
741 * \param p_exception an initialized exception
743 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_instance_t *, char *, libvlc_exception_t * );
745 VLC_PUBLIC_API int libvlc_video_destroy( libvlc_media_instance_t *, libvlc_exception_t *);
748 * Resize the current video output window
749 * \param p_instance libvlc instance
750 * \param width new width for video output window
751 * \param height new height for video output window
752 * \param p_exception an initialized exception
753 * \return the success status (boolean)
755 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_instance_t *, int, int, libvlc_exception_t *);
758 * change the parent for the current the video output
759 * \param p_instance libvlc instance
760 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
761 * \param p_exception an initialized exception
762 * \return the success status (boolean)
764 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
767 * Tell windowless video output to redraw rectangular area (MacOS X only)
768 * \param p_instance libvlc instance
769 * \param area coordinates within video drawable
770 * \param p_exception an initialized exception
772 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_instance_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
775 * Set the default video output parent
776 * this settings will be used as default for all video outputs
777 * \param p_instance libvlc instance
778 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
779 * \param p_exception an initialized exception
781 VLC_PUBLIC_API void libvlc_video_set_parent( libvlc_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
784 * Set the default video output parent
785 * this settings will be used as default for all video outputs
786 * \param p_instance libvlc instance
787 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
788 * \param p_exception an initialized exception
790 VLC_PUBLIC_API libvlc_drawable_t libvlc_video_get_parent( libvlc_instance_t *, libvlc_exception_t * );
793 * Set the default video output size
794 * this settings will be used as default for all video outputs
795 * \param p_instance libvlc instance
796 * \param width new width for video drawable
797 * \param height new height for video drawable
798 * \param p_exception an initialized exception
800 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
803 * Set the default video output viewport for a windowless video output (MacOS X only)
804 * this settings will be used as default for all video outputs
805 * \param p_instance libvlc instance
806 * \param view coordinates within video drawable
807 * \param clip coordinates within video drawable
808 * \param p_exception an initialized exception
810 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
814 /** defgroup libvlc_audio Audio
816 * LibVLC Audio handling
822 * \param p_instance libvlc instance
823 * \param p_exception an initialized exception
826 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
829 * Get current mute status
830 * \param p_instance libvlc instance
831 * \param p_exception an initialized exception
832 * \return the mute status (boolean)
834 VLC_PUBLIC_API vlc_bool_t libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
838 * \param p_instance libvlc instance
839 * \param status If status is VLC_TRUE then mute, otherwise unmute
840 * \param p_exception an initialized exception
843 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, vlc_bool_t , libvlc_exception_t * );
846 * Get current audio level
847 * \param p_instance libvlc instance
848 * \param p_exception an initialized exception
849 * \return the audio level (int)
851 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
854 * Set current audio level
855 * \param p_instance libvlc instance
856 * \param i_volume the volume (int)
857 * \param p_exception an initialized exception
859 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
862 + * Get current audio track
863 + * \param p_input input instance
864 + * \param p_exception an initialized exception
865 + * \return the audio track (int)
867 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_instance_t *, libvlc_exception_t * );
870 * Set current audio track
871 * \param p_input input instance
872 * \param i_track the track (int)
873 * \param p_exception an initialized exception
875 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_instance_t *, int, libvlc_exception_t * );
878 * Get current audio channel
879 * \param p_instance input instance
880 * \param p_exception an initialized exception
881 * \return the audio channel (int)
883 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
886 * Set current audio channel
887 * \param p_instance input instance
888 * \param i_channel the audio channel (int)
889 * \param p_exception an initialized exception
891 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
895 /*****************************************************************************
896 * Services/Media Discovery
897 *****************************************************************************/
898 /** defgroup libvlc_media_discoverer Media Discoverer
900 * LibVLC Media Discoverer
904 VLC_PUBLIC_API libvlc_media_discoverer_t *
905 libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
906 const char * psz_name,
907 libvlc_exception_t * p_e );
908 VLC_PUBLIC_API void libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
909 VLC_PUBLIC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
911 VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( );
915 /*****************************************************************************
917 *****************************************************************************/
918 /** defgroup libvlc_vlm VLM
925 * Add a broadcast, with one input
926 * \param p_instance the instance
927 * \param psz_name the name of the new broadcast
928 * \param psz_input the input MRL
929 * \param psz_output the output MRL (the parameter to the "sout" variable)
930 * \param i_options number of additional options
931 * \param ppsz_options additional options
932 * \param b_enabled boolean for enabling the new broadcast
933 * \param b_loop Should this broadcast be played in loop ?
934 * \param p_exception an initialized exception
936 VLC_PUBLIC_API void libvlc_vlm_add_broadcast( libvlc_instance_t *, char *, char *, char* ,
937 int, char **, int, int, libvlc_exception_t * );
940 * Delete a media (vod or broadcast)
941 * \param p_instance the instance
942 * \param psz_name the media to delete
943 * \param p_exception an initialized exception
945 VLC_PUBLIC_API void libvlc_vlm_del_media( libvlc_instance_t *, char *, libvlc_exception_t * );
948 * Enable or disable a media (vod or broadcast)
949 * \param p_instance the instance
950 * \param psz_name the media to work on
951 * \param b_enabled the new status
952 * \param p_exception an initialized exception
954 VLC_PUBLIC_API void libvlc_vlm_set_enabled( libvlc_instance_t *, char *, int,
955 libvlc_exception_t *);
958 * Set the output for a media
959 * \param p_instance the instance
960 * \param psz_name the media to work on
961 * \param psz_output the output MRL (the parameter to the "sout" variable)
962 * \param p_exception an initialized exception
964 VLC_PUBLIC_API void libvlc_vlm_set_output( libvlc_instance_t *, char *, char*,
965 libvlc_exception_t *);
968 * Set a media's input MRL. This will delete all existing inputs and
969 * add the specified one.
970 * \param p_instance the instance
971 * \param psz_name the media to work on
972 * \param psz_input the input MRL
973 * \param p_exception an initialized exception
975 VLC_PUBLIC_API void libvlc_vlm_set_input( libvlc_instance_t *, char *, char*,
976 libvlc_exception_t *);
979 * Add a media's input MRL. This will add the specified one.
980 * \param p_instance the instance
981 * \param psz_name the media to work on
982 * \param psz_input the input MRL
983 * \param p_exception an initialized exception
985 VLC_PUBLIC_API void libvlc_vlm_add_input( libvlc_instance_t *, char *, char *,
986 libvlc_exception_t *p_exception );
988 * Set output for a media
989 * \param p_instance the instance
990 * \param psz_name the media to work on
991 * \param b_loop the new status
992 * \param p_exception an initialized exception
994 VLC_PUBLIC_API void libvlc_vlm_set_loop( libvlc_instance_t *, char *, int,
995 libvlc_exception_t *);
998 * Edit the parameters of a media. This will delete all existing inputs and
999 * add the specified one.
1000 * \param p_instance the instance
1001 * \param psz_name the name of the new broadcast
1002 * \param psz_input the input MRL
1003 * \param psz_output the output MRL (the parameter to the "sout" variable)
1004 * \param i_options number of additional options
1005 * \param ppsz_options additional options
1006 * \param b_enabled boolean for enabling the new broadcast
1007 * \param b_loop Should this broadcast be played in loop ?
1008 * \param p_exception an initialized exception
1010 VLC_PUBLIC_API void libvlc_vlm_change_media( libvlc_instance_t *, char *, char *, char* ,
1011 int, char **, int, int, libvlc_exception_t * );
1014 * Plays the named broadcast.
1015 * \param p_instance the instance
1016 * \param psz_name the name of the broadcast
1017 * \param p_exception an initialized exception
1019 VLC_PUBLIC_API void libvlc_vlm_play_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
1022 * Stops the named broadcast.
1023 * \param p_instance the instance
1024 * \param psz_name the name of the broadcast
1025 * \param p_exception an initialized exception
1027 VLC_PUBLIC_API void libvlc_vlm_stop_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
1030 * Pauses the named broadcast.
1031 * \param p_instance the instance
1032 * \param psz_name the name of the broadcast
1033 * \param p_exception an initialized exception
1035 VLC_PUBLIC_API void libvlc_vlm_pause_media( libvlc_instance_t *, char *, libvlc_exception_t * );
1038 * Seeks in the named broadcast.
1039 * \param p_instance the instance
1040 * \param psz_name the name of the broadcast
1041 * \param f_percentage the percentage to seek to
1042 * \param p_exception an initialized exception
1044 VLC_PUBLIC_API void libvlc_vlm_seek_media( libvlc_instance_t *, char *,
1045 float, libvlc_exception_t * );
1048 * Return information of the named broadcast.
1049 * \param p_instance the instance
1050 * \param psz_name the name of the broadcast
1051 * \param p_exception an initialized exception
1053 VLC_PUBLIC_API char* libvlc_vlm_show_media( libvlc_instance_t *, char *, libvlc_exception_t * );
1055 #define LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( attr, returnType, getType, default)\
1056 returnType libvlc_vlm_get_media_## attr( libvlc_instance_t *, \
1057 char *, int , libvlc_exception_t * );
1059 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( position, float, Float, -1);
1060 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( time, int, Integer, -1);
1061 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( length, int, Integer, -1);
1062 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( rate, int, Integer, -1);
1063 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( title, int, Integer, 0);
1064 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( chapter, int, Integer, 0);
1065 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( seekable, int, Bool, 0);
1067 #undef LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
1071 /*****************************************************************************
1072 * Message log handling
1073 *****************************************************************************/
1075 /** defgroup libvlc_log Log
1077 * LibVLC Message Logging
1082 * Returns the VLC messaging verbosity level
1083 * \param p_instance libvlc instance
1084 * \param exception an initialized exception pointer
1086 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
1087 libvlc_exception_t *p_e );
1090 * Set the VLC messaging verbosity level
1091 * \param p_log libvlc log instance
1092 * \param exception an initialized exception pointer
1094 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
1095 libvlc_exception_t *p_e );
1098 * Open an instance to VLC message log
1099 * \param p_instance libvlc instance
1100 * \param exception an initialized exception pointer
1102 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( const libvlc_instance_t *, libvlc_exception_t *);
1105 * Close an instance of VLC message log
1106 * \param p_log libvlc log instance
1107 * \param exception an initialized exception pointer
1109 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
1112 * Returns the number of messages in log
1113 * \param p_log libvlc log instance
1114 * \param exception an initialized exception pointer
1116 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
1119 * Clear all messages in log
1120 * the log should be cleared on a regular basis to avoid clogging
1121 * \param p_log libvlc log instance
1122 * \param exception an initialized exception pointer
1124 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
1127 * Allocate and returns a new iterator to messages in log
1128 * \param p_log libvlc log instance
1129 * \param exception an initialized exception pointer
1131 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
1134 * Releases a previoulsy allocated iterator
1135 * \param p_log libvlc log iterator
1136 * \param exception an initialized exception pointer
1138 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1141 * Returns whether log iterator has more messages
1142 * \param p_log libvlc log iterator
1143 * \param exception an initialized exception pointer
1145 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1148 * Returns next log message
1149 * the content of message must not be freed
1150 * \param p_log libvlc log iterator
1151 * \param exception an initialized exception pointer
1153 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
1154 struct libvlc_log_message_t *buffer,
1155 libvlc_exception_t *p_e );
1159 /*****************************************************************************
1161 *****************************************************************************/
1163 /** defgroup libvlc_callbacks Callbacks
1170 * Register for an event notification
1171 * \param p_event_manager the event manager to which you want to attach to
1172 * Generally it is obtained by vlc_my_object_event_manager() where my_object
1173 * Is the object you want to listen to.
1174 * \param i_event_type the desired event to which we want to listen
1175 * \param f_callback the function to call when i_event_type occurs
1176 * \param user_data user provided data to carry with the event
1177 * \param p_e an initialized exception pointer
1179 VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
1180 libvlc_event_type_t i_event_type,
1181 libvlc_callback_t f_callback,
1183 libvlc_exception_t *p_e );
1186 * Unregister an event notification
1187 * \param p_event_manager the event manager
1188 * \param i_event_type the desired event to which we want to unregister
1189 * \param f_callback the function to call when i_event_type occurs
1190 * \param p_e an initialized exception pointer
1192 VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
1193 libvlc_event_type_t i_event_type,
1194 libvlc_callback_t f_callback,
1196 libvlc_exception_t *p_e );
1200 * Get an event type name
1201 * \param i_event_type the desired event
1203 #define libvlc_event_type_name(a) #a
1212 #endif /* <vlc/libvlc.h> */