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 * );
125 /*****************************************************************************
127 *****************************************************************************/
128 /** defgroup libvlc_media_descriptor Media Descriptor
130 * LibVLC Media Descriptor
135 * Create a media descriptor with the given mrl.
136 * \param p_instance the instance
137 * \param psz_mrl the mrl to read
139 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_descriptor_new(
140 libvlc_instance_t *p_instance,
141 const char * psz_mrl,
142 libvlc_exception_t *p_e );
144 VLC_PUBLIC_API void libvlc_media_descriptor_retain(
145 libvlc_media_descriptor_t *p_meta_desc );
147 VLC_PUBLIC_API void libvlc_media_descriptor_release(
148 libvlc_media_descriptor_t *p_meta_desc );
150 VLC_PUBLIC_API char * libvlc_media_descriptor_get_mrl( libvlc_media_descriptor_t * p_md,
151 libvlc_exception_t * p_e );
154 * Read the meta of the media descriptor.
155 * \param p_meta_desc the media descriptor to read
156 * \param p_meta_desc the meta to read
158 VLC_PUBLIC_API char * libvlc_media_descriptor_get_meta(
159 libvlc_media_descriptor_t *p_meta_desc,
160 libvlc_meta_t e_meta,
161 libvlc_exception_t *p_e );
164 VLC_PUBLIC_API void libvlc_media_descriptor_add_tag( libvlc_media_descriptor_t *p_md,
166 const libvlc_tag_t tag,
167 libvlc_exception_t *p_e );
169 VLC_PUBLIC_API void libvlc_media_descriptor_remove_tag( libvlc_media_descriptor_t *p_md,
171 const libvlc_tag_t tag,
172 libvlc_exception_t *p_e );
175 libvlc_media_descriptor_tags_count_for_key( libvlc_media_descriptor_t *p_md,
177 libvlc_exception_t *p_e );
179 VLC_PUBLIC_API libvlc_tag_t
180 libvlc_media_descriptor_tag_at_index_for_key( libvlc_media_descriptor_t *p_md,
183 libvlc_exception_t *p_e );
187 /*****************************************************************************
189 *****************************************************************************/
190 /** defgroup libvlc_playlist Playlist
192 * LibVLC Playlist handling
199 VLC_PUBLIC_API void libvlc_playlist_loop( libvlc_instance_t* , vlc_bool_t,
200 libvlc_exception_t * );
203 * Start playing. You can give some additionnal playlist item options
204 * that will be added to the item before playing it.
205 * \param p_instance the instance
206 * \param i_id the item to play. If this is a negative number, the next
207 * item will be selected. Else, the item with the given ID will be played
208 * \param i_options the number of options to add to the item
209 * \param ppsz_options the options to add to the item
210 * \param p_exception an initialized exception
212 VLC_PUBLIC_API void libvlc_playlist_play( libvlc_instance_t*, int, int, char **,
213 libvlc_exception_t * );
216 * Pause a running playlist, resume if it was stopped
217 * \param p_instance the instance to pause
218 * \param p_exception an initialized exception
220 VLC_PUBLIC_API void libvlc_playlist_pause( libvlc_instance_t *, libvlc_exception_t * );
223 * Checks if the playlist is running
224 * \param p_instance the instance
225 * \param p_exception an initialized exception
226 * \return 0 if the playlist is stopped or paused, 1 if it is running
228 VLC_PUBLIC_API int libvlc_playlist_isplaying( libvlc_instance_t *, libvlc_exception_t * );
231 * Get the number of items in the playlist
232 * \param p_instance the instance
233 * \param p_exception an initialized exception
234 * \return the number of items
236 VLC_PUBLIC_API int libvlc_playlist_items_count( libvlc_instance_t *, libvlc_exception_t * );
239 * Lock the playlist instance
240 * \param p_instance the instance
242 VLC_PUBLIC_API void libvlc_playlist_lock( libvlc_instance_t * );
245 * Unlock the playlist instance
246 * \param p_instance the instance
248 VLC_PUBLIC_API void libvlc_playlist_unlock( libvlc_instance_t * );
252 * \param p_instance the instance to stop
253 * \param p_exception an initialized exception
255 VLC_PUBLIC_API void libvlc_playlist_stop( libvlc_instance_t *, libvlc_exception_t * );
258 * Go to next playlist item (starts playback if it was stopped)
259 * \param p_instance the instance to use
260 * \param p_exception an initialized exception
262 VLC_PUBLIC_API void libvlc_playlist_next( libvlc_instance_t *, libvlc_exception_t * );
265 * Go to previous 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_prev( libvlc_instance_t *, libvlc_exception_t * );
272 * Remove all playlist items
273 * \param p_instance the instance
274 * \param p_exception an initialized exception
276 VLC_PUBLIC_API void libvlc_playlist_clear( libvlc_instance_t *, libvlc_exception_t * );
279 * Add an item at the end of the playlist
280 * If you need more advanced options, \see libvlc_playlist_add_extended
281 * \param p_instance the instance
282 * \param psz_uri the URI to open, using VLC format
283 * \param psz_name a name that you might want to give or NULL
284 * \return the identifier of the new item
286 VLC_PUBLIC_API int libvlc_playlist_add( libvlc_instance_t *, const char *, const char *,
287 libvlc_exception_t * );
290 * Add an item at the end of the playlist, with additional input options
291 * \param p_instance the instance
292 * \param psz_uri the URI to open, using VLC format
293 * \param psz_name a name that you might want to give or NULL
294 * \param i_options the number of options to add
295 * \param ppsz_options strings representing the options to add
296 * \param p_exception an initialized exception
297 * \return the identifier of the new item
299 VLC_PUBLIC_API int libvlc_playlist_add_extended( libvlc_instance_t *, const char *,
300 const char *, int, const char **,
301 libvlc_exception_t * );
304 * Delete the playlist item with the given ID.
305 * \param p_instance the instance
306 * \param i_id the id to remove
307 * \param p_exception an initialized exception
310 VLC_PUBLIC_API int libvlc_playlist_delete_item( libvlc_instance_t *, int,
311 libvlc_exception_t * );
313 /* Get the input that is currently being played by the playlist
314 * \param p_instance the instance to use
315 * \param p_exception an initialized excecption
316 * \return an input object
318 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_playlist_get_media_instance(
319 libvlc_instance_t *, libvlc_exception_t * );
323 /*****************************************************************************
325 *****************************************************************************/
326 /** defgroup libvlc_media_instance Media Instance
328 * LibVLC Media Instance
332 /** Create an empty Media Instance object
333 * \param p_libvlc_instance the libvlc instance in which the Media Instance
334 * should be (not used for now).
336 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new( libvlc_instance_t *, libvlc_exception_t * );
338 /** Create a Media Instance object from a Media Descriptor
339 * \param p_md the media descriptor. Afterwards the p_md can safely be
342 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new_from_media_descriptor( libvlc_media_descriptor_t *, libvlc_exception_t * );
344 /** Release a media_instance after use
345 * \param p_mi the Media Instance to free
347 VLC_PUBLIC_API void libvlc_media_instance_release( libvlc_media_instance_t * );
348 VLC_PUBLIC_API void libvlc_media_instance_retain( libvlc_media_instance_t * );
350 /** Set the media descriptor that will be used by the media_instance. If any,
351 * previous md will be released.
352 * \param p_mi the Media Instance
353 * \param p_md the Media Descriptor. Afterwards the p_md can safely be
356 VLC_PUBLIC_API void libvlc_media_instance_set_media_descriptor( libvlc_media_instance_t *, libvlc_media_descriptor_t *, libvlc_exception_t * );
358 /** Get the media descriptor used by the media_instance (if any). A copy of
359 * the md is returned. NULL is returned if no media instance is associated.
360 * \param p_mi the Media Instance
362 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_instance_get_media_descriptor( libvlc_media_instance_t *, libvlc_exception_t * );
364 /** Get the Event Manager from which the media instance send event.
365 * \param p_mi the Media Instance
367 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_instance_event_manager ( libvlc_media_instance_t *, libvlc_exception_t * );
369 VLC_PUBLIC_API void libvlc_media_instance_play ( libvlc_media_instance_t *, libvlc_exception_t * );
370 VLC_PUBLIC_API void libvlc_media_instance_pause ( libvlc_media_instance_t *, libvlc_exception_t * );
371 VLC_PUBLIC_API void libvlc_media_instance_stop ( libvlc_media_instance_t *, libvlc_exception_t * );
373 VLC_PUBLIC_API void libvlc_media_instance_set_drawable ( libvlc_media_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
375 /// \bug This might go away ... to be replaced by a broader system
376 VLC_PUBLIC_API vlc_int64_t libvlc_media_instance_get_length ( libvlc_media_instance_t *, libvlc_exception_t *);
377 VLC_PUBLIC_API vlc_int64_t libvlc_media_instance_get_time ( libvlc_media_instance_t *, libvlc_exception_t *);
378 VLC_PUBLIC_API void libvlc_media_instance_set_time ( libvlc_media_instance_t *, vlc_int64_t, libvlc_exception_t *);
379 VLC_PUBLIC_API float libvlc_media_instance_get_position ( libvlc_media_instance_t *, libvlc_exception_t *);
380 VLC_PUBLIC_API void libvlc_media_instance_set_position ( libvlc_media_instance_t *, float, libvlc_exception_t *);
381 VLC_PUBLIC_API vlc_bool_t libvlc_media_instance_will_play ( libvlc_media_instance_t *, libvlc_exception_t *);
382 VLC_PUBLIC_API float libvlc_media_instance_get_rate ( libvlc_media_instance_t *, libvlc_exception_t *);
383 VLC_PUBLIC_API void libvlc_media_instance_set_rate ( libvlc_media_instance_t *, float, libvlc_exception_t *);
384 VLC_PUBLIC_API int libvlc_media_instance_get_state ( libvlc_media_instance_t *, libvlc_exception_t *);
387 * Does this input have a video output ?
388 * \param p_input the input
389 * \param p_exception an initialized exception
391 VLC_PUBLIC_API vlc_bool_t libvlc_media_instance_has_vout( libvlc_media_instance_t *, libvlc_exception_t *);
392 VLC_PUBLIC_API float libvlc_media_instance_get_fps( libvlc_media_instance_t *, libvlc_exception_t *);
397 /*****************************************************************************
399 *****************************************************************************/
400 /** defgroup libvlc_tag_query Tag Query
405 VLC_PUBLIC_API libvlc_tag_query_t *
406 libvlc_tag_query_new( libvlc_instance_t *, libvlc_exception_t * );
409 libvlc_tag_query_release( libvlc_tag_query_t * );
412 libvlc_tag_query_retain( libvlc_tag_query_t * );
414 VLC_PUBLIC_API vlc_bool_t
415 libvlc_tag_query_match( libvlc_tag_query_t *, libvlc_media_descriptor_t *,
416 libvlc_exception_t * );
420 /*****************************************************************************
422 *****************************************************************************/
423 /** defgroup libvlc_media_list MediaList
428 VLC_PUBLIC_API libvlc_media_list_t *
429 libvlc_media_list_new( libvlc_instance_t *, libvlc_exception_t * );
432 libvlc_media_list_release( libvlc_media_list_t * );
435 libvlc_media_list_retain( libvlc_media_list_t * );
438 libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist,
439 const char * psz_uri,
440 libvlc_exception_t * p_e );
443 libvlc_media_list_set_name( libvlc_media_list_t *,
444 const char * psz_name,
445 libvlc_exception_t *);
447 VLC_PUBLIC_API char *
448 libvlc_media_list_name( libvlc_media_list_t *,
449 libvlc_exception_t *);
452 libvlc_media_list_add_media_descriptor( libvlc_media_list_t *,
453 libvlc_media_descriptor_t *,
454 libvlc_exception_t * );
456 libvlc_media_list_insert_media_descriptor( libvlc_media_list_t *,
457 libvlc_media_descriptor_t *,
459 libvlc_exception_t * );
461 libvlc_media_list_remove_index( libvlc_media_list_t *, int,
462 libvlc_exception_t * );
465 libvlc_media_list_count( libvlc_media_list_t * p_mlist,
466 libvlc_exception_t * p_e );
468 VLC_PUBLIC_API libvlc_media_descriptor_t *
469 libvlc_media_list_item_at_index( libvlc_media_list_t *, int,
470 libvlc_exception_t * );
472 libvlc_media_list_index_of_item( libvlc_media_list_t *,
473 libvlc_media_descriptor_t *,
474 libvlc_exception_t * );
477 libvlc_media_list_lock( libvlc_media_list_t * );
479 libvlc_media_list_unlock( libvlc_media_list_t * );
481 VLC_PUBLIC_API libvlc_event_manager_t *
482 libvlc_media_list_event_manager( libvlc_media_list_t *,
483 libvlc_exception_t * );
485 VLC_PUBLIC_API libvlc_media_list_t *
486 libvlc_media_list_dynamic_sublist( libvlc_media_list_t *,
487 libvlc_tag_query_t *,
488 libvlc_exception_t * );
492 /*****************************************************************************
494 *****************************************************************************/
495 /** defgroup libvlc_media_library Media Library
497 * LibVLC Media Library
500 VLC_PUBLIC_API libvlc_media_library_t *
501 libvlc_media_library_new( libvlc_instance_t * p_inst,
502 libvlc_exception_t * p_e );
504 libvlc_media_library_release( libvlc_media_library_t * p_mlib );
506 libvlc_media_library_retain( libvlc_media_library_t * p_mlib );
510 libvlc_media_library_load( libvlc_media_library_t * p_mlib,
511 libvlc_exception_t * p_e );
514 libvlc_media_library_save( libvlc_media_library_t * p_mlib,
515 libvlc_exception_t * p_e );
517 VLC_PUBLIC_API libvlc_media_list_t *
518 libvlc_media_library_media_list( libvlc_media_library_t * p_mlib,
519 libvlc_exception_t * p_e );
524 /*****************************************************************************
526 *****************************************************************************/
527 /** defgroup libvlc_media_list_player MediaListPlayer
529 * LibVLC Media List Player
532 VLC_PUBLIC_API libvlc_media_list_player_t *
533 libvlc_media_list_player_new( libvlc_instance_t * p_instance,
534 libvlc_exception_t * p_e );
536 libvlc_media_list_player_release( libvlc_media_list_player_t * p_mlp );
539 libvlc_media_list_player_set_media_instance(
540 libvlc_media_list_player_t * p_mlp,
541 libvlc_media_instance_t * p_mi,
542 libvlc_exception_t * p_e );
545 libvlc_media_list_player_set_media_list(
546 libvlc_media_list_player_t * p_mlp,
547 libvlc_media_list_t * p_mlist,
548 libvlc_exception_t * p_e );
551 libvlc_media_list_player_play( libvlc_media_list_player_t * p_mlp,
552 libvlc_exception_t * p_e );
555 libvlc_media_list_player_play_item_at_index(
556 libvlc_media_list_player_t * p_mlp,
558 libvlc_exception_t * p_e );
561 libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp,
562 libvlc_exception_t * p_e );
564 libvlc_media_list_player_next( libvlc_media_list_player_t * p_mlp,
565 libvlc_exception_t * p_e );
569 /** defgroup libvlc_video Video
571 * LibVLC Video handling
576 * Does this input have a video output ?
577 * \param p_input the input
578 * \param p_exception an initialized exception
580 VLC_PUBLIC_API vlc_bool_t libvlc_input_has_vout( libvlc_media_instance_t *, libvlc_exception_t *);
581 VLC_PUBLIC_API float libvlc_input_get_fps( libvlc_media_instance_t *, libvlc_exception_t *);
584 * Toggle fullscreen status on video output
585 * \param p_input the input
586 * \param p_exception an initialized exception
588 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_instance_t *, libvlc_exception_t * );
591 * Enable or disable fullscreen on a video output
592 * \param p_input the input
593 * \param b_fullscreen boolean for fullscreen status
594 * \param p_exception an initialized exception
596 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_instance_t *, int, libvlc_exception_t * );
599 * Get current fullscreen status
600 * \param p_input the input
601 * \param p_exception an initialized exception
602 * \return the fullscreen status (boolean)
604 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_instance_t *, libvlc_exception_t * );
607 * Get current video height
608 * \param p_input the input
609 * \param p_exception an initialized exception
610 * \return the video height
612 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_instance_t *, libvlc_exception_t * );
615 * Get current video width
616 * \param p_input the input
617 * \param p_exception an initialized exception
618 * \return the video width
620 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_instance_t *, libvlc_exception_t * );
623 * Get current video aspect ratio
624 * \param p_input the input
625 * \param p_exception an initialized exception
626 * \return the video aspect ratio
628 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_instance_t *, libvlc_exception_t * );
631 * Set new video aspect ratio
632 * \param p_input the input
633 * \param psz_aspect new video aspect-ratio
634 * \param p_exception an initialized exception
636 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_instance_t *, char *, libvlc_exception_t * );
639 * Get current video subtitle
640 * \param p_input the input
641 * \param p_exception an initialized exception
642 * \return the video subtitle selected
644 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_instance_t *, libvlc_exception_t * );
647 * Set new video subtitle
648 * \param p_input the input
649 * \param i_spu new video subtitle to select
650 * \param p_exception an initialized exception
652 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_instance_t *, int , libvlc_exception_t * );
655 * Get current crop filter geometry
656 * \param p_input the input
657 * \param p_exception an initialized exception
658 * \return the crop filter geometry
660 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_instance_t *, libvlc_exception_t * );
663 * Set new crop filter geometry
664 * \param p_input the input
665 * \param psz_geometry new crop filter geometry
666 * \param p_exception an initialized exception
668 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_instance_t *, char *, libvlc_exception_t * );
671 * Get current teletext page requested.
672 * \param p_input the input
673 * \param p_exception an initialized exception
674 * \return the current teletext page requested.
676 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_instance_t *, libvlc_exception_t * );
679 * Set new teletext page to retrieve
680 * \param p_input the input
681 * \param i_page teletex page number requested
682 * \param p_exception an initialized exception
684 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_instance_t *, int, libvlc_exception_t * );
687 * Take a snapshot of the current video window
688 * \param p_input the input
689 * \param psz_filepath the path where to save the screenshot to
690 * \param p_exception an initialized exception
692 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_instance_t *, char *, libvlc_exception_t * );
694 VLC_PUBLIC_API int libvlc_video_destroy( libvlc_media_instance_t *, libvlc_exception_t *);
697 * Resize the current video output window
698 * \param p_instance libvlc instance
699 * \param width new width for video output window
700 * \param height new height for video output window
701 * \param p_exception an initialized exception
702 * \return the success status (boolean)
704 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_instance_t *, int, int, libvlc_exception_t *);
707 * change the parent for the current the video output
708 * \param p_instance libvlc instance
709 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
710 * \param p_exception an initialized exception
711 * \return the success status (boolean)
713 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
716 * Tell windowless video output to redraw rectangular area (MacOS X only)
717 * \param p_instance libvlc instance
718 * \param area coordinates within video drawable
719 * \param p_exception an initialized exception
721 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_instance_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
724 * Set the default video output parent
725 * this settings will be used as default for all video outputs
726 * \param p_instance libvlc instance
727 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
728 * \param p_exception an initialized exception
730 VLC_PUBLIC_API void libvlc_video_set_parent( libvlc_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
733 * Set the default video output parent
734 * this settings will be used as default for all video outputs
735 * \param p_instance libvlc instance
736 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
737 * \param p_exception an initialized exception
739 VLC_PUBLIC_API libvlc_drawable_t libvlc_video_get_parent( libvlc_instance_t *, libvlc_exception_t * );
742 * Set the default video output size
743 * this settings will be used as default for all video outputs
744 * \param p_instance libvlc instance
745 * \param width new width for video drawable
746 * \param height new height for video drawable
747 * \param p_exception an initialized exception
749 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
752 * Set the default video output viewport for a windowless video output (MacOS X only)
753 * this settings will be used as default for all video outputs
754 * \param p_instance libvlc instance
755 * \param view coordinates within video drawable
756 * \param clip coordinates within video drawable
757 * \param p_exception an initialized exception
759 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
763 /** defgroup libvlc_audio Audio
765 * LibVLC Audio handling
771 * \param p_instance libvlc instance
772 * \param p_exception an initialized exception
775 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
778 * Get current mute status
779 * \param p_instance libvlc instance
780 * \param p_exception an initialized exception
781 * \return the mute status (boolean)
783 VLC_PUBLIC_API vlc_bool_t libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
787 * \param p_instance libvlc instance
788 * \param status If status is VLC_TRUE then mute, otherwise unmute
789 * \param p_exception an initialized exception
792 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, vlc_bool_t , libvlc_exception_t * );
795 * Get current audio level
796 * \param p_instance libvlc instance
797 * \param p_exception an initialized exception
798 * \return the audio level (int)
800 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
803 * Set current audio level
804 * \param p_instance libvlc instance
805 * \param i_volume the volume (int)
806 * \param p_exception an initialized exception
808 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
811 + * Get current audio track
812 + * \param p_input input instance
813 + * \param p_exception an initialized exception
814 + * \return the audio track (int)
816 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_instance_t *, libvlc_exception_t * );
819 * Set current audio track
820 * \param p_input input instance
821 * \param i_track the track (int)
822 * \param p_exception an initialized exception
824 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_instance_t *, int, libvlc_exception_t * );
827 * Get current audio channel
828 * \param p_instance input instance
829 * \param p_exception an initialized exception
830 * \return the audio channel (int)
832 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
835 * Set current audio channel
836 * \param p_instance input instance
837 * \param i_channel the audio channel (int)
838 * \param p_exception an initialized exception
840 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
844 /*****************************************************************************
845 * Services/Media Discovery
846 *****************************************************************************/
847 /** defgroup libvlc_media_discoverer Media Discoverer
849 * LibVLC Media Discoverer
853 VLC_PUBLIC_API libvlc_media_discoverer_t *
854 libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
855 const char * psz_name,
856 libvlc_exception_t * p_e );
857 VLC_PUBLIC_API void libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
858 VLC_PUBLIC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
860 VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( );
864 /*****************************************************************************
866 *****************************************************************************/
867 /** defgroup libvlc_vlm VLM
874 * Add a broadcast, with one input
875 * \param p_instance the instance
876 * \param psz_name the name of the new broadcast
877 * \param psz_input the input MRL
878 * \param psz_output the output MRL (the parameter to the "sout" variable)
879 * \param i_options number of additional options
880 * \param ppsz_options additional options
881 * \param b_enabled boolean for enabling the new broadcast
882 * \param b_loop Should this broadcast be played in loop ?
883 * \param p_exception an initialized exception
885 VLC_PUBLIC_API void libvlc_vlm_add_broadcast( libvlc_instance_t *, char *, char *, char* ,
886 int, char **, int, int, libvlc_exception_t * );
889 * Delete a media (vod or broadcast)
890 * \param p_instance the instance
891 * \param psz_name the media to delete
892 * \param p_exception an initialized exception
894 VLC_PUBLIC_API void libvlc_vlm_del_media( libvlc_instance_t *, char *, libvlc_exception_t * );
897 * Enable or disable a media (vod or broadcast)
898 * \param p_instance the instance
899 * \param psz_name the media to work on
900 * \param b_enabled the new status
901 * \param p_exception an initialized exception
903 VLC_PUBLIC_API void libvlc_vlm_set_enabled( libvlc_instance_t *, char *, int,
904 libvlc_exception_t *);
907 * Set the output for a media
908 * \param p_instance the instance
909 * \param psz_name the media to work on
910 * \param psz_output the output MRL (the parameter to the "sout" variable)
911 * \param p_exception an initialized exception
913 VLC_PUBLIC_API void libvlc_vlm_set_output( libvlc_instance_t *, char *, char*,
914 libvlc_exception_t *);
917 * Set a media's input MRL. This will delete all existing inputs and
918 * add the specified one.
919 * \param p_instance the instance
920 * \param psz_name the media to work on
921 * \param psz_input the input MRL
922 * \param p_exception an initialized exception
924 VLC_PUBLIC_API void libvlc_vlm_set_input( libvlc_instance_t *, char *, char*,
925 libvlc_exception_t *);
928 * Add a media's input MRL. This will add the specified one.
929 * \param p_instance the instance
930 * \param psz_name the media to work on
931 * \param psz_input the input MRL
932 * \param p_exception an initialized exception
934 VLC_PUBLIC_API void libvlc_vlm_add_input( libvlc_instance_t *, char *, char *,
935 libvlc_exception_t *p_exception );
937 * Set output for a media
938 * \param p_instance the instance
939 * \param psz_name the media to work on
940 * \param b_loop the new status
941 * \param p_exception an initialized exception
943 VLC_PUBLIC_API void libvlc_vlm_set_loop( libvlc_instance_t *, char *, int,
944 libvlc_exception_t *);
947 * Edit the parameters of a media. This will delete all existing inputs and
948 * add the specified one.
949 * \param p_instance the instance
950 * \param psz_name the name of the new broadcast
951 * \param psz_input the input MRL
952 * \param psz_output the output MRL (the parameter to the "sout" variable)
953 * \param i_options number of additional options
954 * \param ppsz_options additional options
955 * \param b_enabled boolean for enabling the new broadcast
956 * \param b_loop Should this broadcast be played in loop ?
957 * \param p_exception an initialized exception
959 VLC_PUBLIC_API void libvlc_vlm_change_media( libvlc_instance_t *, char *, char *, char* ,
960 int, char **, int, int, libvlc_exception_t * );
963 * Plays the named broadcast.
964 * \param p_instance the instance
965 * \param psz_name the name of the broadcast
966 * \param p_exception an initialized exception
968 VLC_PUBLIC_API void libvlc_vlm_play_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
971 * Stops the named broadcast.
972 * \param p_instance the instance
973 * \param psz_name the name of the broadcast
974 * \param p_exception an initialized exception
976 VLC_PUBLIC_API void libvlc_vlm_stop_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
979 * Pauses the named broadcast.
980 * \param p_instance the instance
981 * \param psz_name the name of the broadcast
982 * \param p_exception an initialized exception
984 VLC_PUBLIC_API void libvlc_vlm_pause_media( libvlc_instance_t *, char *, libvlc_exception_t * );
987 * Seeks in the named broadcast.
988 * \param p_instance the instance
989 * \param psz_name the name of the broadcast
990 * \param f_percentage the percentage to seek to
991 * \param p_exception an initialized exception
993 VLC_PUBLIC_API void libvlc_vlm_seek_media( libvlc_instance_t *, char *,
994 float, libvlc_exception_t * );
997 * Return information of the named broadcast.
998 * \param p_instance the instance
999 * \param psz_name the name of the broadcast
1000 * \param p_exception an initialized exception
1002 VLC_PUBLIC_API char* libvlc_vlm_show_media( libvlc_instance_t *, char *, libvlc_exception_t * );
1004 #define LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( attr, returnType, getType, default)\
1005 returnType libvlc_vlm_get_media_## attr( libvlc_instance_t *, \
1006 char *, int , libvlc_exception_t * );
1008 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( position, float, Float, -1);
1009 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( time, int, Integer, -1);
1010 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( length, int, Integer, -1);
1011 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( rate, int, Integer, -1);
1012 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( title, int, Integer, 0);
1013 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( chapter, int, Integer, 0);
1014 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( seekable, int, Bool, 0);
1016 #undef LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
1020 /*****************************************************************************
1021 * Message log handling
1022 *****************************************************************************/
1024 /** defgroup libvlc_log Log
1026 * LibVLC Message Logging
1031 * Returns the VLC messaging verbosity level
1032 * \param p_instance libvlc instance
1033 * \param exception an initialized exception pointer
1035 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
1036 libvlc_exception_t *p_e );
1039 * Set the VLC messaging verbosity level
1040 * \param p_log libvlc log instance
1041 * \param exception an initialized exception pointer
1043 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
1044 libvlc_exception_t *p_e );
1047 * Open an instance to VLC message log
1048 * \param p_instance libvlc instance
1049 * \param exception an initialized exception pointer
1051 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( const libvlc_instance_t *, libvlc_exception_t *);
1054 * Close an instance of VLC message log
1055 * \param p_log libvlc log instance
1056 * \param exception an initialized exception pointer
1058 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
1061 * Returns the number of messages in log
1062 * \param p_log libvlc log instance
1063 * \param exception an initialized exception pointer
1065 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
1068 * Clear all messages in log
1069 * the log should be cleared on a regular basis to avoid clogging
1070 * \param p_log libvlc log instance
1071 * \param exception an initialized exception pointer
1073 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
1076 * Allocate and returns a new iterator to messages in log
1077 * \param p_log libvlc log instance
1078 * \param exception an initialized exception pointer
1080 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
1083 * Releases a previoulsy allocated iterator
1084 * \param p_log libvlc log iterator
1085 * \param exception an initialized exception pointer
1087 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1090 * Returns whether log iterator has more messages
1091 * \param p_log libvlc log iterator
1092 * \param exception an initialized exception pointer
1094 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1097 * Returns next log message
1098 * the content of message must not be freed
1099 * \param p_log libvlc log iterator
1100 * \param exception an initialized exception pointer
1102 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
1103 struct libvlc_log_message_t *buffer,
1104 libvlc_exception_t *p_e );
1108 /*****************************************************************************
1110 *****************************************************************************/
1112 /** defgroup libvlc_callbacks Callbacks
1119 * Register for an event notification
1120 * \param p_event_manager the event manager to which you want to attach to
1121 * Generally it is obtained by vlc_my_object_event_manager() where my_object
1122 * Is the object you want to listen to.
1123 * \param i_event_type the desired event to which we want to listen
1124 * \param f_callback the function to call when i_event_type occurs
1125 * \param user_data user provided data to carry with the event
1126 * \param p_e an initialized exception pointer
1128 VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
1129 libvlc_event_type_t i_event_type,
1130 libvlc_callback_t f_callback,
1132 libvlc_exception_t *p_e );
1135 * Unregister an event notification
1136 * \param p_event_manager the event manager
1137 * \param i_event_type the desired event to which we want to unregister
1138 * \param f_callback the function to call when i_event_type occurs
1139 * \param p_e an initialized exception pointer
1141 VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
1142 libvlc_event_type_t i_event_type,
1143 libvlc_callback_t f_callback,
1145 libvlc_exception_t *p_e );
1149 * Get an event type name
1150 * \param i_event_type the desired event
1152 #define libvlc_event_type_name(a) #a
1161 #endif /* <vlc/libvlc.h> */