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
65 libvlc_exception_raised( const libvlc_exception_t *p_exception );
69 * \param p_exception the exception to raise
70 * \param psz_message the exception message
73 libvlc_exception_raise( libvlc_exception_t *p_exception,
74 const char *psz_format, ... );
77 * Clear an exception object so it can be reused.
78 * The exception object must be initialized
79 * \param p_exception the exception to clear
81 VLC_PUBLIC_API void libvlc_exception_clear( libvlc_exception_t * );
84 * Get exception message
85 * \param p_exception the exception to query
86 * \return the exception message or NULL if not applicable (exception not raised
89 VLC_PUBLIC_API const char *
90 libvlc_exception_get_message( const libvlc_exception_t *p_exception );
94 /*****************************************************************************
96 *****************************************************************************/
98 /** defgroup libvlc_core Core
105 * Create an initialized libvlc instance.
106 * \param argc the number of arguments
107 * \param argv command-line-type arguments
108 * \param exception an initialized exception pointer
110 VLC_PUBLIC_API libvlc_instance_t *
111 libvlc_new( int , const char *const *, libvlc_exception_t *);
114 * Returns a libvlc instance identifier for legacy APIs. Use of this
115 * function is discouraged, you should convert your program to use the
117 * \param p_instance the instance
119 VLC_PUBLIC_API int libvlc_get_vlc_id( libvlc_instance_t *p_instance );
122 * Decrements the reference count of a libvlc instance, and destroys it
123 * if it reaches zero.
124 * \param p_instance the instance to destroy
126 VLC_PUBLIC_API void libvlc_release( libvlc_instance_t *, libvlc_exception_t * );
129 * Increments the reference count of a libvlc instance.
130 * The reference count is initially one when libvlc_new() returns.
132 VLC_PUBLIC_API void libvlc_retain( libvlc_instance_t * );
136 /*****************************************************************************
138 *****************************************************************************/
139 /** defgroup libvlc_media_descriptor Media Descriptor
141 * LibVLC Media Descriptor
146 * Create a media descriptor with the given mrl.
147 * \param p_instance the instance
148 * \param psz_mrl the mrl to read
150 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_descriptor_new(
151 libvlc_instance_t *p_instance,
152 const char * psz_mrl,
153 libvlc_exception_t *p_e );
156 * Create a media descriptor as an empty node with the passed name.
157 * \param p_instance the instance
158 * \param psz_name the name of the node
160 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_descriptor_new_as_node(
161 libvlc_instance_t *p_instance,
162 const char * psz_name,
163 libvlc_exception_t *p_e );
166 * Add an option to the media descriptor,
167 * This option will be used to determine how the media_instance will
168 * read the media_descriptor. This allow to use VLC advanced
169 * reading/streaming options in a per-media basis.
171 * The options are detailled in vlc --long-help, for instance "--sout-all"
172 * \param p_instance the instance
173 * \param psz_mrl the mrl to read
175 VLC_PUBLIC_API void libvlc_media_descriptor_add_option(
176 libvlc_media_descriptor_t * p_md,
177 const char * ppsz_options,
178 libvlc_exception_t * p_e );
180 VLC_PUBLIC_API void libvlc_media_descriptor_retain(
181 libvlc_media_descriptor_t *p_meta_desc );
183 VLC_PUBLIC_API void libvlc_media_descriptor_release(
184 libvlc_media_descriptor_t *p_meta_desc );
186 VLC_PUBLIC_API char * libvlc_media_descriptor_get_mrl( libvlc_media_descriptor_t * p_md,
187 libvlc_exception_t * p_e );
190 * Read the meta of the media descriptor.
191 * \param p_meta_desc the media descriptor to read
192 * \param p_meta_desc the meta to read
194 VLC_PUBLIC_API char * libvlc_media_descriptor_get_meta(
195 libvlc_media_descriptor_t *p_meta_desc,
196 libvlc_meta_t e_meta,
197 libvlc_exception_t *p_e );
199 VLC_PUBLIC_API libvlc_state_t libvlc_media_descriptor_get_state(
200 libvlc_media_descriptor_t *p_meta_desc,
201 libvlc_exception_t *p_e );
204 VLC_PUBLIC_API void libvlc_media_descriptor_add_tag( libvlc_media_descriptor_t *p_md,
206 const libvlc_tag_t tag,
207 libvlc_exception_t *p_e );
209 VLC_PUBLIC_API void libvlc_media_descriptor_remove_tag( libvlc_media_descriptor_t *p_md,
211 const libvlc_tag_t tag,
212 libvlc_exception_t *p_e );
215 libvlc_media_descriptor_tags_count_for_key( libvlc_media_descriptor_t *p_md,
217 libvlc_exception_t *p_e );
219 VLC_PUBLIC_API libvlc_tag_t
220 libvlc_media_descriptor_tag_at_index_for_key( libvlc_media_descriptor_t *p_md,
223 libvlc_exception_t *p_e );
225 VLC_PUBLIC_API libvlc_media_list_t *
226 libvlc_media_descriptor_subitems( libvlc_media_descriptor_t *p_md,
227 libvlc_exception_t *p_e );
229 VLC_PUBLIC_API libvlc_event_manager_t *
230 libvlc_media_descriptor_event_manager( libvlc_media_descriptor_t * p_md,
231 libvlc_exception_t * p_e );
233 VLC_PUBLIC_API vlc_int64_t
234 libvlc_media_descriptor_get_duration( libvlc_media_descriptor_t * p_md,
235 libvlc_exception_t * p_e );
237 VLC_PUBLIC_API vlc_bool_t
238 libvlc_media_descriptor_is_preparsed( libvlc_media_descriptor_t * p_md,
239 libvlc_exception_t * p_e );
242 libvlc_media_descriptor_set_user_data( libvlc_media_descriptor_t * p_md,
243 void * p_new_user_data,
244 libvlc_exception_t * p_e);
245 VLC_PUBLIC_API void *
246 libvlc_media_descriptor_get_user_data( libvlc_media_descriptor_t * p_md,
247 libvlc_exception_t * p_e);
251 /*****************************************************************************
253 *****************************************************************************/
254 /** defgroup libvlc_playlist Playlist
256 * LibVLC Playlist handling
263 VLC_PUBLIC_API void libvlc_playlist_loop( libvlc_instance_t* , vlc_bool_t,
264 libvlc_exception_t * );
267 * Start playing. You can give some additionnal playlist item options
268 * that will be added to the item before playing it.
269 * \param p_instance the instance
270 * \param i_id the item to play. If this is a negative number, the next
271 * item will be selected. Else, the item with the given ID will be played
272 * \param i_options the number of options to add to the item
273 * \param ppsz_options the options to add to the item
274 * \param p_exception an initialized exception
276 VLC_PUBLIC_API void libvlc_playlist_play( libvlc_instance_t*, int, int, char **,
277 libvlc_exception_t * );
280 * Pause a running playlist, resume if it was stopped
281 * \param p_instance the instance to pause
282 * \param p_exception an initialized exception
284 VLC_PUBLIC_API void libvlc_playlist_pause( libvlc_instance_t *, libvlc_exception_t * );
287 * Checks if the playlist is running
288 * \param p_instance the instance
289 * \param p_exception an initialized exception
290 * \return 0 if the playlist is stopped or paused, 1 if it is running
292 VLC_PUBLIC_API int libvlc_playlist_isplaying( libvlc_instance_t *, libvlc_exception_t * );
295 * Get the number of items in the playlist
296 * \param p_instance the instance
297 * \param p_exception an initialized exception
298 * \return the number of items
300 VLC_PUBLIC_API int libvlc_playlist_items_count( libvlc_instance_t *, libvlc_exception_t * );
303 * Lock the playlist instance
304 * \param p_instance the instance
306 VLC_PUBLIC_API void libvlc_playlist_lock( libvlc_instance_t * );
309 * Unlock the playlist instance
310 * \param p_instance the instance
312 VLC_PUBLIC_API void libvlc_playlist_unlock( libvlc_instance_t * );
316 * \param p_instance the instance to stop
317 * \param p_exception an initialized exception
319 VLC_PUBLIC_API void libvlc_playlist_stop( libvlc_instance_t *, libvlc_exception_t * );
322 * Go to next playlist item (starts playback if it was stopped)
323 * \param p_instance the instance to use
324 * \param p_exception an initialized exception
326 VLC_PUBLIC_API void libvlc_playlist_next( libvlc_instance_t *, libvlc_exception_t * );
329 * Go to previous playlist item (starts playback if it was stopped)
330 * \param p_instance the instance to use
331 * \param p_exception an initialized exception
333 VLC_PUBLIC_API void libvlc_playlist_prev( libvlc_instance_t *, libvlc_exception_t * );
336 * Remove all playlist items
337 * \param p_instance the instance
338 * \param p_exception an initialized exception
340 VLC_PUBLIC_API void libvlc_playlist_clear( libvlc_instance_t *, libvlc_exception_t * );
343 * Add an item at the end of the playlist
344 * If you need more advanced options, \see libvlc_playlist_add_extended
345 * \param p_instance the instance
346 * \param psz_uri the URI to open, using VLC format
347 * \param psz_name a name that you might want to give or NULL
348 * \return the identifier of the new item
350 VLC_PUBLIC_API int libvlc_playlist_add( libvlc_instance_t *, const char *, const char *,
351 libvlc_exception_t * );
354 * Add an item at the end of the playlist, with additional input options
355 * \param p_instance the instance
356 * \param psz_uri the URI to open, using VLC format
357 * \param psz_name a name that you might want to give or NULL
358 * \param i_options the number of options to add
359 * \param ppsz_options strings representing the options to add
360 * \param p_exception an initialized exception
361 * \return the identifier of the new item
363 VLC_PUBLIC_API int libvlc_playlist_add_extended( libvlc_instance_t *, const char *,
364 const char *, int, const char **,
365 libvlc_exception_t * );
368 * Delete the playlist item with the given ID.
369 * \param p_instance the instance
370 * \param i_id the id to remove
371 * \param p_exception an initialized exception
374 VLC_PUBLIC_API int libvlc_playlist_delete_item( libvlc_instance_t *, int,
375 libvlc_exception_t * );
377 /** Get the input that is currently being played by the playlist
378 * \param p_instance the instance to use
379 * \param p_exception an initialized excecption
380 * \return an input object
382 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_playlist_get_media_instance(
383 libvlc_instance_t *, libvlc_exception_t * );
385 VLC_PUBLIC_API vlc_bool_t libvlc_media_instance_is_seekable(
386 libvlc_media_instance_t *p_mi,
387 libvlc_exception_t *p_e );
391 /*****************************************************************************
393 *****************************************************************************/
394 /** defgroup libvlc_media_instance Media Instance
396 * LibVLC Media Instance
400 /** Create an empty Media Instance object
401 * \param p_libvlc_instance the libvlc instance in which the Media Instance
402 * should be (not used for now).
404 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new( libvlc_instance_t *, libvlc_exception_t * );
406 /** Create a Media Instance object from a Media Descriptor
407 * \param p_md the media descriptor. Afterwards the p_md can safely be
410 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new_from_media_descriptor( libvlc_media_descriptor_t *, libvlc_exception_t * );
412 /** Release a media_instance after use
413 * \param p_mi the Media Instance to free
415 VLC_PUBLIC_API void libvlc_media_instance_release( libvlc_media_instance_t * );
416 VLC_PUBLIC_API void libvlc_media_instance_retain( libvlc_media_instance_t * );
418 /** Set the media descriptor that will be used by the media_instance. If any,
419 * previous md will be released.
420 * \param p_mi the Media Instance
421 * \param p_md the Media Descriptor. Afterwards the p_md can safely be
424 VLC_PUBLIC_API void libvlc_media_instance_set_media_descriptor( libvlc_media_instance_t *, libvlc_media_descriptor_t *, libvlc_exception_t * );
426 /** Get the media descriptor used by the media_instance (if any). A copy of
427 * the md is returned. NULL is returned if no media instance is associated.
428 * \param p_mi the Media Instance
430 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_instance_get_media_descriptor( libvlc_media_instance_t *, libvlc_exception_t * );
432 /** Get the Event Manager from which the media instance send event.
433 * \param p_mi the Media Instance
435 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_instance_event_manager ( libvlc_media_instance_t *, libvlc_exception_t * );
437 VLC_PUBLIC_API void libvlc_media_instance_play ( libvlc_media_instance_t *, libvlc_exception_t * );
438 VLC_PUBLIC_API void libvlc_media_instance_pause ( libvlc_media_instance_t *, libvlc_exception_t * );
439 VLC_PUBLIC_API void libvlc_media_instance_stop ( libvlc_media_instance_t *, libvlc_exception_t * );
441 VLC_PUBLIC_API void libvlc_media_instance_set_drawable ( libvlc_media_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
443 /** \bug This might go away ... to be replaced by a broader system */
444 VLC_PUBLIC_API vlc_int64_t libvlc_media_instance_get_length ( libvlc_media_instance_t *, libvlc_exception_t *);
445 VLC_PUBLIC_API vlc_int64_t libvlc_media_instance_get_time ( libvlc_media_instance_t *, libvlc_exception_t *);
446 VLC_PUBLIC_API void libvlc_media_instance_set_time ( libvlc_media_instance_t *, vlc_int64_t, libvlc_exception_t *);
447 VLC_PUBLIC_API float libvlc_media_instance_get_position ( libvlc_media_instance_t *, libvlc_exception_t *);
448 VLC_PUBLIC_API void libvlc_media_instance_set_position ( libvlc_media_instance_t *, float, libvlc_exception_t *);
449 VLC_PUBLIC_API void libvlc_media_instance_set_chapter ( libvlc_media_instance_t *, int, libvlc_exception_t *);
450 VLC_PUBLIC_API int libvlc_media_instance_get_chapter (libvlc_media_instance_t *, libvlc_exception_t *);
451 VLC_PUBLIC_API int libvlc_media_instance_get_chapter_count( libvlc_media_instance_t *, libvlc_exception_t *);
452 VLC_PUBLIC_API vlc_bool_t libvlc_media_instance_will_play ( libvlc_media_instance_t *, libvlc_exception_t *);
453 VLC_PUBLIC_API float libvlc_media_instance_get_rate ( libvlc_media_instance_t *, libvlc_exception_t *);
454 VLC_PUBLIC_API void libvlc_media_instance_set_rate ( libvlc_media_instance_t *, float, libvlc_exception_t *);
455 VLC_PUBLIC_API libvlc_state_t libvlc_media_instance_get_state ( libvlc_media_instance_t *, libvlc_exception_t *);
458 * Does this input have a video output ?
459 * \param p_input the input
460 * \param p_exception an initialized exception
462 VLC_PUBLIC_API vlc_bool_t libvlc_media_instance_has_vout( libvlc_media_instance_t *, libvlc_exception_t *);
463 VLC_PUBLIC_API float libvlc_media_instance_get_fps( libvlc_media_instance_t *, libvlc_exception_t *);
468 /*****************************************************************************
470 *****************************************************************************/
471 /** defgroup libvlc_tag_query Tag Query
476 VLC_PUBLIC_API libvlc_tag_query_t *
477 libvlc_tag_query_new( libvlc_instance_t *, libvlc_exception_t * );
480 libvlc_tag_query_release( libvlc_tag_query_t * );
483 libvlc_tag_query_retain( libvlc_tag_query_t * );
486 libvlc_tag_query_set_match_tag_and_key( libvlc_tag_query_t * p_q,
489 libvlc_exception_t * );
491 VLC_PUBLIC_API vlc_bool_t
492 libvlc_tag_query_match( libvlc_tag_query_t *, libvlc_media_descriptor_t *,
493 libvlc_exception_t * );
497 /*****************************************************************************
499 *****************************************************************************/
500 /** defgroup libvlc_media_list MediaList
505 VLC_PUBLIC_API libvlc_media_list_t *
506 libvlc_media_list_new( libvlc_instance_t *, libvlc_exception_t * );
509 libvlc_media_list_release( libvlc_media_list_t * );
512 libvlc_media_list_retain( libvlc_media_list_t * );
515 libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist,
516 const char * psz_uri,
517 libvlc_exception_t * p_e );
520 libvlc_media_list_set_media_descriptor( libvlc_media_list_t *,
521 libvlc_media_descriptor_t *,
522 libvlc_exception_t *);
524 VLC_PUBLIC_API libvlc_media_descriptor_t *
525 libvlc_media_list_media_descriptor( libvlc_media_list_t *,
526 libvlc_exception_t *);
529 libvlc_media_list_add_media_descriptor( libvlc_media_list_t *,
530 libvlc_media_descriptor_t *,
531 libvlc_exception_t * );
533 libvlc_media_list_insert_media_descriptor( libvlc_media_list_t *,
534 libvlc_media_descriptor_t *,
536 libvlc_exception_t * );
538 libvlc_media_list_remove_index( libvlc_media_list_t *, int,
539 libvlc_exception_t * );
542 libvlc_media_list_count( libvlc_media_list_t * p_mlist,
543 libvlc_exception_t * p_e );
545 VLC_PUBLIC_API libvlc_media_descriptor_t *
546 libvlc_media_list_item_at_index( libvlc_media_list_t *, int,
547 libvlc_exception_t * );
549 libvlc_media_list_index_of_item( libvlc_media_list_t *,
550 libvlc_media_descriptor_t *,
551 libvlc_exception_t * );
553 /* This indicates if this media list is read-only from a user point of view */
554 VLC_PUBLIC_API vlc_bool_t
555 libvlc_media_list_is_readonly( libvlc_media_list_t * p_mlist );
558 libvlc_media_list_lock( libvlc_media_list_t * );
560 libvlc_media_list_unlock( libvlc_media_list_t * );
562 VLC_PUBLIC_API libvlc_media_list_view_t *
563 libvlc_media_list_flat_view( libvlc_media_list_t *,
564 libvlc_exception_t * );
566 VLC_PUBLIC_API libvlc_media_list_view_t *
567 libvlc_media_list_hierarchical_view( libvlc_media_list_t *,
568 libvlc_exception_t * );
570 VLC_PUBLIC_API libvlc_event_manager_t *
571 libvlc_media_list_event_manager( libvlc_media_list_t *,
572 libvlc_exception_t * );
576 /*****************************************************************************
578 *****************************************************************************/
579 /** defgroup libvlc_media_list_view MediaListView
581 * LibVLC Media List View
585 libvlc_media_list_view_retain( libvlc_media_list_view_t * p_mlv );
588 libvlc_media_list_view_release( libvlc_media_list_view_t * p_mlv );
590 VLC_PUBLIC_API libvlc_event_manager_t *
591 libvlc_media_list_view_event_manager( libvlc_media_list_view_t * p_mlv );
594 libvlc_media_list_view_count( libvlc_media_list_view_t * p_mlv,
595 libvlc_exception_t * p_e );
597 VLC_PUBLIC_API libvlc_media_descriptor_t *
598 libvlc_media_list_view_item_at_index( libvlc_media_list_view_t * p_mlv,
600 libvlc_exception_t * p_e );
602 VLC_PUBLIC_API libvlc_media_list_view_t *
603 libvlc_media_list_view_children_at_index( libvlc_media_list_view_t * p_mlv,
605 libvlc_exception_t * p_e );
609 libvlc_media_list_view_index_of_item( libvlc_media_list_view_t * p_mlv,
610 libvlc_media_descriptor_t * p_md,
611 libvlc_exception_t * p_e );
614 libvlc_media_list_view_insert_at_index( libvlc_media_list_view_t * p_mlv,
615 libvlc_media_descriptor_t * p_md,
617 libvlc_exception_t * p_e );
620 libvlc_media_list_view_remove_at_index( libvlc_media_list_view_t * p_mlv,
622 libvlc_exception_t * p_e );
625 libvlc_media_list_view_add_item( libvlc_media_list_view_t * p_mlv,
626 libvlc_media_descriptor_t * p_md,
627 libvlc_exception_t * p_e );
629 VLC_PUBLIC_API libvlc_media_list_t *
630 libvlc_media_list_view_parent_media_list( libvlc_media_list_view_t * p_mlv,
631 libvlc_exception_t * p_e );
635 /*****************************************************************************
636 * Dynamic Media List (Deprecated)
637 *****************************************************************************/
638 /** defgroup libvlc_media_list MediaList
643 VLC_PUBLIC_API libvlc_dynamic_media_list_t *
644 libvlc_dynamic_media_list_new( libvlc_media_list_t * p_mlist,
645 libvlc_tag_query_t * p_query,
647 libvlc_exception_t * p_e );
649 libvlc_dynamic_media_list_release( libvlc_dynamic_media_list_t * p_dmlist );
652 libvlc_dynamic_media_list_retain( libvlc_dynamic_media_list_t * p_dmlist );
654 libvlc_media_list_t *
655 libvlc_dynamic_media_list_media_list( libvlc_dynamic_media_list_t * p_dmlist,
656 libvlc_exception_t * p_e );
660 /*****************************************************************************
662 *****************************************************************************/
663 /** defgroup libvlc_media_library Media Library
665 * LibVLC Media Library
668 VLC_PUBLIC_API libvlc_media_library_t *
669 libvlc_media_library_new( libvlc_instance_t * p_inst,
670 libvlc_exception_t * p_e );
672 libvlc_media_library_release( libvlc_media_library_t * p_mlib );
674 libvlc_media_library_retain( libvlc_media_library_t * p_mlib );
678 libvlc_media_library_load( libvlc_media_library_t * p_mlib,
679 libvlc_exception_t * p_e );
682 libvlc_media_library_save( libvlc_media_library_t * p_mlib,
683 libvlc_exception_t * p_e );
685 VLC_PUBLIC_API libvlc_media_list_t *
686 libvlc_media_library_media_list( libvlc_media_library_t * p_mlib,
687 libvlc_exception_t * p_e );
692 /*****************************************************************************
694 *****************************************************************************/
695 /** defgroup libvlc_media_list_player MediaListPlayer
697 * LibVLC Media List Player
700 VLC_PUBLIC_API libvlc_media_list_player_t *
701 libvlc_media_list_player_new( libvlc_instance_t * p_instance,
702 libvlc_exception_t * p_e );
704 libvlc_media_list_player_release( libvlc_media_list_player_t * p_mlp );
707 libvlc_media_list_player_set_media_instance(
708 libvlc_media_list_player_t * p_mlp,
709 libvlc_media_instance_t * p_mi,
710 libvlc_exception_t * p_e );
713 libvlc_media_list_player_set_media_list(
714 libvlc_media_list_player_t * p_mlp,
715 libvlc_media_list_t * p_mlist,
716 libvlc_exception_t * p_e );
719 libvlc_media_list_player_play( libvlc_media_list_player_t * p_mlp,
720 libvlc_exception_t * p_e );
723 libvlc_media_list_player_pause( libvlc_media_list_player_t * p_mlp,
724 libvlc_exception_t * p_e );
726 VLC_PUBLIC_API vlc_bool_t
727 libvlc_media_list_player_is_playing( libvlc_media_list_player_t * p_mlp,
728 libvlc_exception_t * p_e );
730 VLC_PUBLIC_API libvlc_state_t
731 libvlc_media_list_player_get_state( libvlc_media_list_player_t * p_mlp,
732 libvlc_exception_t * p_e );
735 libvlc_media_list_player_play_item_at_index(
736 libvlc_media_list_player_t * p_mlp,
738 libvlc_exception_t * p_e );
741 libvlc_media_list_player_play_item(
742 libvlc_media_list_player_t * p_mlp,
743 libvlc_media_descriptor_t * p_md,
744 libvlc_exception_t * p_e );
747 libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp,
748 libvlc_exception_t * p_e );
750 libvlc_media_list_player_next( libvlc_media_list_player_t * p_mlp,
751 libvlc_exception_t * p_e );
755 /** defgroup libvlc_video Video
757 * LibVLC Video handling
762 * Toggle fullscreen status on video output
763 * \param p_input the input
764 * \param p_exception an initialized exception
766 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_instance_t *, libvlc_exception_t * );
769 * Enable or disable fullscreen on a video output
770 * \param p_input the input
771 * \param b_fullscreen boolean for fullscreen status
772 * \param p_exception an initialized exception
774 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_instance_t *, int, libvlc_exception_t * );
777 * Get current fullscreen status
778 * \param p_input the input
779 * \param p_exception an initialized exception
780 * \return the fullscreen status (boolean)
782 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_instance_t *, libvlc_exception_t * );
785 * Get current video height
786 * \param p_input the input
787 * \param p_exception an initialized exception
788 * \return the video height
790 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_instance_t *, libvlc_exception_t * );
793 * Get current video width
794 * \param p_input the input
795 * \param p_exception an initialized exception
796 * \return the video width
798 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_instance_t *, libvlc_exception_t * );
801 * Get current video aspect ratio
802 * \param p_input the input
803 * \param p_exception an initialized exception
804 * \return the video aspect ratio
806 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_instance_t *, libvlc_exception_t * );
809 * Set new video aspect ratio
810 * \param p_input the input
811 * \param psz_aspect new video aspect-ratio
812 * \param p_exception an initialized exception
814 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_instance_t *, char *, libvlc_exception_t * );
817 * Get current video subtitle
818 * \param p_input the input
819 * \param p_exception an initialized exception
820 * \return the video subtitle selected
822 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_instance_t *, libvlc_exception_t * );
825 * Set new video subtitle
826 * \param p_input the input
827 * \param i_spu new video subtitle to select
828 * \param p_exception an initialized exception
830 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_instance_t *, int , libvlc_exception_t * );
833 * Get current crop filter geometry
834 * \param p_input the input
835 * \param p_exception an initialized exception
836 * \return the crop filter geometry
838 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_instance_t *, libvlc_exception_t * );
841 * Set new crop filter geometry
842 * \param p_input the input
843 * \param psz_geometry new crop filter geometry
844 * \param p_exception an initialized exception
846 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_instance_t *, char *, libvlc_exception_t * );
849 * Toggle teletext transparent status on video output
850 * \param p_input the input
851 * \param p_exception an initialized exception
853 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_instance_t *, libvlc_exception_t * );
856 * Get current teletext page requested.
857 * \param p_input the input
858 * \param p_exception an initialized exception
859 * \return the current teletext page requested.
861 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_instance_t *, libvlc_exception_t * );
864 * Set new teletext page to retrieve
865 * \param p_input the input
866 * \param i_page teletex page number requested
867 * \param p_exception an initialized exception
869 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_instance_t *, int, libvlc_exception_t * );
872 * Take a snapshot of the current video window
873 * If i_width AND i_height is 0, original size is used
874 * if i_width XOR i_height is 0, original aspect-ratio is preserved
875 * \param p_input the input
876 * \param psz_filepath the path where to save the screenshot to
877 * \param i_width the snapshot's width
878 * \param i_height the snapshot's height
879 * \param p_exception an initialized exception
881 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_instance_t *, char *,unsigned int, unsigned int, libvlc_exception_t * );
883 VLC_PUBLIC_API int libvlc_video_destroy( libvlc_media_instance_t *, libvlc_exception_t *);
886 * Resize the current video output window
887 * \param p_instance libvlc instance
888 * \param width new width for video output window
889 * \param height new height for video output window
890 * \param p_exception an initialized exception
891 * \return the success status (boolean)
893 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_instance_t *, int, int, libvlc_exception_t *);
896 * change the parent for the current the video output
897 * \param p_instance libvlc instance
898 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
899 * \param p_exception an initialized exception
900 * \return the success status (boolean)
902 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
905 * Tell windowless video output to redraw rectangular area (MacOS X only)
906 * \param p_instance libvlc instance
907 * \param area coordinates within video drawable
908 * \param p_exception an initialized exception
910 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_instance_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
913 * Set the default video output parent
914 * this settings will be used as default for all video outputs
915 * \param p_instance libvlc instance
916 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
917 * \param p_exception an initialized exception
919 VLC_PUBLIC_API void libvlc_video_set_parent( libvlc_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
922 * Set the default video output parent
923 * this settings will be used as default for all video outputs
924 * \param p_instance libvlc instance
925 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
926 * \param p_exception an initialized exception
928 VLC_PUBLIC_API libvlc_drawable_t libvlc_video_get_parent( libvlc_instance_t *, libvlc_exception_t * );
931 * Set the default video output size
932 * this settings will be used as default for all video outputs
933 * \param p_instance libvlc instance
934 * \param width new width for video drawable
935 * \param height new height for video drawable
936 * \param p_exception an initialized exception
938 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
941 * Set the default video output viewport for a windowless video output (MacOS X only)
942 * this settings will be used as default for all video outputs
943 * \param p_instance libvlc instance
944 * \param view coordinates within video drawable
945 * \param clip coordinates within video drawable
946 * \param p_exception an initialized exception
948 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
952 /** defgroup libvlc_audio Audio
954 * LibVLC Audio handling
960 * \param p_instance libvlc instance
961 * \param p_exception an initialized exception
964 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
967 * Get current mute status
968 * \param p_instance libvlc instance
969 * \param p_exception an initialized exception
970 * \return the mute status (boolean)
972 VLC_PUBLIC_API vlc_bool_t libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
976 * \param p_instance libvlc instance
977 * \param status If status is VLC_TRUE then mute, otherwise unmute
978 * \param p_exception an initialized exception
981 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, vlc_bool_t , libvlc_exception_t * );
984 * Get current audio level
985 * \param p_instance libvlc instance
986 * \param p_exception an initialized exception
987 * \return the audio level (int)
989 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
992 * Set current audio level
993 * \param p_instance libvlc instance
994 * \param i_volume the volume (int)
995 * \param p_exception an initialized exception
997 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
1000 * Get number of available audio tracks
1001 * \param p_mi media instance
1002 * \param p_e an initialized exception
1003 * \return the number of available audio tracks (int)
1005 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_instance_t *, libvlc_exception_t * );
1008 + * Get current audio track
1009 + * \param p_input input instance
1010 + * \param p_exception an initialized exception
1011 + * \return the audio track (int)
1013 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_instance_t *, libvlc_exception_t * );
1016 * Set current audio track
1017 * \param p_input input instance
1018 * \param i_track the track (int)
1019 * \param p_exception an initialized exception
1021 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_instance_t *, int, libvlc_exception_t * );
1024 * Get current audio channel
1025 * \param p_instance input instance
1026 * \param p_exception an initialized exception
1027 * \return the audio channel (int)
1029 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
1032 * Set current audio channel
1033 * \param p_instance input instance
1034 * \param i_channel the audio channel (int)
1035 * \param p_exception an initialized exception
1037 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
1041 /*****************************************************************************
1042 * Services/Media Discovery
1043 *****************************************************************************/
1044 /** defgroup libvlc_media_discoverer Media Discoverer
1046 * LibVLC Media Discoverer
1050 VLC_PUBLIC_API libvlc_media_discoverer_t *
1051 libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
1052 const char * psz_name,
1053 libvlc_exception_t * p_e );
1054 VLC_PUBLIC_API void libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
1055 VLC_PUBLIC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
1057 VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis );
1059 VLC_PUBLIC_API libvlc_event_manager_t *
1060 libvlc_media_discoverer_event_manager( libvlc_media_discoverer_t * p_mdis );
1062 VLC_PUBLIC_API vlc_bool_t
1063 libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis );
1067 /*****************************************************************************
1069 *****************************************************************************/
1070 /** defgroup libvlc_vlm VLM
1077 * Add a broadcast, with one input
1078 * \param p_instance the instance
1079 * \param psz_name the name of the new broadcast
1080 * \param psz_input the input MRL
1081 * \param psz_output the output MRL (the parameter to the "sout" variable)
1082 * \param i_options number of additional options
1083 * \param ppsz_options additional options
1084 * \param b_enabled boolean for enabling the new broadcast
1085 * \param b_loop Should this broadcast be played in loop ?
1086 * \param p_exception an initialized exception
1088 VLC_PUBLIC_API void libvlc_vlm_add_broadcast( libvlc_instance_t *, char *, char *, char* ,
1089 int, char **, int, int, libvlc_exception_t * );
1092 * Delete a media (vod or broadcast)
1093 * \param p_instance the instance
1094 * \param psz_name the media to delete
1095 * \param p_exception an initialized exception
1097 VLC_PUBLIC_API void libvlc_vlm_del_media( libvlc_instance_t *, char *, libvlc_exception_t * );
1100 * Enable or disable a media (vod or broadcast)
1101 * \param p_instance the instance
1102 * \param psz_name the media to work on
1103 * \param b_enabled the new status
1104 * \param p_exception an initialized exception
1106 VLC_PUBLIC_API void libvlc_vlm_set_enabled( libvlc_instance_t *, char *, int,
1107 libvlc_exception_t *);
1110 * Set the output for a media
1111 * \param p_instance the instance
1112 * \param psz_name the media to work on
1113 * \param psz_output the output MRL (the parameter to the "sout" variable)
1114 * \param p_exception an initialized exception
1116 VLC_PUBLIC_API void libvlc_vlm_set_output( libvlc_instance_t *, char *, char*,
1117 libvlc_exception_t *);
1120 * Set a media's input MRL. This will delete all existing inputs and
1121 * add the specified one.
1122 * \param p_instance the instance
1123 * \param psz_name the media to work on
1124 * \param psz_input the input MRL
1125 * \param p_exception an initialized exception
1127 VLC_PUBLIC_API void libvlc_vlm_set_input( libvlc_instance_t *, char *, char*,
1128 libvlc_exception_t *);
1131 * Add a media's input MRL. This will add the specified one.
1132 * \param p_instance the instance
1133 * \param psz_name the media to work on
1134 * \param psz_input the input MRL
1135 * \param p_exception an initialized exception
1137 VLC_PUBLIC_API void libvlc_vlm_add_input( libvlc_instance_t *, char *, char *,
1138 libvlc_exception_t *p_exception );
1140 * Set output for a media
1141 * \param p_instance the instance
1142 * \param psz_name the media to work on
1143 * \param b_loop the new status
1144 * \param p_exception an initialized exception
1146 VLC_PUBLIC_API void libvlc_vlm_set_loop( libvlc_instance_t *, char *, int,
1147 libvlc_exception_t *);
1150 * Edit the parameters of a media. This will delete all existing inputs and
1151 * add the specified one.
1152 * \param p_instance the instance
1153 * \param psz_name the name of the new broadcast
1154 * \param psz_input the input MRL
1155 * \param psz_output the output MRL (the parameter to the "sout" variable)
1156 * \param i_options number of additional options
1157 * \param ppsz_options additional options
1158 * \param b_enabled boolean for enabling the new broadcast
1159 * \param b_loop Should this broadcast be played in loop ?
1160 * \param p_exception an initialized exception
1162 VLC_PUBLIC_API void libvlc_vlm_change_media( libvlc_instance_t *, char *, char *, char* ,
1163 int, char **, int, int, libvlc_exception_t * );
1166 * Plays the named broadcast.
1167 * \param p_instance the instance
1168 * \param psz_name the name of the broadcast
1169 * \param p_exception an initialized exception
1171 VLC_PUBLIC_API void libvlc_vlm_play_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
1174 * Stops the named broadcast.
1175 * \param p_instance the instance
1176 * \param psz_name the name of the broadcast
1177 * \param p_exception an initialized exception
1179 VLC_PUBLIC_API void libvlc_vlm_stop_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
1182 * Pauses the named broadcast.
1183 * \param p_instance the instance
1184 * \param psz_name the name of the broadcast
1185 * \param p_exception an initialized exception
1187 VLC_PUBLIC_API void libvlc_vlm_pause_media( libvlc_instance_t *, char *, libvlc_exception_t * );
1190 * Seeks in the named broadcast.
1191 * \param p_instance the instance
1192 * \param psz_name the name of the broadcast
1193 * \param f_percentage the percentage to seek to
1194 * \param p_exception an initialized exception
1196 VLC_PUBLIC_API void libvlc_vlm_seek_media( libvlc_instance_t *, char *,
1197 float, libvlc_exception_t * );
1200 * Return information of the named broadcast.
1201 * \param p_instance the instance
1202 * \param psz_name the name of the broadcast
1203 * \param p_exception an initialized exception
1205 VLC_PUBLIC_API char* libvlc_vlm_show_media( libvlc_instance_t *, char *, libvlc_exception_t * );
1207 #define LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( attr, returnType, getType, default)\
1208 returnType libvlc_vlm_get_media_## attr( libvlc_instance_t *, \
1209 char *, int , libvlc_exception_t * );
1211 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( position, float, Float, -1);
1212 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( time, int, Integer, -1);
1213 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( length, int, Integer, -1);
1214 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( rate, int, Integer, -1);
1215 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( title, int, Integer, 0);
1216 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( chapter, int, Integer, 0);
1217 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( seekable, int, Bool, 0);
1219 #undef LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
1223 /*****************************************************************************
1224 * Message log handling
1225 *****************************************************************************/
1227 /** defgroup libvlc_log Log
1229 * LibVLC Message Logging
1234 * Returns the VLC messaging verbosity level
1235 * \param p_instance libvlc instance
1236 * \param exception an initialized exception pointer
1238 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
1239 libvlc_exception_t *p_e );
1242 * Set the VLC messaging verbosity level
1243 * \param p_log libvlc log instance
1244 * \param exception an initialized exception pointer
1246 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
1247 libvlc_exception_t *p_e );
1250 * Open an instance to VLC message log
1251 * \param p_instance libvlc instance
1252 * \param exception an initialized exception pointer
1254 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( libvlc_instance_t *, libvlc_exception_t *);
1257 * Close an instance of VLC message log
1258 * \param p_log libvlc log instance
1259 * \param exception an initialized exception pointer
1261 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
1264 * Returns the number of messages in log
1265 * \param p_log libvlc log instance
1266 * \param exception an initialized exception pointer
1268 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
1271 * Clear all messages in log
1272 * the log should be cleared on a regular basis to avoid clogging
1273 * \param p_log libvlc log instance
1274 * \param exception an initialized exception pointer
1276 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
1279 * Allocate and returns a new iterator to messages in log
1280 * \param p_log libvlc log instance
1281 * \param exception an initialized exception pointer
1283 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
1286 * Releases a previoulsy allocated iterator
1287 * \param p_log libvlc log iterator
1288 * \param exception an initialized exception pointer
1290 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1293 * Returns whether log iterator has more messages
1294 * \param p_log libvlc log iterator
1295 * \param exception an initialized exception pointer
1297 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1300 * Returns next log message
1301 * the content of message must not be freed
1302 * \param p_log libvlc log iterator
1303 * \param exception an initialized exception pointer
1305 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
1306 struct libvlc_log_message_t *buffer,
1307 libvlc_exception_t *p_e );
1311 /*****************************************************************************
1313 *****************************************************************************/
1315 /** defgroup libvlc_callbacks Callbacks
1322 * Register for an event notification
1323 * \param p_event_manager the event manager to which you want to attach to
1324 * Generally it is obtained by vlc_my_object_event_manager() where my_object
1325 * Is the object you want to listen to.
1326 * \param i_event_type the desired event to which we want to listen
1327 * \param f_callback the function to call when i_event_type occurs
1328 * \param user_data user provided data to carry with the event
1329 * \param p_e an initialized exception pointer
1331 VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
1332 libvlc_event_type_t i_event_type,
1333 libvlc_callback_t f_callback,
1335 libvlc_exception_t *p_e );
1338 * Unregister an event notification
1339 * \param p_event_manager the event manager
1340 * \param i_event_type the desired event to which we want to unregister
1341 * \param f_callback the function to call when i_event_type occurs
1342 * \param p_e an initialized exception pointer
1344 VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
1345 libvlc_event_type_t i_event_type,
1346 libvlc_callback_t f_callback,
1348 libvlc_exception_t *p_e );
1351 * Get an event type name
1352 * \param i_event_type the desired event
1354 VLC_PUBLIC_API const char * libvlc_event_type_name( libvlc_event_type_t event_type );
1363 #endif /* <vlc/libvlc.h> */