1 /*****************************************************************************
2 * libvlc.h: libvlc_* new external API
3 *****************************************************************************
4 * Copyright (C) 1998-2005 the VideoLAN team
5 * $Id: vlc.h 13701 2005-12-12 17:58:56Z zorglub $
7 * Authors: Clément Stenac <zorglub@videolan.org>
8 * Jean-Paul Saman <jpsaman _at_ m2x _dot_ nl>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
26 * \defgroup libvlc Libvlc
27 * This is libvlc, the base library of the VLC program.
37 #include <vlc/libvlc_structures.h>
43 /*****************************************************************************
45 *****************************************************************************/
46 /** defgroup libvlc_exception Exceptions
48 * LibVLC Exceptions handling
53 * Initialize an exception structure. This can be called several times to reuse
54 * an exception structure.
55 * \param p_exception the exception to initialize
57 VLC_PUBLIC_API void libvlc_exception_init( libvlc_exception_t *p_exception );
60 * Has an exception been raised ?
61 * \param p_exception the exception to query
62 * \return 0 if no exception raised, 1 else
64 VLC_PUBLIC_API int libvlc_exception_raised( libvlc_exception_t *p_exception );
68 * \param p_exception the exception to raise
69 * \param psz_message the exception message
71 VLC_PUBLIC_API void libvlc_exception_raise( libvlc_exception_t *p_exception, const char *psz_format, ... );
74 * Clear an exception object so it can be reused.
75 * The exception object must be initialized
76 * \param p_exception the exception to clear
78 VLC_PUBLIC_API void libvlc_exception_clear( libvlc_exception_t * );
81 * Get exception message
82 * \param p_exception the exception to query
83 * \return the exception message or NULL if not applicable (exception not raised
86 VLC_PUBLIC_API char* libvlc_exception_get_message( libvlc_exception_t *p_exception );
90 /*****************************************************************************
92 *****************************************************************************/
94 /** defgroup libvlc_core Core
101 * Create an initialized libvlc instance
102 * \param argc the number of arguments
103 * \param argv command-line-type arguments
104 * \param exception an initialized exception pointer
106 VLC_PUBLIC_API libvlc_instance_t * libvlc_new( int , char **, libvlc_exception_t *);
109 * Returns a libvlc instance identifier for legacy APIs. Use of this
110 * function is discouraged, you should convert your program to use the
112 * \param p_instance the instance
114 VLC_PUBLIC_API int libvlc_get_vlc_id( libvlc_instance_t *p_instance );
117 * Destroy a libvlc instance.
118 * \param p_instance the instance to destroy
120 VLC_PUBLIC_API void libvlc_destroy( libvlc_instance_t *, libvlc_exception_t * );
124 /*****************************************************************************
126 *****************************************************************************/
127 /** defgroup libvlc_media_descriptor Media Descriptor
129 * LibVLC Media Descriptor
134 * Create a media descriptor with the given mrl.
135 * \param p_instance the instance
136 * \param psz_mrl the mrl to read
138 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_descriptor_new(
139 libvlc_instance_t *p_instance,
140 const char * psz_mrl,
141 libvlc_exception_t *p_e );
143 VLC_PUBLIC_API void libvlc_media_descriptor_retain(
144 libvlc_media_descriptor_t *p_meta_desc );
146 VLC_PUBLIC_API void libvlc_media_descriptor_release(
147 libvlc_media_descriptor_t *p_meta_desc );
149 VLC_PUBLIC_API char * libvlc_media_descriptor_get_mrl( libvlc_media_descriptor_t * p_md,
150 libvlc_exception_t * p_e );
153 * Read the meta of the media descriptor.
154 * \param p_meta_desc the media descriptor to read
155 * \param p_meta_desc the meta to read
157 VLC_PUBLIC_API char * libvlc_media_descriptor_get_meta(
158 libvlc_media_descriptor_t *p_meta_desc,
159 libvlc_meta_t e_meta,
160 libvlc_exception_t *p_e );
163 VLC_PUBLIC_API void libvlc_media_descriptor_add_tag( libvlc_media_descriptor_t *p_md,
165 const libvlc_tag_t tag,
166 libvlc_exception_t *p_e );
168 VLC_PUBLIC_API void libvlc_media_descriptor_remove_tag( libvlc_media_descriptor_t *p_md,
170 const libvlc_tag_t tag,
171 libvlc_exception_t *p_e );
174 libvlc_media_descriptor_tags_count_for_key( libvlc_media_descriptor_t *p_md,
176 libvlc_exception_t *p_e );
178 VLC_PUBLIC_API libvlc_tag_t
179 libvlc_media_descriptor_tag_at_index_for_key( libvlc_media_descriptor_t *p_md,
182 libvlc_exception_t *p_e );
184 VLC_PUBLIC_API libvlc_media_list_t *
185 libvlc_media_descriptor_subitems( libvlc_media_descriptor_t *p_md,
186 libvlc_exception_t *p_e );
188 VLC_PUBLIC_API libvlc_event_manager_t *
189 libvlc_media_descriptor_event_manager( libvlc_media_descriptor_t * p_md,
190 libvlc_exception_t * p_e );
194 /*****************************************************************************
196 *****************************************************************************/
197 /** defgroup libvlc_playlist Playlist
199 * LibVLC Playlist handling
206 VLC_PUBLIC_API void libvlc_playlist_loop( libvlc_instance_t* , vlc_bool_t,
207 libvlc_exception_t * );
210 * Start playing. You can give some additionnal playlist item options
211 * that will be added to the item before playing it.
212 * \param p_instance the instance
213 * \param i_id the item to play. If this is a negative number, the next
214 * item will be selected. Else, the item with the given ID will be played
215 * \param i_options the number of options to add to the item
216 * \param ppsz_options the options to add to the item
217 * \param p_exception an initialized exception
219 VLC_PUBLIC_API void libvlc_playlist_play( libvlc_instance_t*, int, int, char **,
220 libvlc_exception_t * );
223 * Pause a running playlist, resume if it was stopped
224 * \param p_instance the instance to pause
225 * \param p_exception an initialized exception
227 VLC_PUBLIC_API void libvlc_playlist_pause( libvlc_instance_t *, libvlc_exception_t * );
230 * Checks if the playlist is running
231 * \param p_instance the instance
232 * \param p_exception an initialized exception
233 * \return 0 if the playlist is stopped or paused, 1 if it is running
235 VLC_PUBLIC_API int libvlc_playlist_isplaying( libvlc_instance_t *, libvlc_exception_t * );
238 * Get the number of items in the playlist
239 * \param p_instance the instance
240 * \param p_exception an initialized exception
241 * \return the number of items
243 VLC_PUBLIC_API int libvlc_playlist_items_count( libvlc_instance_t *, libvlc_exception_t * );
246 * Lock the playlist instance
247 * \param p_instance the instance
249 VLC_PUBLIC_API void libvlc_playlist_lock( libvlc_instance_t * );
252 * Unlock the playlist instance
253 * \param p_instance the instance
255 VLC_PUBLIC_API void libvlc_playlist_unlock( libvlc_instance_t * );
259 * \param p_instance the instance to stop
260 * \param p_exception an initialized exception
262 VLC_PUBLIC_API void libvlc_playlist_stop( libvlc_instance_t *, libvlc_exception_t * );
265 * Go to next playlist item (starts playback if it was stopped)
266 * \param p_instance the instance to use
267 * \param p_exception an initialized exception
269 VLC_PUBLIC_API void libvlc_playlist_next( libvlc_instance_t *, libvlc_exception_t * );
272 * Go to previous playlist item (starts playback if it was stopped)
273 * \param p_instance the instance to use
274 * \param p_exception an initialized exception
276 VLC_PUBLIC_API void libvlc_playlist_prev( libvlc_instance_t *, libvlc_exception_t * );
279 * Remove all playlist items
280 * \param p_instance the instance
281 * \param p_exception an initialized exception
283 VLC_PUBLIC_API void libvlc_playlist_clear( libvlc_instance_t *, libvlc_exception_t * );
286 * Add an item at the end of the playlist
287 * If you need more advanced options, \see libvlc_playlist_add_extended
288 * \param p_instance the instance
289 * \param psz_uri the URI to open, using VLC format
290 * \param psz_name a name that you might want to give or NULL
291 * \return the identifier of the new item
293 VLC_PUBLIC_API int libvlc_playlist_add( libvlc_instance_t *, const char *, const char *,
294 libvlc_exception_t * );
297 * Add an item at the end of the playlist, with additional input options
298 * \param p_instance the instance
299 * \param psz_uri the URI to open, using VLC format
300 * \param psz_name a name that you might want to give or NULL
301 * \param i_options the number of options to add
302 * \param ppsz_options strings representing the options to add
303 * \param p_exception an initialized exception
304 * \return the identifier of the new item
306 VLC_PUBLIC_API int libvlc_playlist_add_extended( libvlc_instance_t *, const char *,
307 const char *, int, const char **,
308 libvlc_exception_t * );
311 * Delete the playlist item with the given ID.
312 * \param p_instance the instance
313 * \param i_id the id to remove
314 * \param p_exception an initialized exception
317 VLC_PUBLIC_API int libvlc_playlist_delete_item( libvlc_instance_t *, int,
318 libvlc_exception_t * );
320 /* Get the input that is currently being played by the playlist
321 * \param p_instance the instance to use
322 * \param p_exception an initialized excecption
323 * \return an input object
325 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_playlist_get_media_instance(
326 libvlc_instance_t *, libvlc_exception_t * );
330 /*****************************************************************************
332 *****************************************************************************/
333 /** defgroup libvlc_media_instance Media Instance
335 * LibVLC Media Instance
339 /** Create an empty Media Instance object
340 * \param p_libvlc_instance the libvlc instance in which the Media Instance
341 * should be (not used for now).
343 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new( libvlc_instance_t *, libvlc_exception_t * );
345 /** Create a Media Instance object from a Media Descriptor
346 * \param p_md the media descriptor. Afterwards the p_md can safely be
349 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new_from_media_descriptor( libvlc_media_descriptor_t *, libvlc_exception_t * );
351 /** Release a media_instance after use
352 * \param p_mi the Media Instance to free
354 VLC_PUBLIC_API void libvlc_media_instance_release( libvlc_media_instance_t * );
355 VLC_PUBLIC_API void libvlc_media_instance_retain( libvlc_media_instance_t * );
357 /** Set the media descriptor that will be used by the media_instance. If any,
358 * previous md will be released.
359 * \param p_mi the Media Instance
360 * \param p_md the Media Descriptor. Afterwards the p_md can safely be
363 VLC_PUBLIC_API void libvlc_media_instance_set_media_descriptor( libvlc_media_instance_t *, libvlc_media_descriptor_t *, libvlc_exception_t * );
365 /** Get the media descriptor used by the media_instance (if any). A copy of
366 * the md is returned. NULL is returned if no media instance is associated.
367 * \param p_mi the Media Instance
369 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_instance_get_media_descriptor( libvlc_media_instance_t *, libvlc_exception_t * );
371 /** Get the Event Manager from which the media instance send event.
372 * \param p_mi the Media Instance
374 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_instance_event_manager ( libvlc_media_instance_t *, libvlc_exception_t * );
376 VLC_PUBLIC_API void libvlc_media_instance_play ( libvlc_media_instance_t *, libvlc_exception_t * );
377 VLC_PUBLIC_API void libvlc_media_instance_pause ( libvlc_media_instance_t *, libvlc_exception_t * );
378 VLC_PUBLIC_API void libvlc_media_instance_stop ( libvlc_media_instance_t *, libvlc_exception_t * );
380 VLC_PUBLIC_API void libvlc_media_instance_set_drawable ( libvlc_media_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
382 /// \bug This might go away ... to be replaced by a broader system
383 VLC_PUBLIC_API vlc_int64_t libvlc_media_instance_get_length ( libvlc_media_instance_t *, libvlc_exception_t *);
384 VLC_PUBLIC_API vlc_int64_t libvlc_media_instance_get_time ( libvlc_media_instance_t *, libvlc_exception_t *);
385 VLC_PUBLIC_API void libvlc_media_instance_set_time ( libvlc_media_instance_t *, vlc_int64_t, libvlc_exception_t *);
386 VLC_PUBLIC_API float libvlc_media_instance_get_position ( libvlc_media_instance_t *, libvlc_exception_t *);
387 VLC_PUBLIC_API void libvlc_media_instance_set_position ( libvlc_media_instance_t *, float, libvlc_exception_t *);
388 VLC_PUBLIC_API vlc_bool_t libvlc_media_instance_will_play ( libvlc_media_instance_t *, libvlc_exception_t *);
389 VLC_PUBLIC_API float libvlc_media_instance_get_rate ( libvlc_media_instance_t *, libvlc_exception_t *);
390 VLC_PUBLIC_API void libvlc_media_instance_set_rate ( libvlc_media_instance_t *, float, libvlc_exception_t *);
391 VLC_PUBLIC_API libvlc_state_t libvlc_media_instance_get_state ( libvlc_media_instance_t *, libvlc_exception_t *);
394 * Does this input have a video output ?
395 * \param p_input the input
396 * \param p_exception an initialized exception
398 VLC_PUBLIC_API vlc_bool_t libvlc_media_instance_has_vout( libvlc_media_instance_t *, libvlc_exception_t *);
399 VLC_PUBLIC_API float libvlc_media_instance_get_fps( libvlc_media_instance_t *, libvlc_exception_t *);
404 /*****************************************************************************
406 *****************************************************************************/
407 /** defgroup libvlc_tag_query Tag Query
412 VLC_PUBLIC_API libvlc_tag_query_t *
413 libvlc_tag_query_new( libvlc_instance_t *, libvlc_exception_t * );
416 libvlc_tag_query_release( libvlc_tag_query_t * );
419 libvlc_tag_query_retain( libvlc_tag_query_t * );
422 libvlc_tag_query_set_match_tag_and_key( libvlc_tag_query_t * p_q,
425 libvlc_exception_t * );
427 VLC_PUBLIC_API vlc_bool_t
428 libvlc_tag_query_match( libvlc_tag_query_t *, libvlc_media_descriptor_t *,
429 libvlc_exception_t * );
433 /*****************************************************************************
435 *****************************************************************************/
436 /** defgroup libvlc_media_list MediaList
441 VLC_PUBLIC_API libvlc_media_list_t *
442 libvlc_media_list_new( libvlc_instance_t *, libvlc_exception_t * );
445 libvlc_media_list_release( libvlc_media_list_t * );
448 libvlc_media_list_retain( libvlc_media_list_t * );
451 libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist,
452 const char * psz_uri,
453 libvlc_exception_t * p_e );
456 libvlc_media_list_set_media_descriptor( libvlc_media_list_t *,
457 libvlc_media_descriptor_t *,
458 libvlc_exception_t *);
460 VLC_PUBLIC_API libvlc_media_descriptor_t *
461 libvlc_media_list_media_descriptor( libvlc_media_list_t *,
462 libvlc_exception_t *);
465 libvlc_media_list_add_media_descriptor( libvlc_media_list_t *,
466 libvlc_media_descriptor_t *,
467 libvlc_exception_t * );
469 libvlc_media_list_insert_media_descriptor( libvlc_media_list_t *,
470 libvlc_media_descriptor_t *,
472 libvlc_exception_t * );
474 libvlc_media_list_remove_index( libvlc_media_list_t *, int,
475 libvlc_exception_t * );
478 libvlc_media_list_count( libvlc_media_list_t * p_mlist,
479 libvlc_exception_t * p_e );
481 VLC_PUBLIC_API libvlc_media_descriptor_t *
482 libvlc_media_list_item_at_index( libvlc_media_list_t *, int,
483 libvlc_exception_t * );
485 libvlc_media_list_index_of_item( libvlc_media_list_t *,
486 libvlc_media_descriptor_t *,
487 libvlc_exception_t * );
490 libvlc_media_list_lock( libvlc_media_list_t * );
492 libvlc_media_list_unlock( libvlc_media_list_t * );
494 VLC_PUBLIC_API libvlc_media_list_t *
495 libvlc_media_list_flat_media_list( libvlc_media_list_t *,
496 libvlc_exception_t * );
498 VLC_PUBLIC_API libvlc_event_manager_t *
499 libvlc_media_list_event_manager( libvlc_media_list_t *,
500 libvlc_exception_t * );
504 /*****************************************************************************
506 *****************************************************************************/
507 /** defgroup libvlc_media_list_view MediaListView
509 * LibVLC Media List View
513 libvlc_media_list_view_retain( libvlc_media_list_view_t * p_mlv );
516 libvlc_media_list_view_release( libvlc_media_list_view_t * p_mlv );
519 libvlc_media_list_view_count( libvlc_media_list_view_t * p_mlv,
520 libvlc_exception_t * p_e );
522 VLC_PUBLIC_API libvlc_media_descriptor_t *
523 libvlc_media_list_view_item_at_index( libvlc_media_list_view_t * p_mlv,
525 libvlc_exception_t * p_e );
528 libvlc_media_list_view_index_of_item( libvlc_media_list_view_t * p_mlv,
529 libvlc_media_descriptor_t * p_md,
530 libvlc_exception_t * p_e );
533 libvlc_media_list_view_insert_at_index( libvlc_media_list_view_t * p_mlv,
534 libvlc_media_descriptor_t * p_md,
536 libvlc_exception_t * p_e );
539 libvlc_media_list_view_remove_at_index( libvlc_media_list_view_t * p_mlv,
541 libvlc_exception_t * p_e );
544 libvlc_media_list_view_add_item( libvlc_media_list_view_t * p_mlv,
545 libvlc_media_descriptor_t * p_md,
546 libvlc_exception_t * p_e );
550 /*****************************************************************************
551 * Dynamic Media List (Deprecated)
552 *****************************************************************************/
553 /** defgroup libvlc_media_list MediaList
558 VLC_PUBLIC_API libvlc_dynamic_media_list_t *
559 libvlc_dynamic_media_list_new( libvlc_media_list_t * p_mlist,
560 libvlc_tag_query_t * p_query,
562 libvlc_exception_t * p_e );
564 libvlc_dynamic_media_list_release( libvlc_dynamic_media_list_t * p_dmlist );
567 libvlc_dynamic_media_list_retain( libvlc_dynamic_media_list_t * p_dmlist );
569 libvlc_media_list_t *
570 libvlc_dynamic_media_list_media_list( libvlc_dynamic_media_list_t * p_dmlist,
571 libvlc_exception_t * p_e );
575 /*****************************************************************************
577 *****************************************************************************/
578 /** defgroup libvlc_media_library Media Library
580 * LibVLC Media Library
583 VLC_PUBLIC_API libvlc_media_library_t *
584 libvlc_media_library_new( libvlc_instance_t * p_inst,
585 libvlc_exception_t * p_e );
587 libvlc_media_library_release( libvlc_media_library_t * p_mlib );
589 libvlc_media_library_retain( libvlc_media_library_t * p_mlib );
593 libvlc_media_library_load( libvlc_media_library_t * p_mlib,
594 libvlc_exception_t * p_e );
597 libvlc_media_library_save( libvlc_media_library_t * p_mlib,
598 libvlc_exception_t * p_e );
600 VLC_PUBLIC_API libvlc_media_list_t *
601 libvlc_media_library_media_list( libvlc_media_library_t * p_mlib,
602 libvlc_exception_t * p_e );
607 /*****************************************************************************
609 *****************************************************************************/
610 /** defgroup libvlc_media_list_player MediaListPlayer
612 * LibVLC Media List Player
615 VLC_PUBLIC_API libvlc_media_list_player_t *
616 libvlc_media_list_player_new( libvlc_instance_t * p_instance,
617 libvlc_exception_t * p_e );
619 libvlc_media_list_player_release( libvlc_media_list_player_t * p_mlp );
622 libvlc_media_list_player_set_media_instance(
623 libvlc_media_list_player_t * p_mlp,
624 libvlc_media_instance_t * p_mi,
625 libvlc_exception_t * p_e );
628 libvlc_media_list_player_set_media_list(
629 libvlc_media_list_player_t * p_mlp,
630 libvlc_media_list_t * p_mlist,
631 libvlc_exception_t * p_e );
634 libvlc_media_list_player_play( libvlc_media_list_player_t * p_mlp,
635 libvlc_exception_t * p_e );
638 libvlc_media_list_player_pause( libvlc_media_list_player_t * p_mlp,
639 libvlc_exception_t * p_e );
642 libvlc_media_list_player_is_playing( libvlc_media_list_player_t * p_mlp,
643 libvlc_exception_t * p_e );
645 VLC_PUBLIC_API libvlc_state_t
646 libvlc_media_list_player_get_state( libvlc_media_list_player_t * p_mlp,
647 libvlc_exception_t * p_e );
650 libvlc_media_list_player_play_item_at_index(
651 libvlc_media_list_player_t * p_mlp,
653 libvlc_exception_t * p_e );
656 libvlc_media_list_player_play_item(
657 libvlc_media_list_player_t * p_mlp,
658 libvlc_media_descriptor_t * p_md,
659 libvlc_exception_t * p_e );
662 libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp,
663 libvlc_exception_t * p_e );
665 libvlc_media_list_player_next( libvlc_media_list_player_t * p_mlp,
666 libvlc_exception_t * p_e );
670 /** defgroup libvlc_video Video
672 * LibVLC Video handling
677 * Toggle fullscreen status on video output
678 * \param p_input the input
679 * \param p_exception an initialized exception
681 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_instance_t *, libvlc_exception_t * );
684 * Enable or disable fullscreen on a video output
685 * \param p_input the input
686 * \param b_fullscreen boolean for fullscreen status
687 * \param p_exception an initialized exception
689 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_instance_t *, int, libvlc_exception_t * );
692 * Get current fullscreen status
693 * \param p_input the input
694 * \param p_exception an initialized exception
695 * \return the fullscreen status (boolean)
697 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_instance_t *, libvlc_exception_t * );
700 * Get current video height
701 * \param p_input the input
702 * \param p_exception an initialized exception
703 * \return the video height
705 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_instance_t *, libvlc_exception_t * );
708 * Get current video width
709 * \param p_input the input
710 * \param p_exception an initialized exception
711 * \return the video width
713 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_instance_t *, libvlc_exception_t * );
716 * Get current video aspect ratio
717 * \param p_input the input
718 * \param p_exception an initialized exception
719 * \return the video aspect ratio
721 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_instance_t *, libvlc_exception_t * );
724 * Set new video aspect ratio
725 * \param p_input the input
726 * \param psz_aspect new video aspect-ratio
727 * \param p_exception an initialized exception
729 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_instance_t *, char *, libvlc_exception_t * );
732 * Get current video subtitle
733 * \param p_input the input
734 * \param p_exception an initialized exception
735 * \return the video subtitle selected
737 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_instance_t *, libvlc_exception_t * );
740 * Set new video subtitle
741 * \param p_input the input
742 * \param i_spu new video subtitle to select
743 * \param p_exception an initialized exception
745 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_instance_t *, int , libvlc_exception_t * );
748 * Get current crop filter geometry
749 * \param p_input the input
750 * \param p_exception an initialized exception
751 * \return the crop filter geometry
753 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_instance_t *, libvlc_exception_t * );
756 * Set new crop filter geometry
757 * \param p_input the input
758 * \param psz_geometry new crop filter geometry
759 * \param p_exception an initialized exception
761 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_instance_t *, char *, libvlc_exception_t * );
764 * Get current teletext page requested.
765 * \param p_input the input
766 * \param p_exception an initialized exception
767 * \return the current teletext page requested.
769 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_instance_t *, libvlc_exception_t * );
772 * Set new teletext page to retrieve
773 * \param p_input the input
774 * \param i_page teletex page number requested
775 * \param p_exception an initialized exception
777 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_instance_t *, int, libvlc_exception_t * );
780 * Take a snapshot of the current video window
781 * \param p_input the input
782 * \param psz_filepath the path where to save the screenshot to
783 * \param p_exception an initialized exception
785 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_instance_t *, char *, libvlc_exception_t * );
787 VLC_PUBLIC_API int libvlc_video_destroy( libvlc_media_instance_t *, libvlc_exception_t *);
790 * Resize the current video output window
791 * \param p_instance libvlc instance
792 * \param width new width for video output window
793 * \param height new height for video output window
794 * \param p_exception an initialized exception
795 * \return the success status (boolean)
797 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_instance_t *, int, int, libvlc_exception_t *);
800 * change the parent for the current the video output
801 * \param p_instance libvlc instance
802 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
803 * \param p_exception an initialized exception
804 * \return the success status (boolean)
806 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
809 * Tell windowless video output to redraw rectangular area (MacOS X only)
810 * \param p_instance libvlc instance
811 * \param area coordinates within video drawable
812 * \param p_exception an initialized exception
814 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_instance_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
817 * Set the default video output parent
818 * this settings will be used as default for all video outputs
819 * \param p_instance libvlc instance
820 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
821 * \param p_exception an initialized exception
823 VLC_PUBLIC_API void libvlc_video_set_parent( libvlc_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
826 * Set the default video output parent
827 * this settings will be used as default for all video outputs
828 * \param p_instance libvlc instance
829 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
830 * \param p_exception an initialized exception
832 VLC_PUBLIC_API libvlc_drawable_t libvlc_video_get_parent( libvlc_instance_t *, libvlc_exception_t * );
835 * Set the default video output size
836 * this settings will be used as default for all video outputs
837 * \param p_instance libvlc instance
838 * \param width new width for video drawable
839 * \param height new height for video drawable
840 * \param p_exception an initialized exception
842 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
845 * Set the default video output viewport for a windowless video output (MacOS X only)
846 * this settings will be used as default for all video outputs
847 * \param p_instance libvlc instance
848 * \param view coordinates within video drawable
849 * \param clip coordinates within video drawable
850 * \param p_exception an initialized exception
852 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
856 /** defgroup libvlc_audio Audio
858 * LibVLC Audio handling
864 * \param p_instance libvlc instance
865 * \param p_exception an initialized exception
868 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
871 * Get current mute status
872 * \param p_instance libvlc instance
873 * \param p_exception an initialized exception
874 * \return the mute status (boolean)
876 VLC_PUBLIC_API vlc_bool_t libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
880 * \param p_instance libvlc instance
881 * \param status If status is VLC_TRUE then mute, otherwise unmute
882 * \param p_exception an initialized exception
885 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, vlc_bool_t , libvlc_exception_t * );
888 * Get current audio level
889 * \param p_instance libvlc instance
890 * \param p_exception an initialized exception
891 * \return the audio level (int)
893 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
896 * Set current audio level
897 * \param p_instance libvlc instance
898 * \param i_volume the volume (int)
899 * \param p_exception an initialized exception
901 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
904 + * Get current audio track
905 + * \param p_input input instance
906 + * \param p_exception an initialized exception
907 + * \return the audio track (int)
909 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_instance_t *, libvlc_exception_t * );
912 * Set current audio track
913 * \param p_input input instance
914 * \param i_track the track (int)
915 * \param p_exception an initialized exception
917 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_instance_t *, int, libvlc_exception_t * );
920 * Get current audio channel
921 * \param p_instance input instance
922 * \param p_exception an initialized exception
923 * \return the audio channel (int)
925 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
928 * Set current audio channel
929 * \param p_instance input instance
930 * \param i_channel the audio channel (int)
931 * \param p_exception an initialized exception
933 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
937 /*****************************************************************************
938 * Services/Media Discovery
939 *****************************************************************************/
940 /** defgroup libvlc_media_discoverer Media Discoverer
942 * LibVLC Media Discoverer
946 VLC_PUBLIC_API libvlc_media_discoverer_t *
947 libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
948 const char * psz_name,
949 libvlc_exception_t * p_e );
950 VLC_PUBLIC_API void libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
951 VLC_PUBLIC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
953 VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis );
957 /*****************************************************************************
959 *****************************************************************************/
960 /** defgroup libvlc_vlm VLM
967 * Add a broadcast, with one input
968 * \param p_instance the instance
969 * \param psz_name the name of the new broadcast
970 * \param psz_input the input MRL
971 * \param psz_output the output MRL (the parameter to the "sout" variable)
972 * \param i_options number of additional options
973 * \param ppsz_options additional options
974 * \param b_enabled boolean for enabling the new broadcast
975 * \param b_loop Should this broadcast be played in loop ?
976 * \param p_exception an initialized exception
978 VLC_PUBLIC_API void libvlc_vlm_add_broadcast( libvlc_instance_t *, char *, char *, char* ,
979 int, char **, int, int, libvlc_exception_t * );
982 * Delete a media (vod or broadcast)
983 * \param p_instance the instance
984 * \param psz_name the media to delete
985 * \param p_exception an initialized exception
987 VLC_PUBLIC_API void libvlc_vlm_del_media( libvlc_instance_t *, char *, libvlc_exception_t * );
990 * Enable or disable a media (vod or broadcast)
991 * \param p_instance the instance
992 * \param psz_name the media to work on
993 * \param b_enabled the new status
994 * \param p_exception an initialized exception
996 VLC_PUBLIC_API void libvlc_vlm_set_enabled( libvlc_instance_t *, char *, int,
997 libvlc_exception_t *);
1000 * Set the output for a media
1001 * \param p_instance the instance
1002 * \param psz_name the media to work on
1003 * \param psz_output the output MRL (the parameter to the "sout" variable)
1004 * \param p_exception an initialized exception
1006 VLC_PUBLIC_API void libvlc_vlm_set_output( libvlc_instance_t *, char *, char*,
1007 libvlc_exception_t *);
1010 * Set a media's input MRL. This will delete all existing inputs and
1011 * add the specified one.
1012 * \param p_instance the instance
1013 * \param psz_name the media to work on
1014 * \param psz_input the input MRL
1015 * \param p_exception an initialized exception
1017 VLC_PUBLIC_API void libvlc_vlm_set_input( libvlc_instance_t *, char *, char*,
1018 libvlc_exception_t *);
1021 * Add a media's input MRL. This will add the specified one.
1022 * \param p_instance the instance
1023 * \param psz_name the media to work on
1024 * \param psz_input the input MRL
1025 * \param p_exception an initialized exception
1027 VLC_PUBLIC_API void libvlc_vlm_add_input( libvlc_instance_t *, char *, char *,
1028 libvlc_exception_t *p_exception );
1030 * Set output for a media
1031 * \param p_instance the instance
1032 * \param psz_name the media to work on
1033 * \param b_loop the new status
1034 * \param p_exception an initialized exception
1036 VLC_PUBLIC_API void libvlc_vlm_set_loop( libvlc_instance_t *, char *, int,
1037 libvlc_exception_t *);
1040 * Edit the parameters of a media. This will delete all existing inputs and
1041 * add the specified one.
1042 * \param p_instance the instance
1043 * \param psz_name the name of the new broadcast
1044 * \param psz_input the input MRL
1045 * \param psz_output the output MRL (the parameter to the "sout" variable)
1046 * \param i_options number of additional options
1047 * \param ppsz_options additional options
1048 * \param b_enabled boolean for enabling the new broadcast
1049 * \param b_loop Should this broadcast be played in loop ?
1050 * \param p_exception an initialized exception
1052 VLC_PUBLIC_API void libvlc_vlm_change_media( libvlc_instance_t *, char *, char *, char* ,
1053 int, char **, int, int, libvlc_exception_t * );
1056 * Plays the named broadcast.
1057 * \param p_instance the instance
1058 * \param psz_name the name of the broadcast
1059 * \param p_exception an initialized exception
1061 VLC_PUBLIC_API void libvlc_vlm_play_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
1064 * Stops the named broadcast.
1065 * \param p_instance the instance
1066 * \param psz_name the name of the broadcast
1067 * \param p_exception an initialized exception
1069 VLC_PUBLIC_API void libvlc_vlm_stop_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
1072 * Pauses the named broadcast.
1073 * \param p_instance the instance
1074 * \param psz_name the name of the broadcast
1075 * \param p_exception an initialized exception
1077 VLC_PUBLIC_API void libvlc_vlm_pause_media( libvlc_instance_t *, char *, libvlc_exception_t * );
1080 * Seeks in the named broadcast.
1081 * \param p_instance the instance
1082 * \param psz_name the name of the broadcast
1083 * \param f_percentage the percentage to seek to
1084 * \param p_exception an initialized exception
1086 VLC_PUBLIC_API void libvlc_vlm_seek_media( libvlc_instance_t *, char *,
1087 float, libvlc_exception_t * );
1090 * Return information of the named broadcast.
1091 * \param p_instance the instance
1092 * \param psz_name the name of the broadcast
1093 * \param p_exception an initialized exception
1095 VLC_PUBLIC_API char* libvlc_vlm_show_media( libvlc_instance_t *, char *, libvlc_exception_t * );
1097 #define LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( attr, returnType, getType, default)\
1098 returnType libvlc_vlm_get_media_## attr( libvlc_instance_t *, \
1099 char *, int , libvlc_exception_t * );
1101 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( position, float, Float, -1);
1102 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( time, int, Integer, -1);
1103 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( length, int, Integer, -1);
1104 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( rate, int, Integer, -1);
1105 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( title, int, Integer, 0);
1106 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( chapter, int, Integer, 0);
1107 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( seekable, int, Bool, 0);
1109 #undef LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
1113 /*****************************************************************************
1114 * Message log handling
1115 *****************************************************************************/
1117 /** defgroup libvlc_log Log
1119 * LibVLC Message Logging
1124 * Returns the VLC messaging verbosity level
1125 * \param p_instance libvlc instance
1126 * \param exception an initialized exception pointer
1128 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
1129 libvlc_exception_t *p_e );
1132 * Set the VLC messaging verbosity level
1133 * \param p_log libvlc log instance
1134 * \param exception an initialized exception pointer
1136 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
1137 libvlc_exception_t *p_e );
1140 * Open an instance to VLC message log
1141 * \param p_instance libvlc instance
1142 * \param exception an initialized exception pointer
1144 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( const libvlc_instance_t *, libvlc_exception_t *);
1147 * Close an instance of VLC message log
1148 * \param p_log libvlc log instance
1149 * \param exception an initialized exception pointer
1151 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
1154 * Returns the number of messages in log
1155 * \param p_log libvlc log instance
1156 * \param exception an initialized exception pointer
1158 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
1161 * Clear all messages in log
1162 * the log should be cleared on a regular basis to avoid clogging
1163 * \param p_log libvlc log instance
1164 * \param exception an initialized exception pointer
1166 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
1169 * Allocate and returns a new iterator to messages in log
1170 * \param p_log libvlc log instance
1171 * \param exception an initialized exception pointer
1173 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
1176 * Releases a previoulsy allocated iterator
1177 * \param p_log libvlc log iterator
1178 * \param exception an initialized exception pointer
1180 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1183 * Returns whether log iterator has more messages
1184 * \param p_log libvlc log iterator
1185 * \param exception an initialized exception pointer
1187 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1190 * Returns next log message
1191 * the content of message must not be freed
1192 * \param p_log libvlc log iterator
1193 * \param exception an initialized exception pointer
1195 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
1196 struct libvlc_log_message_t *buffer,
1197 libvlc_exception_t *p_e );
1201 /*****************************************************************************
1203 *****************************************************************************/
1205 /** defgroup libvlc_callbacks Callbacks
1212 * Register for an event notification
1213 * \param p_event_manager the event manager to which you want to attach to
1214 * Generally it is obtained by vlc_my_object_event_manager() where my_object
1215 * Is the object you want to listen to.
1216 * \param i_event_type the desired event to which we want to listen
1217 * \param f_callback the function to call when i_event_type occurs
1218 * \param user_data user provided data to carry with the event
1219 * \param p_e an initialized exception pointer
1221 VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
1222 libvlc_event_type_t i_event_type,
1223 libvlc_callback_t f_callback,
1225 libvlc_exception_t *p_e );
1228 * Unregister an event notification
1229 * \param p_event_manager the event manager
1230 * \param i_event_type the desired event to which we want to unregister
1231 * \param f_callback the function to call when i_event_type occurs
1232 * \param p_e an initialized exception pointer
1234 VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
1235 libvlc_event_type_t i_event_type,
1236 libvlc_callback_t f_callback,
1238 libvlc_exception_t *p_e );
1241 * Get an event type name
1242 * \param i_event_type the desired event
1244 #define libvlc_event_type_name(a) #a
1253 #endif /* <vlc/libvlc.h> */