1 /*****************************************************************************
2 * libvlc.h: libvlc_* new external API
3 *****************************************************************************
4 * Copyright (C) 1998-2005 the VideoLAN team
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 (argv[0] must be the path of calling program)
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 * );
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 );
189 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_descriptor_duplicate( libvlc_media_descriptor_t * );
192 * Read the meta of the media descriptor.
193 * \param p_meta_desc the media descriptor to read
194 * \param p_meta_desc the meta to read
196 VLC_PUBLIC_API char * libvlc_media_descriptor_get_meta(
197 libvlc_media_descriptor_t *p_meta_desc,
198 libvlc_meta_t e_meta,
199 libvlc_exception_t *p_e );
201 VLC_PUBLIC_API libvlc_state_t libvlc_media_descriptor_get_state(
202 libvlc_media_descriptor_t *p_meta_desc,
203 libvlc_exception_t *p_e );
206 VLC_PUBLIC_API void libvlc_media_descriptor_add_tag( libvlc_media_descriptor_t *p_md,
208 const libvlc_tag_t tag,
209 libvlc_exception_t *p_e );
211 VLC_PUBLIC_API void libvlc_media_descriptor_remove_tag( libvlc_media_descriptor_t *p_md,
213 const libvlc_tag_t tag,
214 libvlc_exception_t *p_e );
217 libvlc_media_descriptor_tags_count_for_key( libvlc_media_descriptor_t *p_md,
219 libvlc_exception_t *p_e );
221 VLC_PUBLIC_API libvlc_tag_t
222 libvlc_media_descriptor_tag_at_index_for_key( libvlc_media_descriptor_t *p_md,
225 libvlc_exception_t *p_e );
227 VLC_PUBLIC_API libvlc_media_list_t *
228 libvlc_media_descriptor_subitems( libvlc_media_descriptor_t *p_md,
229 libvlc_exception_t *p_e );
231 VLC_PUBLIC_API libvlc_event_manager_t *
232 libvlc_media_descriptor_event_manager( libvlc_media_descriptor_t * p_md,
233 libvlc_exception_t * p_e );
235 VLC_PUBLIC_API libvlc_time_t
236 libvlc_media_descriptor_get_duration( libvlc_media_descriptor_t * p_md,
237 libvlc_exception_t * p_e );
240 libvlc_media_descriptor_is_preparsed( libvlc_media_descriptor_t * p_md,
241 libvlc_exception_t * p_e );
244 libvlc_media_descriptor_set_user_data( libvlc_media_descriptor_t * p_md,
245 void * p_new_user_data,
246 libvlc_exception_t * p_e);
247 VLC_PUBLIC_API void *
248 libvlc_media_descriptor_get_user_data( libvlc_media_descriptor_t * p_md,
249 libvlc_exception_t * p_e);
253 /*****************************************************************************
255 *****************************************************************************/
256 /** defgroup libvlc_playlist Playlist
258 * LibVLC Playlist handling
265 VLC_PUBLIC_API void libvlc_playlist_loop( libvlc_instance_t* , int,
266 libvlc_exception_t * );
269 * Start playing. You can give some additionnal playlist item options
270 * that will be added to the item before playing it.
271 * \param p_instance the instance
272 * \param i_id the item to play. If this is a negative number, the next
273 * item will be selected. Else, the item with the given ID will be played
274 * \param i_options the number of options to add to the item
275 * \param ppsz_options the options to add to the item
276 * \param p_exception an initialized exception
278 VLC_PUBLIC_API void libvlc_playlist_play( libvlc_instance_t*, int, int, char **,
279 libvlc_exception_t * );
282 * Pause a running playlist, resume if it was stopped
283 * \param p_instance the instance to pause
284 * \param p_exception an initialized exception
286 VLC_PUBLIC_API void libvlc_playlist_pause( libvlc_instance_t *, libvlc_exception_t * );
289 * Checks if the playlist is running
290 * \param p_instance the instance
291 * \param p_exception an initialized exception
292 * \return 0 if the playlist is stopped or paused, 1 if it is running
294 VLC_PUBLIC_API int libvlc_playlist_isplaying( libvlc_instance_t *, libvlc_exception_t * );
297 * Get the number of items in the playlist
298 * \param p_instance the instance
299 * \param p_exception an initialized exception
300 * \return the number of items
302 VLC_PUBLIC_API int libvlc_playlist_items_count( libvlc_instance_t *, libvlc_exception_t * );
305 * Lock the playlist instance
306 * \param p_instance the instance
308 VLC_PUBLIC_API void libvlc_playlist_lock( libvlc_instance_t * );
311 * Unlock the playlist instance
312 * \param p_instance the instance
314 VLC_PUBLIC_API void libvlc_playlist_unlock( libvlc_instance_t * );
318 * \param p_instance the instance to stop
319 * \param p_exception an initialized exception
321 VLC_PUBLIC_API void libvlc_playlist_stop( libvlc_instance_t *, libvlc_exception_t * );
324 * Go to next playlist item (starts playback if it was stopped)
325 * \param p_instance the instance to use
326 * \param p_exception an initialized exception
328 VLC_PUBLIC_API void libvlc_playlist_next( libvlc_instance_t *, libvlc_exception_t * );
331 * Go to previous playlist item (starts playback if it was stopped)
332 * \param p_instance the instance to use
333 * \param p_exception an initialized exception
335 VLC_PUBLIC_API void libvlc_playlist_prev( libvlc_instance_t *, libvlc_exception_t * );
338 * Remove all playlist items
339 * \param p_instance the instance
340 * \param p_exception an initialized exception
342 VLC_PUBLIC_API void libvlc_playlist_clear( libvlc_instance_t *, libvlc_exception_t * );
345 * Add an item at the end of the playlist
346 * If you need more advanced options, \see libvlc_playlist_add_extended
347 * \param p_instance the instance
348 * \param psz_uri the URI to open, using VLC format
349 * \param psz_name a name that you might want to give or NULL
350 * \return the identifier of the new item
352 VLC_PUBLIC_API int libvlc_playlist_add( libvlc_instance_t *, const char *, const char *,
353 libvlc_exception_t * );
356 * Add an item at the end of the playlist, with additional input options
357 * \param p_instance the instance
358 * \param psz_uri the URI to open, using VLC format
359 * \param psz_name a name that you might want to give or NULL
360 * \param i_options the number of options to add
361 * \param ppsz_options strings representing the options to add
362 * \param p_exception an initialized exception
363 * \return the identifier of the new item
365 VLC_PUBLIC_API int libvlc_playlist_add_extended( libvlc_instance_t *, const char *,
366 const char *, int, const char **,
367 libvlc_exception_t * );
370 * Delete the playlist item with the given ID.
371 * \param p_instance the instance
372 * \param i_id the id to remove
373 * \param p_exception an initialized exception
376 VLC_PUBLIC_API int libvlc_playlist_delete_item( libvlc_instance_t *, int,
377 libvlc_exception_t * );
379 /** Get the input that is currently being played by the playlist
380 * \param p_instance the instance to use
381 * \param p_exception an initialized excecption
382 * \return an input object
384 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_playlist_get_media_instance(
385 libvlc_instance_t *, libvlc_exception_t * );
387 VLC_PUBLIC_API int libvlc_media_instance_is_seekable(
388 libvlc_media_instance_t *p_mi,
389 libvlc_exception_t *p_e );
391 VLC_PUBLIC_API int libvlc_media_instance_can_pause(
392 libvlc_media_instance_t *p_mi,
393 libvlc_exception_t *p_e );
397 /*****************************************************************************
399 *****************************************************************************/
400 /** defgroup libvlc_media_instance Media Instance
402 * LibVLC Media Instance
406 /** Create an empty Media Instance object
407 * \param p_libvlc_instance the libvlc instance in which the Media Instance
408 * should be (not used for now).
410 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new( libvlc_instance_t *, libvlc_exception_t * );
412 /** Create a Media Instance object from a Media Descriptor
413 * \param p_md the media descriptor. Afterwards the p_md can safely be
416 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new_from_media_descriptor( libvlc_media_descriptor_t *, libvlc_exception_t * );
418 /** Release a media_instance after use
419 * \param p_mi the Media Instance to free
421 VLC_PUBLIC_API void libvlc_media_instance_release( libvlc_media_instance_t * );
422 VLC_PUBLIC_API void libvlc_media_instance_retain( libvlc_media_instance_t * );
424 /** Set the media descriptor that will be used by the media_instance. If any,
425 * previous md will be released.
426 * \param p_mi the Media Instance
427 * \param p_md the Media Descriptor. Afterwards the p_md can safely be
430 VLC_PUBLIC_API void libvlc_media_instance_set_media_descriptor( libvlc_media_instance_t *, libvlc_media_descriptor_t *, libvlc_exception_t * );
432 /** Get the media descriptor used by the media_instance (if any). A copy of
433 * the md is returned. NULL is returned if no media instance is associated.
434 * \param p_mi the Media Instance
436 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_instance_get_media_descriptor( libvlc_media_instance_t *, libvlc_exception_t * );
438 /** Get the Event Manager from which the media instance send event.
439 * \param p_mi the Media Instance
441 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_instance_event_manager ( libvlc_media_instance_t *, libvlc_exception_t * );
443 VLC_PUBLIC_API void libvlc_media_instance_play ( libvlc_media_instance_t *, libvlc_exception_t * );
444 VLC_PUBLIC_API void libvlc_media_instance_pause ( libvlc_media_instance_t *, libvlc_exception_t * );
445 VLC_PUBLIC_API void libvlc_media_instance_stop ( libvlc_media_instance_t *, libvlc_exception_t * );
447 VLC_PUBLIC_API void libvlc_media_instance_set_drawable ( libvlc_media_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
448 VLC_PUBLIC_API libvlc_drawable_t
449 libvlc_media_instance_get_drawable ( libvlc_media_instance_t *, libvlc_exception_t * );
451 /** \bug This might go away ... to be replaced by a broader system */
452 VLC_PUBLIC_API libvlc_time_t libvlc_media_instance_get_length ( libvlc_media_instance_t *, libvlc_exception_t *);
453 VLC_PUBLIC_API libvlc_time_t libvlc_media_instance_get_time ( libvlc_media_instance_t *, libvlc_exception_t *);
454 VLC_PUBLIC_API void libvlc_media_instance_set_time ( libvlc_media_instance_t *, libvlc_time_t, libvlc_exception_t *);
455 VLC_PUBLIC_API float libvlc_media_instance_get_position ( libvlc_media_instance_t *, libvlc_exception_t *);
456 VLC_PUBLIC_API void libvlc_media_instance_set_position ( libvlc_media_instance_t *, float, libvlc_exception_t *);
457 VLC_PUBLIC_API void libvlc_media_instance_set_chapter ( libvlc_media_instance_t *, int, libvlc_exception_t *);
458 VLC_PUBLIC_API int libvlc_media_instance_get_chapter (libvlc_media_instance_t *, libvlc_exception_t *);
459 VLC_PUBLIC_API int libvlc_media_instance_get_chapter_count( libvlc_media_instance_t *, libvlc_exception_t *);
460 VLC_PUBLIC_API int libvlc_media_instance_will_play ( libvlc_media_instance_t *, libvlc_exception_t *);
461 VLC_PUBLIC_API float libvlc_media_instance_get_rate ( libvlc_media_instance_t *, libvlc_exception_t *);
462 VLC_PUBLIC_API void libvlc_media_instance_set_rate ( libvlc_media_instance_t *, float, libvlc_exception_t *);
463 VLC_PUBLIC_API libvlc_state_t libvlc_media_instance_get_state ( libvlc_media_instance_t *, libvlc_exception_t *);
466 * Does this input have a video output ?
467 * \param p_input the input
468 * \param p_exception an initialized exception
470 VLC_PUBLIC_API int libvlc_media_instance_has_vout( libvlc_media_instance_t *, libvlc_exception_t *);
471 VLC_PUBLIC_API float libvlc_media_instance_get_fps( libvlc_media_instance_t *, libvlc_exception_t *);
476 /*****************************************************************************
478 *****************************************************************************/
479 /** defgroup libvlc_tag_query Tag Query
484 VLC_PUBLIC_API libvlc_tag_query_t *
485 libvlc_tag_query_new( libvlc_instance_t *, libvlc_exception_t * );
488 libvlc_tag_query_release( libvlc_tag_query_t * );
491 libvlc_tag_query_retain( libvlc_tag_query_t * );
494 libvlc_tag_query_set_match_tag_and_key( libvlc_tag_query_t * p_q,
497 libvlc_exception_t * );
500 libvlc_tag_query_match( libvlc_tag_query_t *, libvlc_media_descriptor_t *,
501 libvlc_exception_t * );
505 /*****************************************************************************
507 *****************************************************************************/
508 /** defgroup libvlc_media_list MediaList
513 VLC_PUBLIC_API libvlc_media_list_t *
514 libvlc_media_list_new( libvlc_instance_t *, libvlc_exception_t * );
517 libvlc_media_list_release( libvlc_media_list_t * );
520 libvlc_media_list_retain( libvlc_media_list_t * );
523 libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist,
524 const char * psz_uri,
525 libvlc_exception_t * p_e );
528 libvlc_media_list_set_media_descriptor( libvlc_media_list_t *,
529 libvlc_media_descriptor_t *,
530 libvlc_exception_t *);
532 VLC_PUBLIC_API libvlc_media_descriptor_t *
533 libvlc_media_list_media_descriptor( libvlc_media_list_t *,
534 libvlc_exception_t *);
537 libvlc_media_list_add_media_descriptor( libvlc_media_list_t *,
538 libvlc_media_descriptor_t *,
539 libvlc_exception_t * );
541 libvlc_media_list_insert_media_descriptor( libvlc_media_list_t *,
542 libvlc_media_descriptor_t *,
544 libvlc_exception_t * );
546 libvlc_media_list_remove_index( libvlc_media_list_t *, int,
547 libvlc_exception_t * );
550 libvlc_media_list_count( libvlc_media_list_t * p_mlist,
551 libvlc_exception_t * p_e );
553 VLC_PUBLIC_API libvlc_media_descriptor_t *
554 libvlc_media_list_item_at_index( libvlc_media_list_t *, int,
555 libvlc_exception_t * );
557 libvlc_media_list_index_of_item( libvlc_media_list_t *,
558 libvlc_media_descriptor_t *,
559 libvlc_exception_t * );
561 /* This indicates if this media list is read-only from a user point of view */
563 libvlc_media_list_is_readonly( libvlc_media_list_t * p_mlist );
566 libvlc_media_list_lock( libvlc_media_list_t * );
568 libvlc_media_list_unlock( libvlc_media_list_t * );
570 VLC_PUBLIC_API libvlc_media_list_view_t *
571 libvlc_media_list_flat_view( libvlc_media_list_t *,
572 libvlc_exception_t * );
574 VLC_PUBLIC_API libvlc_media_list_view_t *
575 libvlc_media_list_hierarchical_view( libvlc_media_list_t *,
576 libvlc_exception_t * );
578 VLC_PUBLIC_API libvlc_media_list_view_t *
579 libvlc_media_list_hierarchical_node_view( libvlc_media_list_t *,
580 libvlc_exception_t * );
582 VLC_PUBLIC_API libvlc_event_manager_t *
583 libvlc_media_list_event_manager( libvlc_media_list_t *,
584 libvlc_exception_t * );
588 /*****************************************************************************
590 *****************************************************************************/
591 /** defgroup libvlc_media_list_view MediaListView
593 * LibVLC Media List View
597 libvlc_media_list_view_retain( libvlc_media_list_view_t * p_mlv );
600 libvlc_media_list_view_release( libvlc_media_list_view_t * p_mlv );
602 VLC_PUBLIC_API libvlc_event_manager_t *
603 libvlc_media_list_view_event_manager( libvlc_media_list_view_t * p_mlv );
606 libvlc_media_list_view_count( libvlc_media_list_view_t * p_mlv,
607 libvlc_exception_t * p_e );
609 VLC_PUBLIC_API libvlc_media_descriptor_t *
610 libvlc_media_list_view_item_at_index( libvlc_media_list_view_t * p_mlv,
612 libvlc_exception_t * p_e );
614 VLC_PUBLIC_API libvlc_media_list_view_t *
615 libvlc_media_list_view_children_at_index( libvlc_media_list_view_t * p_mlv,
617 libvlc_exception_t * p_e );
619 VLC_PUBLIC_API libvlc_media_list_view_t *
620 libvlc_media_list_view_children_for_item( libvlc_media_list_view_t * p_mlv,
621 libvlc_media_descriptor_t * p_md,
622 libvlc_exception_t * p_e );
626 libvlc_media_list_view_index_of_item( libvlc_media_list_view_t * p_mlv,
627 libvlc_media_descriptor_t * p_md,
628 libvlc_exception_t * p_e );
631 libvlc_media_list_view_insert_at_index( libvlc_media_list_view_t * p_mlv,
632 libvlc_media_descriptor_t * p_md,
634 libvlc_exception_t * p_e );
637 libvlc_media_list_view_remove_at_index( libvlc_media_list_view_t * p_mlv,
639 libvlc_exception_t * p_e );
642 libvlc_media_list_view_add_item( libvlc_media_list_view_t * p_mlv,
643 libvlc_media_descriptor_t * p_md,
644 libvlc_exception_t * p_e );
646 VLC_PUBLIC_API libvlc_media_list_t *
647 libvlc_media_list_view_parent_media_list( libvlc_media_list_view_t * p_mlv,
648 libvlc_exception_t * p_e );
652 /*****************************************************************************
653 * Dynamic Media List (Deprecated)
654 *****************************************************************************/
655 /** defgroup libvlc_media_list MediaList
660 VLC_PUBLIC_API libvlc_dynamic_media_list_t *
661 libvlc_dynamic_media_list_new( libvlc_media_list_t * p_mlist,
662 libvlc_tag_query_t * p_query,
664 libvlc_exception_t * p_e );
666 libvlc_dynamic_media_list_release( libvlc_dynamic_media_list_t * p_dmlist );
669 libvlc_dynamic_media_list_retain( libvlc_dynamic_media_list_t * p_dmlist );
671 libvlc_media_list_t *
672 libvlc_dynamic_media_list_media_list( libvlc_dynamic_media_list_t * p_dmlist,
673 libvlc_exception_t * p_e );
677 /*****************************************************************************
679 *****************************************************************************/
680 /** defgroup libvlc_media_library Media Library
682 * LibVLC Media Library
685 VLC_PUBLIC_API libvlc_media_library_t *
686 libvlc_media_library_new( libvlc_instance_t * p_inst,
687 libvlc_exception_t * p_e );
689 libvlc_media_library_release( libvlc_media_library_t * p_mlib );
691 libvlc_media_library_retain( libvlc_media_library_t * p_mlib );
695 libvlc_media_library_load( libvlc_media_library_t * p_mlib,
696 libvlc_exception_t * p_e );
699 libvlc_media_library_save( libvlc_media_library_t * p_mlib,
700 libvlc_exception_t * p_e );
702 VLC_PUBLIC_API libvlc_media_list_t *
703 libvlc_media_library_media_list( libvlc_media_library_t * p_mlib,
704 libvlc_exception_t * p_e );
709 /*****************************************************************************
711 *****************************************************************************/
712 /** defgroup libvlc_media_list_player MediaListPlayer
714 * LibVLC Media List Player
717 VLC_PUBLIC_API libvlc_media_list_player_t *
718 libvlc_media_list_player_new( libvlc_instance_t * p_instance,
719 libvlc_exception_t * p_e );
721 libvlc_media_list_player_release( libvlc_media_list_player_t * p_mlp );
724 libvlc_media_list_player_set_media_instance(
725 libvlc_media_list_player_t * p_mlp,
726 libvlc_media_instance_t * p_mi,
727 libvlc_exception_t * p_e );
730 libvlc_media_list_player_set_media_list(
731 libvlc_media_list_player_t * p_mlp,
732 libvlc_media_list_t * p_mlist,
733 libvlc_exception_t * p_e );
736 libvlc_media_list_player_play( libvlc_media_list_player_t * p_mlp,
737 libvlc_exception_t * p_e );
740 libvlc_media_list_player_pause( libvlc_media_list_player_t * p_mlp,
741 libvlc_exception_t * p_e );
744 libvlc_media_list_player_is_playing( libvlc_media_list_player_t * p_mlp,
745 libvlc_exception_t * p_e );
747 VLC_PUBLIC_API libvlc_state_t
748 libvlc_media_list_player_get_state( libvlc_media_list_player_t * p_mlp,
749 libvlc_exception_t * p_e );
752 libvlc_media_list_player_play_item_at_index(
753 libvlc_media_list_player_t * p_mlp,
755 libvlc_exception_t * p_e );
758 libvlc_media_list_player_play_item(
759 libvlc_media_list_player_t * p_mlp,
760 libvlc_media_descriptor_t * p_md,
761 libvlc_exception_t * p_e );
764 libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp,
765 libvlc_exception_t * p_e );
767 libvlc_media_list_player_next( libvlc_media_list_player_t * p_mlp,
768 libvlc_exception_t * p_e );
772 /** defgroup libvlc_video Video
774 * LibVLC Video handling
779 * Toggle fullscreen status on video output
780 * \param p_input the input
781 * \param p_exception an initialized exception
783 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_instance_t *, libvlc_exception_t * );
786 * Enable or disable fullscreen on a video output
787 * \param p_input the input
788 * \param b_fullscreen boolean for fullscreen status
789 * \param p_exception an initialized exception
791 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_instance_t *, int, libvlc_exception_t * );
794 * Get current fullscreen status
795 * \param p_input the input
796 * \param p_exception an initialized exception
797 * \return the fullscreen status (boolean)
799 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_instance_t *, libvlc_exception_t * );
802 * Get current video height
803 * \param p_input the input
804 * \param p_exception an initialized exception
805 * \return the video height
807 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_instance_t *, libvlc_exception_t * );
810 * Get current video width
811 * \param p_input the input
812 * \param p_exception an initialized exception
813 * \return the video width
815 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_instance_t *, libvlc_exception_t * );
818 * Get current video aspect ratio
819 * \param p_input the input
820 * \param p_exception an initialized exception
821 * \return the video aspect ratio
823 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_instance_t *, libvlc_exception_t * );
826 * Set new video aspect ratio
827 * \param p_input the input
828 * \param psz_aspect new video aspect-ratio
829 * \param p_exception an initialized exception
831 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_instance_t *, char *, libvlc_exception_t * );
834 * Get current video subtitle
835 * \param p_input the input
836 * \param p_exception an initialized exception
837 * \return the video subtitle selected
839 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_instance_t *, libvlc_exception_t * );
842 * Set new video subtitle
843 * \param p_input the input
844 * \param i_spu new video subtitle to select
845 * \param p_exception an initialized exception
847 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_instance_t *, int , libvlc_exception_t * );
850 * Get current crop filter geometry
851 * \param p_input the input
852 * \param p_exception an initialized exception
853 * \return the crop filter geometry
855 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_instance_t *, libvlc_exception_t * );
858 * Set new crop filter geometry
859 * \param p_input the input
860 * \param psz_geometry new crop filter geometry
861 * \param p_exception an initialized exception
863 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_instance_t *, char *, libvlc_exception_t * );
866 * Toggle teletext transparent status on video output
867 * \param p_input the input
868 * \param p_exception an initialized exception
870 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_instance_t *, libvlc_exception_t * );
873 * Get current teletext page requested.
874 * \param p_input the input
875 * \param p_exception an initialized exception
876 * \return the current teletext page requested.
878 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_instance_t *, libvlc_exception_t * );
881 * Set new teletext page to retrieve
882 * \param p_input the input
883 * \param i_page teletex page number requested
884 * \param p_exception an initialized exception
886 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_instance_t *, int, libvlc_exception_t * );
889 * Take a snapshot of the current video window
890 * If i_width AND i_height is 0, original size is used
891 * if i_width XOR i_height is 0, original aspect-ratio is preserved
892 * \param p_input the input
893 * \param psz_filepath the path where to save the screenshot to
894 * \param i_width the snapshot's width
895 * \param i_height the snapshot's height
896 * \param p_exception an initialized exception
898 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_instance_t *, char *,unsigned int, unsigned int, libvlc_exception_t * );
900 VLC_PUBLIC_API int libvlc_video_destroy( libvlc_media_instance_t *, libvlc_exception_t *);
903 * Resize the current video output window
904 * \param p_instance libvlc instance
905 * \param width new width for video output window
906 * \param height new height for video output window
907 * \param p_exception an initialized exception
908 * \return the success status (boolean)
910 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_instance_t *, int, int, libvlc_exception_t *);
913 * change the parent for the current the video output
914 * \param p_instance libvlc instance
915 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
916 * \param p_exception an initialized exception
917 * \return the success status (boolean)
919 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
922 * Tell windowless video output to redraw rectangular area (MacOS X only)
923 * \param p_instance libvlc instance
924 * \param area coordinates within video drawable
925 * \param p_exception an initialized exception
927 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_instance_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
930 * Set the default video output parent
931 * this settings will be used as default for all video outputs
932 * \param p_instance libvlc instance
933 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
934 * \param p_exception an initialized exception
936 VLC_PUBLIC_API void libvlc_video_set_parent( libvlc_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
939 * Set the default video output parent
940 * this settings will be used as default for all video outputs
941 * \param p_instance libvlc instance
942 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
943 * \param p_exception an initialized exception
945 VLC_PUBLIC_API libvlc_drawable_t libvlc_video_get_parent( libvlc_instance_t *, libvlc_exception_t * );
948 * Set the default video output size
949 * this settings will be used as default for all video outputs
950 * \param p_instance libvlc instance
951 * \param width new width for video drawable
952 * \param height new height for video drawable
953 * \param p_exception an initialized exception
955 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
958 * Set the default video output viewport for a windowless video output (MacOS X only)
959 * this settings will be used as default for all video outputs
960 * \param p_instance libvlc instance
961 * \param view coordinates within video drawable
962 * \param clip coordinates within video drawable
963 * \param p_exception an initialized exception
965 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
969 /** defgroup libvlc_audio Audio
971 * LibVLC Audio handling
977 * \param p_instance libvlc instance
978 * \param p_exception an initialized exception
981 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
984 * Get current mute status
985 * \param p_instance libvlc instance
986 * \param p_exception an initialized exception
987 * \return the mute status (boolean)
989 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
993 * \param p_instance libvlc instance
994 * \param status If status is VLC_TRUE then mute, otherwise unmute
995 * \param p_exception an initialized exception
998 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, int , libvlc_exception_t * );
1001 * Get current audio level
1002 * \param p_instance libvlc instance
1003 * \param p_exception an initialized exception
1004 * \return the audio level (int)
1006 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
1009 * Set current audio level
1010 * \param p_instance libvlc instance
1011 * \param i_volume the volume (int)
1012 * \param p_exception an initialized exception
1014 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
1017 * Get number of available audio tracks
1018 * \param p_mi media instance
1019 * \param p_e an initialized exception
1020 * \return the number of available audio tracks (int)
1022 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_instance_t *, libvlc_exception_t * );
1025 + * Get current audio track
1026 + * \param p_input input instance
1027 + * \param p_exception an initialized exception
1028 + * \return the audio track (int)
1030 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_instance_t *, libvlc_exception_t * );
1033 * Set current audio track
1034 * \param p_input input instance
1035 * \param i_track the track (int)
1036 * \param p_exception an initialized exception
1038 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_instance_t *, int, libvlc_exception_t * );
1041 * Get current audio channel
1042 * \param p_instance input instance
1043 * \param p_exception an initialized exception
1044 * \return the audio channel (int)
1046 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
1049 * Set current audio channel
1050 * \param p_instance input instance
1051 * \param i_channel the audio channel (int)
1052 * \param p_exception an initialized exception
1054 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
1058 /*****************************************************************************
1059 * Services/Media Discovery
1060 *****************************************************************************/
1061 /** defgroup libvlc_media_discoverer Media Discoverer
1063 * LibVLC Media Discoverer
1067 VLC_PUBLIC_API libvlc_media_discoverer_t *
1068 libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
1069 const char * psz_name,
1070 libvlc_exception_t * p_e );
1071 VLC_PUBLIC_API void libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
1072 VLC_PUBLIC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
1074 VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis );
1076 VLC_PUBLIC_API libvlc_event_manager_t *
1077 libvlc_media_discoverer_event_manager( libvlc_media_discoverer_t * p_mdis );
1080 libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis );
1084 /*****************************************************************************
1086 *****************************************************************************/
1087 /** defgroup libvlc_vlm VLM
1094 * Add a broadcast, with one input
1095 * \param p_instance the instance
1096 * \param psz_name the name of the new broadcast
1097 * \param psz_input the input MRL
1098 * \param psz_output the output MRL (the parameter to the "sout" variable)
1099 * \param i_options number of additional options
1100 * \param ppsz_options additional options
1101 * \param b_enabled boolean for enabling the new broadcast
1102 * \param b_loop Should this broadcast be played in loop ?
1103 * \param p_exception an initialized exception
1105 VLC_PUBLIC_API void libvlc_vlm_add_broadcast( libvlc_instance_t *, char *, char *, char* ,
1106 int, char **, int, int, libvlc_exception_t * );
1109 * Delete a media (vod or broadcast)
1110 * \param p_instance the instance
1111 * \param psz_name the media to delete
1112 * \param p_exception an initialized exception
1114 VLC_PUBLIC_API void libvlc_vlm_del_media( libvlc_instance_t *, char *, libvlc_exception_t * );
1117 * Enable or disable a media (vod or broadcast)
1118 * \param p_instance the instance
1119 * \param psz_name the media to work on
1120 * \param b_enabled the new status
1121 * \param p_exception an initialized exception
1123 VLC_PUBLIC_API void libvlc_vlm_set_enabled( libvlc_instance_t *, char *, int,
1124 libvlc_exception_t *);
1127 * Set the output for a media
1128 * \param p_instance the instance
1129 * \param psz_name the media to work on
1130 * \param psz_output the output MRL (the parameter to the "sout" variable)
1131 * \param p_exception an initialized exception
1133 VLC_PUBLIC_API void libvlc_vlm_set_output( libvlc_instance_t *, char *, char*,
1134 libvlc_exception_t *);
1137 * Set a media's input MRL. This will delete all existing inputs and
1138 * add the specified one.
1139 * \param p_instance the instance
1140 * \param psz_name the media to work on
1141 * \param psz_input the input MRL
1142 * \param p_exception an initialized exception
1144 VLC_PUBLIC_API void libvlc_vlm_set_input( libvlc_instance_t *, char *, char*,
1145 libvlc_exception_t *);
1148 * Add a media's input MRL. This will add the specified one.
1149 * \param p_instance the instance
1150 * \param psz_name the media to work on
1151 * \param psz_input the input MRL
1152 * \param p_exception an initialized exception
1154 VLC_PUBLIC_API void libvlc_vlm_add_input( libvlc_instance_t *, char *, char *,
1155 libvlc_exception_t *p_exception );
1157 * Set output for a media
1158 * \param p_instance the instance
1159 * \param psz_name the media to work on
1160 * \param b_loop the new status
1161 * \param p_exception an initialized exception
1163 VLC_PUBLIC_API void libvlc_vlm_set_loop( libvlc_instance_t *, char *, int,
1164 libvlc_exception_t *);
1167 * Edit the parameters of a media. This will delete all existing inputs and
1168 * add the specified one.
1169 * \param p_instance the instance
1170 * \param psz_name the name of the new broadcast
1171 * \param psz_input the input MRL
1172 * \param psz_output the output MRL (the parameter to the "sout" variable)
1173 * \param i_options number of additional options
1174 * \param ppsz_options additional options
1175 * \param b_enabled boolean for enabling the new broadcast
1176 * \param b_loop Should this broadcast be played in loop ?
1177 * \param p_exception an initialized exception
1179 VLC_PUBLIC_API void libvlc_vlm_change_media( libvlc_instance_t *, char *, char *, char* ,
1180 int, char **, int, int, libvlc_exception_t * );
1183 * Plays the named broadcast.
1184 * \param p_instance the instance
1185 * \param psz_name the name of the broadcast
1186 * \param p_exception an initialized exception
1188 VLC_PUBLIC_API void libvlc_vlm_play_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
1191 * Stops the named broadcast.
1192 * \param p_instance the instance
1193 * \param psz_name the name of the broadcast
1194 * \param p_exception an initialized exception
1196 VLC_PUBLIC_API void libvlc_vlm_stop_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
1199 * Pauses the named broadcast.
1200 * \param p_instance the instance
1201 * \param psz_name the name of the broadcast
1202 * \param p_exception an initialized exception
1204 VLC_PUBLIC_API void libvlc_vlm_pause_media( libvlc_instance_t *, char *, libvlc_exception_t * );
1207 * Seeks in the named broadcast.
1208 * \param p_instance the instance
1209 * \param psz_name the name of the broadcast
1210 * \param f_percentage the percentage to seek to
1211 * \param p_exception an initialized exception
1213 VLC_PUBLIC_API void libvlc_vlm_seek_media( libvlc_instance_t *, char *,
1214 float, libvlc_exception_t * );
1217 * Return information of the named broadcast.
1218 * \param p_instance the instance
1219 * \param psz_name the name of the broadcast
1220 * \param p_exception an initialized exception
1222 VLC_PUBLIC_API char* libvlc_vlm_show_media( libvlc_instance_t *, char *, libvlc_exception_t * );
1224 #define LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( attr, returnType, getType, default)\
1225 returnType libvlc_vlm_get_media_## attr( libvlc_instance_t *, \
1226 char *, int , libvlc_exception_t * );
1228 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( position, float, Float, -1);
1229 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( time, int, Integer, -1);
1230 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( length, int, Integer, -1);
1231 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( rate, int, Integer, -1);
1232 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( title, int, Integer, 0);
1233 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( chapter, int, Integer, 0);
1234 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( seekable, int, Bool, 0);
1236 #undef LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
1240 /*****************************************************************************
1241 * Message log handling
1242 *****************************************************************************/
1244 /** defgroup libvlc_log Log
1246 * LibVLC Message Logging
1251 * Returns the VLC messaging verbosity level
1252 * \param p_instance libvlc instance
1253 * \param exception an initialized exception pointer
1255 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
1256 libvlc_exception_t *p_e );
1259 * Set the VLC messaging verbosity level
1260 * \param p_log libvlc log instance
1261 * \param exception an initialized exception pointer
1263 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
1264 libvlc_exception_t *p_e );
1267 * Open an instance to VLC message log
1268 * \param p_instance libvlc instance
1269 * \param exception an initialized exception pointer
1271 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( libvlc_instance_t *, libvlc_exception_t *);
1274 * Close an instance of VLC message log
1275 * \param p_log libvlc log instance
1276 * \param exception an initialized exception pointer
1278 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
1281 * Returns the number of messages in log
1282 * \param p_log libvlc log instance
1283 * \param exception an initialized exception pointer
1285 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
1288 * Clear all messages in log
1289 * the log should be cleared on a regular basis to avoid clogging
1290 * \param p_log libvlc log instance
1291 * \param exception an initialized exception pointer
1293 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
1296 * Allocate and returns a new iterator to messages in log
1297 * \param p_log libvlc log instance
1298 * \param exception an initialized exception pointer
1300 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
1303 * Releases a previoulsy allocated iterator
1304 * \param p_log libvlc log iterator
1305 * \param exception an initialized exception pointer
1307 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1310 * Returns whether log iterator has more messages
1311 * \param p_log libvlc log iterator
1312 * \param exception an initialized exception pointer
1314 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1317 * Returns next log message
1318 * the content of message must not be freed
1319 * \param p_log libvlc log iterator
1320 * \param exception an initialized exception pointer
1322 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
1323 struct libvlc_log_message_t *buffer,
1324 libvlc_exception_t *p_e );
1328 /*****************************************************************************
1330 *****************************************************************************/
1332 /** defgroup libvlc_callbacks Callbacks
1339 * Register for an event notification
1340 * \param p_event_manager the event manager to which you want to attach to
1341 * Generally it is obtained by vlc_my_object_event_manager() where my_object
1342 * Is the object you want to listen to.
1343 * \param i_event_type the desired event to which we want to listen
1344 * \param f_callback the function to call when i_event_type occurs
1345 * \param user_data user provided data to carry with the event
1346 * \param p_e an initialized exception pointer
1348 VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
1349 libvlc_event_type_t i_event_type,
1350 libvlc_callback_t f_callback,
1352 libvlc_exception_t *p_e );
1355 * Unregister an event notification
1356 * \param p_event_manager the event manager
1357 * \param i_event_type the desired event to which we want to unregister
1358 * \param f_callback the function to call when i_event_type occurs
1359 * \param p_e an initialized exception pointer
1361 VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
1362 libvlc_event_type_t i_event_type,
1363 libvlc_callback_t f_callback,
1365 libvlc_exception_t *p_e );
1368 * Get an event type name
1369 * \param i_event_type the desired event
1371 VLC_PUBLIC_API const char * libvlc_event_type_name( libvlc_event_type_t event_type );
1380 #endif /* <vlc/libvlc.h> */