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 );
155 VLC_PUBLIC_API void libvlc_media_descriptor_retain(
156 libvlc_media_descriptor_t *p_meta_desc );
158 VLC_PUBLIC_API void libvlc_media_descriptor_release(
159 libvlc_media_descriptor_t *p_meta_desc );
161 VLC_PUBLIC_API char * libvlc_media_descriptor_get_mrl( libvlc_media_descriptor_t * p_md,
162 libvlc_exception_t * p_e );
165 * Read the meta of the media descriptor.
166 * \param p_meta_desc the media descriptor to read
167 * \param p_meta_desc the meta to read
169 VLC_PUBLIC_API char * libvlc_media_descriptor_get_meta(
170 libvlc_media_descriptor_t *p_meta_desc,
171 libvlc_meta_t e_meta,
172 libvlc_exception_t *p_e );
175 VLC_PUBLIC_API void libvlc_media_descriptor_add_tag( libvlc_media_descriptor_t *p_md,
177 const libvlc_tag_t tag,
178 libvlc_exception_t *p_e );
180 VLC_PUBLIC_API void libvlc_media_descriptor_remove_tag( libvlc_media_descriptor_t *p_md,
182 const libvlc_tag_t tag,
183 libvlc_exception_t *p_e );
186 libvlc_media_descriptor_tags_count_for_key( libvlc_media_descriptor_t *p_md,
188 libvlc_exception_t *p_e );
190 VLC_PUBLIC_API libvlc_tag_t
191 libvlc_media_descriptor_tag_at_index_for_key( libvlc_media_descriptor_t *p_md,
194 libvlc_exception_t *p_e );
196 VLC_PUBLIC_API libvlc_media_list_t *
197 libvlc_media_descriptor_subitems( libvlc_media_descriptor_t *p_md,
198 libvlc_exception_t *p_e );
200 VLC_PUBLIC_API libvlc_event_manager_t *
201 libvlc_media_descriptor_event_manager( libvlc_media_descriptor_t * p_md,
202 libvlc_exception_t * p_e );
204 VLC_PUBLIC_API vlc_int64_t
205 libvlc_media_descriptor_get_duration( libvlc_media_descriptor_t * p_md,
206 libvlc_exception_t * p_e );
208 VLC_PUBLIC_API vlc_bool_t
209 libvlc_media_descriptor_is_preparsed( libvlc_media_descriptor_t * p_md,
210 libvlc_exception_t * p_e );
213 libvlc_media_descriptor_set_user_data( libvlc_media_descriptor_t * p_md,
214 void * p_new_user_data,
215 libvlc_exception_t * p_e);
216 VLC_PUBLIC_API void *
217 libvlc_media_descriptor_get_user_data( libvlc_media_descriptor_t * p_md,
218 libvlc_exception_t * p_e);
222 /*****************************************************************************
224 *****************************************************************************/
225 /** defgroup libvlc_playlist Playlist
227 * LibVLC Playlist handling
234 VLC_PUBLIC_API void libvlc_playlist_loop( libvlc_instance_t* , vlc_bool_t,
235 libvlc_exception_t * );
238 * Start playing. You can give some additionnal playlist item options
239 * that will be added to the item before playing it.
240 * \param p_instance the instance
241 * \param i_id the item to play. If this is a negative number, the next
242 * item will be selected. Else, the item with the given ID will be played
243 * \param i_options the number of options to add to the item
244 * \param ppsz_options the options to add to the item
245 * \param p_exception an initialized exception
247 VLC_PUBLIC_API void libvlc_playlist_play( libvlc_instance_t*, int, int, char **,
248 libvlc_exception_t * );
251 * Pause a running playlist, resume if it was stopped
252 * \param p_instance the instance to pause
253 * \param p_exception an initialized exception
255 VLC_PUBLIC_API void libvlc_playlist_pause( libvlc_instance_t *, libvlc_exception_t * );
258 * Checks if the playlist is running
259 * \param p_instance the instance
260 * \param p_exception an initialized exception
261 * \return 0 if the playlist is stopped or paused, 1 if it is running
263 VLC_PUBLIC_API int libvlc_playlist_isplaying( libvlc_instance_t *, libvlc_exception_t * );
266 * Get the number of items in the playlist
267 * \param p_instance the instance
268 * \param p_exception an initialized exception
269 * \return the number of items
271 VLC_PUBLIC_API int libvlc_playlist_items_count( libvlc_instance_t *, libvlc_exception_t * );
274 * Lock the playlist instance
275 * \param p_instance the instance
277 VLC_PUBLIC_API void libvlc_playlist_lock( libvlc_instance_t * );
280 * Unlock the playlist instance
281 * \param p_instance the instance
283 VLC_PUBLIC_API void libvlc_playlist_unlock( libvlc_instance_t * );
287 * \param p_instance the instance to stop
288 * \param p_exception an initialized exception
290 VLC_PUBLIC_API void libvlc_playlist_stop( libvlc_instance_t *, libvlc_exception_t * );
293 * Go to next playlist item (starts playback if it was stopped)
294 * \param p_instance the instance to use
295 * \param p_exception an initialized exception
297 VLC_PUBLIC_API void libvlc_playlist_next( libvlc_instance_t *, libvlc_exception_t * );
300 * Go to previous playlist item (starts playback if it was stopped)
301 * \param p_instance the instance to use
302 * \param p_exception an initialized exception
304 VLC_PUBLIC_API void libvlc_playlist_prev( libvlc_instance_t *, libvlc_exception_t * );
307 * Remove all playlist items
308 * \param p_instance the instance
309 * \param p_exception an initialized exception
311 VLC_PUBLIC_API void libvlc_playlist_clear( libvlc_instance_t *, libvlc_exception_t * );
314 * Add an item at the end of the playlist
315 * If you need more advanced options, \see libvlc_playlist_add_extended
316 * \param p_instance the instance
317 * \param psz_uri the URI to open, using VLC format
318 * \param psz_name a name that you might want to give or NULL
319 * \return the identifier of the new item
321 VLC_PUBLIC_API int libvlc_playlist_add( libvlc_instance_t *, const char *, const char *,
322 libvlc_exception_t * );
325 * Add an item at the end of the playlist, with additional input options
326 * \param p_instance the instance
327 * \param psz_uri the URI to open, using VLC format
328 * \param psz_name a name that you might want to give or NULL
329 * \param i_options the number of options to add
330 * \param ppsz_options strings representing the options to add
331 * \param p_exception an initialized exception
332 * \return the identifier of the new item
334 VLC_PUBLIC_API int libvlc_playlist_add_extended( libvlc_instance_t *, const char *,
335 const char *, int, const char **,
336 libvlc_exception_t * );
339 * Delete the playlist item with the given ID.
340 * \param p_instance the instance
341 * \param i_id the id to remove
342 * \param p_exception an initialized exception
345 VLC_PUBLIC_API int libvlc_playlist_delete_item( libvlc_instance_t *, int,
346 libvlc_exception_t * );
348 /** Get the input that is currently being played by the playlist
349 * \param p_instance the instance to use
350 * \param p_exception an initialized excecption
351 * \return an input object
353 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_playlist_get_media_instance(
354 libvlc_instance_t *, libvlc_exception_t * );
358 /*****************************************************************************
360 *****************************************************************************/
361 /** defgroup libvlc_media_instance Media Instance
363 * LibVLC Media Instance
367 /** Create an empty Media Instance object
368 * \param p_libvlc_instance the libvlc instance in which the Media Instance
369 * should be (not used for now).
371 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new( libvlc_instance_t *, libvlc_exception_t * );
373 /** Create a Media Instance object from a Media Descriptor
374 * \param p_md the media descriptor. Afterwards the p_md can safely be
377 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new_from_media_descriptor( libvlc_media_descriptor_t *, libvlc_exception_t * );
379 /** Release a media_instance after use
380 * \param p_mi the Media Instance to free
382 VLC_PUBLIC_API void libvlc_media_instance_release( libvlc_media_instance_t * );
383 VLC_PUBLIC_API void libvlc_media_instance_retain( libvlc_media_instance_t * );
385 /** Set the media descriptor that will be used by the media_instance. If any,
386 * previous md will be released.
387 * \param p_mi the Media Instance
388 * \param p_md the Media Descriptor. Afterwards the p_md can safely be
391 VLC_PUBLIC_API void libvlc_media_instance_set_media_descriptor( libvlc_media_instance_t *, libvlc_media_descriptor_t *, libvlc_exception_t * );
393 /** Get the media descriptor used by the media_instance (if any). A copy of
394 * the md is returned. NULL is returned if no media instance is associated.
395 * \param p_mi the Media Instance
397 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_instance_get_media_descriptor( libvlc_media_instance_t *, libvlc_exception_t * );
399 /** Get the Event Manager from which the media instance send event.
400 * \param p_mi the Media Instance
402 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_instance_event_manager ( libvlc_media_instance_t *, libvlc_exception_t * );
404 VLC_PUBLIC_API void libvlc_media_instance_play ( libvlc_media_instance_t *, libvlc_exception_t * );
405 VLC_PUBLIC_API void libvlc_media_instance_pause ( libvlc_media_instance_t *, libvlc_exception_t * );
406 VLC_PUBLIC_API void libvlc_media_instance_stop ( libvlc_media_instance_t *, libvlc_exception_t * );
408 VLC_PUBLIC_API void libvlc_media_instance_set_drawable ( libvlc_media_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
410 /** \bug This might go away ... to be replaced by a broader system */
411 VLC_PUBLIC_API vlc_int64_t libvlc_media_instance_get_length ( libvlc_media_instance_t *, libvlc_exception_t *);
412 VLC_PUBLIC_API vlc_int64_t libvlc_media_instance_get_time ( libvlc_media_instance_t *, libvlc_exception_t *);
413 VLC_PUBLIC_API void libvlc_media_instance_set_time ( libvlc_media_instance_t *, vlc_int64_t, libvlc_exception_t *);
414 VLC_PUBLIC_API float libvlc_media_instance_get_position ( libvlc_media_instance_t *, libvlc_exception_t *);
415 VLC_PUBLIC_API void libvlc_media_instance_set_position ( libvlc_media_instance_t *, float, libvlc_exception_t *);
416 VLC_PUBLIC_API void libvlc_media_instance_set_chapter ( libvlc_media_instance_t *, int, libvlc_exception_t *);
417 VLC_PUBLIC_API int libvlc_media_instance_get_chapter (libvlc_media_instance_t *, libvlc_exception_t *);
418 VLC_PUBLIC_API int libvlc_media_instance_get_chapter_count( libvlc_media_instance_t *, libvlc_exception_t *);
419 VLC_PUBLIC_API vlc_bool_t libvlc_media_instance_will_play ( libvlc_media_instance_t *, libvlc_exception_t *);
420 VLC_PUBLIC_API float libvlc_media_instance_get_rate ( libvlc_media_instance_t *, libvlc_exception_t *);
421 VLC_PUBLIC_API void libvlc_media_instance_set_rate ( libvlc_media_instance_t *, float, libvlc_exception_t *);
422 VLC_PUBLIC_API libvlc_state_t libvlc_media_instance_get_state ( libvlc_media_instance_t *, libvlc_exception_t *);
425 * Does this input have a video output ?
426 * \param p_input the input
427 * \param p_exception an initialized exception
429 VLC_PUBLIC_API vlc_bool_t libvlc_media_instance_has_vout( libvlc_media_instance_t *, libvlc_exception_t *);
430 VLC_PUBLIC_API float libvlc_media_instance_get_fps( libvlc_media_instance_t *, libvlc_exception_t *);
435 /*****************************************************************************
437 *****************************************************************************/
438 /** defgroup libvlc_tag_query Tag Query
443 VLC_PUBLIC_API libvlc_tag_query_t *
444 libvlc_tag_query_new( libvlc_instance_t *, libvlc_exception_t * );
447 libvlc_tag_query_release( libvlc_tag_query_t * );
450 libvlc_tag_query_retain( libvlc_tag_query_t * );
453 libvlc_tag_query_set_match_tag_and_key( libvlc_tag_query_t * p_q,
456 libvlc_exception_t * );
458 VLC_PUBLIC_API vlc_bool_t
459 libvlc_tag_query_match( libvlc_tag_query_t *, libvlc_media_descriptor_t *,
460 libvlc_exception_t * );
464 /*****************************************************************************
466 *****************************************************************************/
467 /** defgroup libvlc_media_list MediaList
472 VLC_PUBLIC_API libvlc_media_list_t *
473 libvlc_media_list_new( libvlc_instance_t *, libvlc_exception_t * );
476 libvlc_media_list_release( libvlc_media_list_t * );
479 libvlc_media_list_retain( libvlc_media_list_t * );
482 libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist,
483 const char * psz_uri,
484 libvlc_exception_t * p_e );
487 libvlc_media_list_set_media_descriptor( libvlc_media_list_t *,
488 libvlc_media_descriptor_t *,
489 libvlc_exception_t *);
491 VLC_PUBLIC_API libvlc_media_descriptor_t *
492 libvlc_media_list_media_descriptor( libvlc_media_list_t *,
493 libvlc_exception_t *);
496 libvlc_media_list_add_media_descriptor( libvlc_media_list_t *,
497 libvlc_media_descriptor_t *,
498 libvlc_exception_t * );
500 libvlc_media_list_insert_media_descriptor( libvlc_media_list_t *,
501 libvlc_media_descriptor_t *,
503 libvlc_exception_t * );
505 libvlc_media_list_remove_index( libvlc_media_list_t *, int,
506 libvlc_exception_t * );
509 libvlc_media_list_count( libvlc_media_list_t * p_mlist,
510 libvlc_exception_t * p_e );
512 VLC_PUBLIC_API libvlc_media_descriptor_t *
513 libvlc_media_list_item_at_index( libvlc_media_list_t *, int,
514 libvlc_exception_t * );
516 libvlc_media_list_index_of_item( libvlc_media_list_t *,
517 libvlc_media_descriptor_t *,
518 libvlc_exception_t * );
521 libvlc_media_list_lock( libvlc_media_list_t * );
523 libvlc_media_list_unlock( libvlc_media_list_t * );
525 VLC_PUBLIC_API libvlc_media_list_view_t *
526 libvlc_media_list_flat_view( libvlc_media_list_t *,
527 libvlc_exception_t * );
529 VLC_PUBLIC_API libvlc_media_list_view_t *
530 libvlc_media_list_hierarchical_view( libvlc_media_list_t *,
531 libvlc_exception_t * );
533 VLC_PUBLIC_API libvlc_event_manager_t *
534 libvlc_media_list_event_manager( libvlc_media_list_t *,
535 libvlc_exception_t * );
539 /*****************************************************************************
541 *****************************************************************************/
542 /** defgroup libvlc_media_list_view MediaListView
544 * LibVLC Media List View
548 libvlc_media_list_view_retain( libvlc_media_list_view_t * p_mlv );
551 libvlc_media_list_view_release( libvlc_media_list_view_t * p_mlv );
553 VLC_PUBLIC_API libvlc_event_manager_t *
554 libvlc_media_list_view_event_manager( libvlc_media_list_view_t * p_mlv );
557 libvlc_media_list_view_count( libvlc_media_list_view_t * p_mlv,
558 libvlc_exception_t * p_e );
560 VLC_PUBLIC_API libvlc_media_descriptor_t *
561 libvlc_media_list_view_item_at_index( libvlc_media_list_view_t * p_mlv,
563 libvlc_exception_t * p_e );
565 VLC_PUBLIC_API libvlc_media_list_view_t *
566 libvlc_media_list_view_children_at_index( libvlc_media_list_view_t * p_mlv,
568 libvlc_exception_t * p_e );
572 libvlc_media_list_view_index_of_item( libvlc_media_list_view_t * p_mlv,
573 libvlc_media_descriptor_t * p_md,
574 libvlc_exception_t * p_e );
577 libvlc_media_list_view_insert_at_index( libvlc_media_list_view_t * p_mlv,
578 libvlc_media_descriptor_t * p_md,
580 libvlc_exception_t * p_e );
583 libvlc_media_list_view_remove_at_index( libvlc_media_list_view_t * p_mlv,
585 libvlc_exception_t * p_e );
588 libvlc_media_list_view_add_item( libvlc_media_list_view_t * p_mlv,
589 libvlc_media_descriptor_t * p_md,
590 libvlc_exception_t * p_e );
594 /*****************************************************************************
595 * Dynamic Media List (Deprecated)
596 *****************************************************************************/
597 /** defgroup libvlc_media_list MediaList
602 VLC_PUBLIC_API libvlc_dynamic_media_list_t *
603 libvlc_dynamic_media_list_new( libvlc_media_list_t * p_mlist,
604 libvlc_tag_query_t * p_query,
606 libvlc_exception_t * p_e );
608 libvlc_dynamic_media_list_release( libvlc_dynamic_media_list_t * p_dmlist );
611 libvlc_dynamic_media_list_retain( libvlc_dynamic_media_list_t * p_dmlist );
613 libvlc_media_list_t *
614 libvlc_dynamic_media_list_media_list( libvlc_dynamic_media_list_t * p_dmlist,
615 libvlc_exception_t * p_e );
619 /*****************************************************************************
621 *****************************************************************************/
622 /** defgroup libvlc_media_library Media Library
624 * LibVLC Media Library
627 VLC_PUBLIC_API libvlc_media_library_t *
628 libvlc_media_library_new( libvlc_instance_t * p_inst,
629 libvlc_exception_t * p_e );
631 libvlc_media_library_release( libvlc_media_library_t * p_mlib );
633 libvlc_media_library_retain( libvlc_media_library_t * p_mlib );
637 libvlc_media_library_load( libvlc_media_library_t * p_mlib,
638 libvlc_exception_t * p_e );
641 libvlc_media_library_save( libvlc_media_library_t * p_mlib,
642 libvlc_exception_t * p_e );
644 VLC_PUBLIC_API libvlc_media_list_t *
645 libvlc_media_library_media_list( libvlc_media_library_t * p_mlib,
646 libvlc_exception_t * p_e );
651 /*****************************************************************************
653 *****************************************************************************/
654 /** defgroup libvlc_media_list_player MediaListPlayer
656 * LibVLC Media List Player
659 VLC_PUBLIC_API libvlc_media_list_player_t *
660 libvlc_media_list_player_new( libvlc_instance_t * p_instance,
661 libvlc_exception_t * p_e );
663 libvlc_media_list_player_release( libvlc_media_list_player_t * p_mlp );
666 libvlc_media_list_player_set_media_instance(
667 libvlc_media_list_player_t * p_mlp,
668 libvlc_media_instance_t * p_mi,
669 libvlc_exception_t * p_e );
672 libvlc_media_list_player_set_media_list(
673 libvlc_media_list_player_t * p_mlp,
674 libvlc_media_list_t * p_mlist,
675 libvlc_exception_t * p_e );
678 libvlc_media_list_player_play( libvlc_media_list_player_t * p_mlp,
679 libvlc_exception_t * p_e );
682 libvlc_media_list_player_pause( libvlc_media_list_player_t * p_mlp,
683 libvlc_exception_t * p_e );
686 libvlc_media_list_player_is_playing( libvlc_media_list_player_t * p_mlp,
687 libvlc_exception_t * p_e );
689 VLC_PUBLIC_API libvlc_state_t
690 libvlc_media_list_player_get_state( libvlc_media_list_player_t * p_mlp,
691 libvlc_exception_t * p_e );
694 libvlc_media_list_player_play_item_at_index(
695 libvlc_media_list_player_t * p_mlp,
697 libvlc_exception_t * p_e );
700 libvlc_media_list_player_play_item(
701 libvlc_media_list_player_t * p_mlp,
702 libvlc_media_descriptor_t * p_md,
703 libvlc_exception_t * p_e );
706 libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp,
707 libvlc_exception_t * p_e );
709 libvlc_media_list_player_next( libvlc_media_list_player_t * p_mlp,
710 libvlc_exception_t * p_e );
714 /** defgroup libvlc_video Video
716 * LibVLC Video handling
721 * Toggle fullscreen status on video output
722 * \param p_input the input
723 * \param p_exception an initialized exception
725 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_instance_t *, libvlc_exception_t * );
728 * Enable or disable fullscreen on a video output
729 * \param p_input the input
730 * \param b_fullscreen boolean for fullscreen status
731 * \param p_exception an initialized exception
733 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_instance_t *, int, libvlc_exception_t * );
736 * Get current fullscreen status
737 * \param p_input the input
738 * \param p_exception an initialized exception
739 * \return the fullscreen status (boolean)
741 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_instance_t *, libvlc_exception_t * );
744 * Get current video height
745 * \param p_input the input
746 * \param p_exception an initialized exception
747 * \return the video height
749 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_instance_t *, libvlc_exception_t * );
752 * Get current video width
753 * \param p_input the input
754 * \param p_exception an initialized exception
755 * \return the video width
757 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_instance_t *, libvlc_exception_t * );
760 * Get current video aspect ratio
761 * \param p_input the input
762 * \param p_exception an initialized exception
763 * \return the video aspect ratio
765 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_instance_t *, libvlc_exception_t * );
768 * Set new video aspect ratio
769 * \param p_input the input
770 * \param psz_aspect new video aspect-ratio
771 * \param p_exception an initialized exception
773 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_instance_t *, char *, libvlc_exception_t * );
776 * Get current video subtitle
777 * \param p_input the input
778 * \param p_exception an initialized exception
779 * \return the video subtitle selected
781 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_instance_t *, libvlc_exception_t * );
784 * Set new video subtitle
785 * \param p_input the input
786 * \param i_spu new video subtitle to select
787 * \param p_exception an initialized exception
789 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_instance_t *, int , libvlc_exception_t * );
792 * Get current crop filter geometry
793 * \param p_input the input
794 * \param p_exception an initialized exception
795 * \return the crop filter geometry
797 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_instance_t *, libvlc_exception_t * );
800 * Set new crop filter geometry
801 * \param p_input the input
802 * \param psz_geometry new crop filter geometry
803 * \param p_exception an initialized exception
805 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_instance_t *, char *, libvlc_exception_t * );
808 * Get current teletext page requested.
809 * \param p_input the input
810 * \param p_exception an initialized exception
811 * \return the current teletext page requested.
813 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_instance_t *, libvlc_exception_t * );
816 * Set new teletext page to retrieve
817 * \param p_input the input
818 * \param i_page teletex page number requested
819 * \param p_exception an initialized exception
821 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_instance_t *, int, libvlc_exception_t * );
824 * Take a snapshot of the current video window
825 * If i_width AND i_height is 0, original size is used
826 * if i_width XOR i_height is 0, original aspect-ratio is preserved
827 * \param p_input the input
828 * \param psz_filepath the path where to save the screenshot to
829 * \param i_width the snapshot's width
830 * \param i_height the snapshot's height
831 * \param p_exception an initialized exception
833 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_instance_t *, char *,unsigned int, unsigned int, libvlc_exception_t * );
835 VLC_PUBLIC_API int libvlc_video_destroy( libvlc_media_instance_t *, libvlc_exception_t *);
838 * Resize the current video output window
839 * \param p_instance libvlc instance
840 * \param width new width for video output window
841 * \param height new height for video output window
842 * \param p_exception an initialized exception
843 * \return the success status (boolean)
845 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_instance_t *, int, int, libvlc_exception_t *);
848 * change the parent for the current the video output
849 * \param p_instance libvlc instance
850 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
851 * \param p_exception an initialized exception
852 * \return the success status (boolean)
854 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
857 * Tell windowless video output to redraw rectangular area (MacOS X only)
858 * \param p_instance libvlc instance
859 * \param area coordinates within video drawable
860 * \param p_exception an initialized exception
862 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_instance_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
865 * Set the default video output parent
866 * this settings will be used as default for all video outputs
867 * \param p_instance libvlc instance
868 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
869 * \param p_exception an initialized exception
871 VLC_PUBLIC_API void libvlc_video_set_parent( libvlc_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
874 * Set the default video output parent
875 * this settings will be used as default for all video outputs
876 * \param p_instance libvlc instance
877 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
878 * \param p_exception an initialized exception
880 VLC_PUBLIC_API libvlc_drawable_t libvlc_video_get_parent( libvlc_instance_t *, libvlc_exception_t * );
883 * Set the default video output size
884 * this settings will be used as default for all video outputs
885 * \param p_instance libvlc instance
886 * \param width new width for video drawable
887 * \param height new height for video drawable
888 * \param p_exception an initialized exception
890 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
893 * Set the default video output viewport for a windowless video output (MacOS X only)
894 * this settings will be used as default for all video outputs
895 * \param p_instance libvlc instance
896 * \param view coordinates within video drawable
897 * \param clip coordinates within video drawable
898 * \param p_exception an initialized exception
900 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
904 /** defgroup libvlc_audio Audio
906 * LibVLC Audio handling
912 * \param p_instance libvlc instance
913 * \param p_exception an initialized exception
916 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
919 * Get current mute status
920 * \param p_instance libvlc instance
921 * \param p_exception an initialized exception
922 * \return the mute status (boolean)
924 VLC_PUBLIC_API vlc_bool_t libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
928 * \param p_instance libvlc instance
929 * \param status If status is VLC_TRUE then mute, otherwise unmute
930 * \param p_exception an initialized exception
933 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, vlc_bool_t , libvlc_exception_t * );
936 * Get current audio level
937 * \param p_instance libvlc instance
938 * \param p_exception an initialized exception
939 * \return the audio level (int)
941 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
944 * Set current audio level
945 * \param p_instance libvlc instance
946 * \param i_volume the volume (int)
947 * \param p_exception an initialized exception
949 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
952 * Get number of available audio tracks
953 * \param p_mi media instance
954 * \param p_e an initialized exception
955 * \return the number of available audio tracks (int)
957 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_instance_t *, libvlc_exception_t * );
960 + * Get current audio track
961 + * \param p_input input instance
962 + * \param p_exception an initialized exception
963 + * \return the audio track (int)
965 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_instance_t *, libvlc_exception_t * );
968 * Set current audio track
969 * \param p_input input instance
970 * \param i_track the track (int)
971 * \param p_exception an initialized exception
973 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_instance_t *, int, libvlc_exception_t * );
976 * Get current audio channel
977 * \param p_instance input instance
978 * \param p_exception an initialized exception
979 * \return the audio channel (int)
981 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
984 * Set current audio channel
985 * \param p_instance input instance
986 * \param i_channel the audio channel (int)
987 * \param p_exception an initialized exception
989 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
993 /*****************************************************************************
994 * Services/Media Discovery
995 *****************************************************************************/
996 /** defgroup libvlc_media_discoverer Media Discoverer
998 * LibVLC Media Discoverer
1002 VLC_PUBLIC_API libvlc_media_discoverer_t *
1003 libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
1004 const char * psz_name,
1005 libvlc_exception_t * p_e );
1006 VLC_PUBLIC_API void libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
1007 VLC_PUBLIC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
1009 VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis );
1013 /*****************************************************************************
1015 *****************************************************************************/
1016 /** defgroup libvlc_vlm VLM
1023 * Add a broadcast, with one input
1024 * \param p_instance the instance
1025 * \param psz_name the name of the new broadcast
1026 * \param psz_input the input MRL
1027 * \param psz_output the output MRL (the parameter to the "sout" variable)
1028 * \param i_options number of additional options
1029 * \param ppsz_options additional options
1030 * \param b_enabled boolean for enabling the new broadcast
1031 * \param b_loop Should this broadcast be played in loop ?
1032 * \param p_exception an initialized exception
1034 VLC_PUBLIC_API void libvlc_vlm_add_broadcast( libvlc_instance_t *, char *, char *, char* ,
1035 int, char **, int, int, libvlc_exception_t * );
1038 * Delete a media (vod or broadcast)
1039 * \param p_instance the instance
1040 * \param psz_name the media to delete
1041 * \param p_exception an initialized exception
1043 VLC_PUBLIC_API void libvlc_vlm_del_media( libvlc_instance_t *, char *, libvlc_exception_t * );
1046 * Enable or disable a media (vod or broadcast)
1047 * \param p_instance the instance
1048 * \param psz_name the media to work on
1049 * \param b_enabled the new status
1050 * \param p_exception an initialized exception
1052 VLC_PUBLIC_API void libvlc_vlm_set_enabled( libvlc_instance_t *, char *, int,
1053 libvlc_exception_t *);
1056 * Set the output for a media
1057 * \param p_instance the instance
1058 * \param psz_name the media to work on
1059 * \param psz_output the output MRL (the parameter to the "sout" variable)
1060 * \param p_exception an initialized exception
1062 VLC_PUBLIC_API void libvlc_vlm_set_output( libvlc_instance_t *, char *, char*,
1063 libvlc_exception_t *);
1066 * Set a media's input MRL. This will delete all existing inputs and
1067 * add the specified one.
1068 * \param p_instance the instance
1069 * \param psz_name the media to work on
1070 * \param psz_input the input MRL
1071 * \param p_exception an initialized exception
1073 VLC_PUBLIC_API void libvlc_vlm_set_input( libvlc_instance_t *, char *, char*,
1074 libvlc_exception_t *);
1077 * Add a media's input MRL. This will add the specified one.
1078 * \param p_instance the instance
1079 * \param psz_name the media to work on
1080 * \param psz_input the input MRL
1081 * \param p_exception an initialized exception
1083 VLC_PUBLIC_API void libvlc_vlm_add_input( libvlc_instance_t *, char *, char *,
1084 libvlc_exception_t *p_exception );
1086 * Set output for a media
1087 * \param p_instance the instance
1088 * \param psz_name the media to work on
1089 * \param b_loop the new status
1090 * \param p_exception an initialized exception
1092 VLC_PUBLIC_API void libvlc_vlm_set_loop( libvlc_instance_t *, char *, int,
1093 libvlc_exception_t *);
1096 * Edit the parameters of a media. This will delete all existing inputs and
1097 * add the specified one.
1098 * \param p_instance the instance
1099 * \param psz_name the name of the new broadcast
1100 * \param psz_input the input MRL
1101 * \param psz_output the output MRL (the parameter to the "sout" variable)
1102 * \param i_options number of additional options
1103 * \param ppsz_options additional options
1104 * \param b_enabled boolean for enabling the new broadcast
1105 * \param b_loop Should this broadcast be played in loop ?
1106 * \param p_exception an initialized exception
1108 VLC_PUBLIC_API void libvlc_vlm_change_media( libvlc_instance_t *, char *, char *, char* ,
1109 int, char **, int, int, libvlc_exception_t * );
1112 * Plays the named broadcast.
1113 * \param p_instance the instance
1114 * \param psz_name the name of the broadcast
1115 * \param p_exception an initialized exception
1117 VLC_PUBLIC_API void libvlc_vlm_play_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
1120 * Stops the named broadcast.
1121 * \param p_instance the instance
1122 * \param psz_name the name of the broadcast
1123 * \param p_exception an initialized exception
1125 VLC_PUBLIC_API void libvlc_vlm_stop_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
1128 * Pauses the named broadcast.
1129 * \param p_instance the instance
1130 * \param psz_name the name of the broadcast
1131 * \param p_exception an initialized exception
1133 VLC_PUBLIC_API void libvlc_vlm_pause_media( libvlc_instance_t *, char *, libvlc_exception_t * );
1136 * Seeks in the named broadcast.
1137 * \param p_instance the instance
1138 * \param psz_name the name of the broadcast
1139 * \param f_percentage the percentage to seek to
1140 * \param p_exception an initialized exception
1142 VLC_PUBLIC_API void libvlc_vlm_seek_media( libvlc_instance_t *, char *,
1143 float, libvlc_exception_t * );
1146 * Return information of the named broadcast.
1147 * \param p_instance the instance
1148 * \param psz_name the name of the broadcast
1149 * \param p_exception an initialized exception
1151 VLC_PUBLIC_API char* libvlc_vlm_show_media( libvlc_instance_t *, char *, libvlc_exception_t * );
1153 #define LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( attr, returnType, getType, default)\
1154 returnType libvlc_vlm_get_media_## attr( libvlc_instance_t *, \
1155 char *, int , libvlc_exception_t * );
1157 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( position, float, Float, -1);
1158 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( time, int, Integer, -1);
1159 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( length, int, Integer, -1);
1160 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( rate, int, Integer, -1);
1161 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( title, int, Integer, 0);
1162 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( chapter, int, Integer, 0);
1163 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( seekable, int, Bool, 0);
1165 #undef LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
1169 /*****************************************************************************
1170 * Message log handling
1171 *****************************************************************************/
1173 /** defgroup libvlc_log Log
1175 * LibVLC Message Logging
1180 * Returns the VLC messaging verbosity level
1181 * \param p_instance libvlc instance
1182 * \param exception an initialized exception pointer
1184 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
1185 libvlc_exception_t *p_e );
1188 * Set the VLC messaging verbosity level
1189 * \param p_log libvlc log instance
1190 * \param exception an initialized exception pointer
1192 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
1193 libvlc_exception_t *p_e );
1196 * Open an instance to VLC message log
1197 * \param p_instance libvlc instance
1198 * \param exception an initialized exception pointer
1200 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( libvlc_instance_t *, libvlc_exception_t *);
1203 * Close an instance of VLC message log
1204 * \param p_log libvlc log instance
1205 * \param exception an initialized exception pointer
1207 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
1210 * Returns the number of messages in log
1211 * \param p_log libvlc log instance
1212 * \param exception an initialized exception pointer
1214 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
1217 * Clear all messages in log
1218 * the log should be cleared on a regular basis to avoid clogging
1219 * \param p_log libvlc log instance
1220 * \param exception an initialized exception pointer
1222 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
1225 * Allocate and returns a new iterator to messages in log
1226 * \param p_log libvlc log instance
1227 * \param exception an initialized exception pointer
1229 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
1232 * Releases a previoulsy allocated iterator
1233 * \param p_log libvlc log iterator
1234 * \param exception an initialized exception pointer
1236 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1239 * Returns whether log iterator has more messages
1240 * \param p_log libvlc log iterator
1241 * \param exception an initialized exception pointer
1243 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1246 * Returns next log message
1247 * the content of message must not be freed
1248 * \param p_log libvlc log iterator
1249 * \param exception an initialized exception pointer
1251 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
1252 struct libvlc_log_message_t *buffer,
1253 libvlc_exception_t *p_e );
1257 /*****************************************************************************
1259 *****************************************************************************/
1261 /** defgroup libvlc_callbacks Callbacks
1268 * Register for an event notification
1269 * \param p_event_manager the event manager to which you want to attach to
1270 * Generally it is obtained by vlc_my_object_event_manager() where my_object
1271 * Is the object you want to listen to.
1272 * \param i_event_type the desired event to which we want to listen
1273 * \param f_callback the function to call when i_event_type occurs
1274 * \param user_data user provided data to carry with the event
1275 * \param p_e an initialized exception pointer
1277 VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
1278 libvlc_event_type_t i_event_type,
1279 libvlc_callback_t f_callback,
1281 libvlc_exception_t *p_e );
1284 * Unregister an event notification
1285 * \param p_event_manager the event manager
1286 * \param i_event_type the desired event to which we want to unregister
1287 * \param f_callback the function to call when i_event_type occurs
1288 * \param p_e an initialized exception pointer
1290 VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
1291 libvlc_event_type_t i_event_type,
1292 libvlc_callback_t f_callback,
1294 libvlc_exception_t *p_e );
1297 * Get an event type name
1298 * \param i_event_type the desired event
1300 VLC_PUBLIC_API const char * libvlc_event_type_name( libvlc_event_type_t event_type );
1309 #endif /* <vlc/libvlc.h> */