1 /*****************************************************************************
2 * libvlc.h: libvlc_* new external API
3 *****************************************************************************
4 * Copyright (C) 1998-2005 the VideoLAN team
7 * Authors: Clément Stenac <zorglub@videolan.org>
8 * Jean-Paul Saman <jpsaman _at_ m2x _dot_ nl>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 *****************************************************************************/
26 * \defgroup libvlc Libvlc
27 * This is libvlc, the base library of the VLC program.
37 #include <vlc/libvlc_structures.h>
43 /*****************************************************************************
45 *****************************************************************************/
46 /** defgroup libvlc_exception Exceptions
48 * LibVLC Exceptions handling
53 * Initialize an exception structure. This can be called several times to
54 * reuse an exception structure.
56 * \param p_exception the exception to initialize
58 VLC_PUBLIC_API void libvlc_exception_init( libvlc_exception_t *p_exception );
61 * Has an exception been raised?
63 * \param p_exception the exception to query
64 * \return 0 if the exception was raised, 1 otherwise
67 libvlc_exception_raised( const libvlc_exception_t *p_exception );
70 * Raise an exception using a user-provided message.
72 * \param p_exception the exception to raise
73 * \param psz_message the exception message format string
74 * \param ... the format string arguments
77 libvlc_exception_raise( libvlc_exception_t *p_exception,
78 const char *psz_format, ... );
81 * Clear an exception object so it can be reused.
82 * The exception object must have be initialized.
84 * \param p_exception the exception to clear
86 VLC_PUBLIC_API void libvlc_exception_clear( libvlc_exception_t * );
89 * Get an exception's message.
91 * \param p_exception the exception to query
92 * \return the exception message or NULL if not applicable (exception not
93 * raised, for example)
95 VLC_PUBLIC_API const char *
96 libvlc_exception_get_message( const libvlc_exception_t *p_exception );
100 /*****************************************************************************
102 *****************************************************************************/
104 /** defgroup libvlc_core Core
111 * Create and initialize a libvlc instance.
113 * \param argc the number of arguments
114 * \param argv command-line-type arguments. argv[0] must be the path of the
116 * \param p_e an initialized exception pointer
117 * \return the libvlc instance
119 VLC_PUBLIC_API libvlc_instance_t *
120 libvlc_new( int , const char *const *, libvlc_exception_t *);
123 * Return a libvlc instance identifier for legacy APIs. Use of this
124 * function is discouraged, you should convert your program to use the
127 * \param p_instance the instance
128 * \return the instance identifier
130 VLC_PUBLIC_API int libvlc_get_vlc_id( libvlc_instance_t *p_instance );
133 * Decrement the reference count of a libvlc instance, and destroy it
134 * if it reaches zero.
136 * \param p_instance the instance to destroy
138 VLC_PUBLIC_API void libvlc_release( libvlc_instance_t * );
141 * Increments the reference count of a libvlc instance.
142 * The initial reference count is 1 after libvlc_new() returns.
144 * \param p_instance the instance to reference
146 VLC_PUBLIC_API void libvlc_retain( libvlc_instance_t * );
150 /*****************************************************************************
152 *****************************************************************************/
153 /** defgroup libvlc_media_descriptor Media Descriptor
155 * LibVLC Media Descriptor
160 * Create a media descriptor with the given MRL.
162 * \param p_instance the instance
163 * \param psz_mrl the MRL to read
164 * \param p_e an initialized exception pointer
165 * \return the newly created media descriptor
167 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_descriptor_new(
168 libvlc_instance_t *p_instance,
169 const char * psz_mrl,
170 libvlc_exception_t *p_e );
173 * Create a media descriptor as an empty node with the passed name.
175 * \param p_instance the instance
176 * \param psz_name the name of the node
177 * \param p_e an initialized exception pointer
178 * \return the new empty media descriptor
180 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_descriptor_new_as_node(
181 libvlc_instance_t *p_instance,
182 const char * psz_name,
183 libvlc_exception_t *p_e );
186 * Add an option to the media descriptor.
188 * This option will be used to determine how the media_instance will
189 * read the media_descriptor. This allows to use VLC's advanced
190 * reading/streaming options on a per-media basis.
192 * The options are detailed in vlc --long-help, for instance "--sout-all"
194 * \param p_instance the instance
195 * \param psz_mrl the MRL to read
196 * \param p_e an initialized exception pointer
198 VLC_PUBLIC_API void libvlc_media_descriptor_add_option(
199 libvlc_media_descriptor_t * p_md,
200 const char * ppsz_options,
201 libvlc_exception_t * p_e );
203 VLC_PUBLIC_API void libvlc_media_descriptor_retain(
204 libvlc_media_descriptor_t *p_meta_desc );
206 VLC_PUBLIC_API void libvlc_media_descriptor_release(
207 libvlc_media_descriptor_t *p_meta_desc );
209 VLC_PUBLIC_API char * libvlc_media_descriptor_get_mrl( libvlc_media_descriptor_t * p_md,
210 libvlc_exception_t * p_e );
212 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_descriptor_duplicate( libvlc_media_descriptor_t * );
215 * Read the meta of the media descriptor.
217 * \param p_meta_desc the media descriptor to read
218 * \param p_meta_desc the meta to read
219 * \param p_e an initialized exception pointer
220 * \return the media descriptor's meta
222 VLC_PUBLIC_API char * libvlc_media_descriptor_get_meta(
223 libvlc_media_descriptor_t *p_meta_desc,
224 libvlc_meta_t e_meta,
225 libvlc_exception_t *p_e );
227 VLC_PUBLIC_API libvlc_state_t libvlc_media_descriptor_get_state(
228 libvlc_media_descriptor_t *p_meta_desc,
229 libvlc_exception_t *p_e );
232 VLC_PUBLIC_API void libvlc_media_descriptor_add_tag( libvlc_media_descriptor_t *p_md,
234 const libvlc_tag_t tag,
235 libvlc_exception_t *p_e );
237 VLC_PUBLIC_API void libvlc_media_descriptor_remove_tag( libvlc_media_descriptor_t *p_md,
239 const libvlc_tag_t tag,
240 libvlc_exception_t *p_e );
243 libvlc_media_descriptor_tags_count_for_key( libvlc_media_descriptor_t *p_md,
245 libvlc_exception_t *p_e );
247 VLC_PUBLIC_API libvlc_tag_t
248 libvlc_media_descriptor_tag_at_index_for_key( libvlc_media_descriptor_t *p_md,
251 libvlc_exception_t *p_e );
253 VLC_PUBLIC_API libvlc_media_list_t *
254 libvlc_media_descriptor_subitems( libvlc_media_descriptor_t *p_md,
255 libvlc_exception_t *p_e );
257 VLC_PUBLIC_API libvlc_event_manager_t *
258 libvlc_media_descriptor_event_manager( libvlc_media_descriptor_t * p_md,
259 libvlc_exception_t * p_e );
261 VLC_PUBLIC_API libvlc_time_t
262 libvlc_media_descriptor_get_duration( libvlc_media_descriptor_t * p_md,
263 libvlc_exception_t * p_e );
266 libvlc_media_descriptor_is_preparsed( libvlc_media_descriptor_t * p_md,
267 libvlc_exception_t * p_e );
270 libvlc_media_descriptor_set_user_data( libvlc_media_descriptor_t * p_md,
271 void * p_new_user_data,
272 libvlc_exception_t * p_e);
273 VLC_PUBLIC_API void *
274 libvlc_media_descriptor_get_user_data( libvlc_media_descriptor_t * p_md,
275 libvlc_exception_t * p_e);
279 /*****************************************************************************
281 *****************************************************************************/
282 /** defgroup libvlc_media_instance Media Instance
284 * LibVLC Media Instance, object that let you play a media descriptor
285 * in a libvlc_drawable_t
289 /** Create an empty Media Instance object
291 * \param p_libvlc_instance the libvlc instance in which the Media Instance
292 * should be (unused for now).
293 * \param p_e an initialized exception pointer
295 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new( libvlc_instance_t *, libvlc_exception_t * );
297 /** Create a Media Instance object from a Media Descriptor
298 * \param p_md the media descriptor. Afterwards the p_md can be safely
300 * \param p_e an initialized exception pointer
302 VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new_from_media_descriptor( libvlc_media_descriptor_t *, libvlc_exception_t * );
304 /** Release a media_instance after use
305 * \param p_mi the Media Instance to free
307 VLC_PUBLIC_API void libvlc_media_instance_release( libvlc_media_instance_t * );
308 VLC_PUBLIC_API void libvlc_media_instance_retain( libvlc_media_instance_t * );
310 /** Set the media descriptor that will be used by the media_instance. If any,
311 * previous md will be released.
313 * \param p_mi the Media Instance
314 * \param p_md the Media Descriptor. Afterwards the p_md can be safely
316 * \param p_e an initialized exception pointer
318 VLC_PUBLIC_API void libvlc_media_instance_set_media_descriptor( libvlc_media_instance_t *, libvlc_media_descriptor_t *, libvlc_exception_t * );
320 /** Get the media descriptor used by the media_instance (if any). A copy of
321 * the md is returned. NULL is returned if no media instance is associated.
323 * \param p_mi the Media Instance
324 * \param p_e an initialized exception pointer
326 VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_instance_get_media_descriptor( libvlc_media_instance_t *, libvlc_exception_t * );
328 /** Get the Event Manager from which the media instance send event.
330 * \param p_mi the Media Instance
331 * \param p_e an initialized exception pointer
333 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_instance_event_manager ( libvlc_media_instance_t *, libvlc_exception_t * );
335 VLC_PUBLIC_API void libvlc_media_instance_play ( libvlc_media_instance_t *, libvlc_exception_t * );
336 VLC_PUBLIC_API void libvlc_media_instance_pause ( libvlc_media_instance_t *, libvlc_exception_t * );
337 VLC_PUBLIC_API void libvlc_media_instance_stop ( libvlc_media_instance_t *, libvlc_exception_t * );
339 VLC_PUBLIC_API void libvlc_media_instance_set_drawable ( libvlc_media_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
340 VLC_PUBLIC_API libvlc_drawable_t
341 libvlc_media_instance_get_drawable ( libvlc_media_instance_t *, libvlc_exception_t * );
343 /** \bug This might go away ... to be replaced by a broader system */
344 VLC_PUBLIC_API libvlc_time_t libvlc_media_instance_get_length ( libvlc_media_instance_t *, libvlc_exception_t *);
345 VLC_PUBLIC_API libvlc_time_t libvlc_media_instance_get_time ( libvlc_media_instance_t *, libvlc_exception_t *);
346 VLC_PUBLIC_API void libvlc_media_instance_set_time ( libvlc_media_instance_t *, libvlc_time_t, libvlc_exception_t *);
347 VLC_PUBLIC_API float libvlc_media_instance_get_position ( libvlc_media_instance_t *, libvlc_exception_t *);
348 VLC_PUBLIC_API void libvlc_media_instance_set_position ( libvlc_media_instance_t *, float, libvlc_exception_t *);
349 VLC_PUBLIC_API void libvlc_media_instance_set_chapter ( libvlc_media_instance_t *, int, libvlc_exception_t *);
350 VLC_PUBLIC_API int libvlc_media_instance_get_chapter (libvlc_media_instance_t *, libvlc_exception_t *);
351 VLC_PUBLIC_API int libvlc_media_instance_get_chapter_count( libvlc_media_instance_t *, libvlc_exception_t *);
352 VLC_PUBLIC_API int libvlc_media_instance_will_play ( libvlc_media_instance_t *, libvlc_exception_t *);
353 VLC_PUBLIC_API float libvlc_media_instance_get_rate ( libvlc_media_instance_t *, libvlc_exception_t *);
354 VLC_PUBLIC_API void libvlc_media_instance_set_rate ( libvlc_media_instance_t *, float, libvlc_exception_t *);
355 VLC_PUBLIC_API libvlc_state_t libvlc_media_instance_get_state ( libvlc_media_instance_t *, libvlc_exception_t *);
358 * Does this input have a video output?
360 * \param p_input the input
361 * \param p_e an initialized exception pointer
363 VLC_PUBLIC_API int libvlc_media_instance_has_vout( libvlc_media_instance_t *, libvlc_exception_t *);
364 VLC_PUBLIC_API float libvlc_media_instance_get_fps( libvlc_media_instance_t *, libvlc_exception_t *);
366 VLC_PUBLIC_API int libvlc_media_instance_is_seekable(
367 libvlc_media_instance_t *p_mi,
368 libvlc_exception_t *p_e );
370 VLC_PUBLIC_API int libvlc_media_instance_can_pause(
371 libvlc_media_instance_t *p_mi,
372 libvlc_exception_t *p_e );
374 /** defgroup libvlc_video Video
375 * \ingroup libvlc_media_instance
376 * LibVLC Video handling
381 * Toggle fullscreen status on video output.
383 * \param p_input the input
384 * \param p_e an initialized exception pointer
386 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_instance_t *, libvlc_exception_t * );
389 * Enable or disable fullscreen on a video output.
391 * \param p_input the input
392 * \param b_fullscreen boolean for fullscreen status
393 * \param p_e an initialized exception pointer
395 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_instance_t *, int, libvlc_exception_t * );
398 * Get current fullscreen status.
400 * \param p_input the input
401 * \param p_e an initialized exception pointer
402 * \return the fullscreen status (boolean)
404 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_instance_t *, libvlc_exception_t * );
407 * Get current video height.
409 * \param p_input the input
410 * \param p_e an initialized exception pointer
411 * \return the video height
413 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_instance_t *, libvlc_exception_t * );
416 * Get current video width.
418 * \param p_input the input
419 * \param p_e an initialized exception pointer
420 * \return the video width
422 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_instance_t *, libvlc_exception_t * );
425 * Get current video aspect ratio.
427 * \param p_input the input
428 * \param p_e an initialized exception pointer
429 * \return the video aspect ratio
431 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_instance_t *, libvlc_exception_t * );
434 * Set new video aspect ratio.
436 * \param p_input the input
437 * \param psz_aspect new video aspect-ratio
438 * \param p_e an initialized exception pointer
440 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_instance_t *, char *, libvlc_exception_t * );
443 * Get current video subtitle.
445 * \param p_input the input
446 * \param p_e an initialized exception pointer
447 * \return the video subtitle selected
449 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_instance_t *, libvlc_exception_t * );
452 * Set new video subtitle.
454 * \param p_input the input
455 * \param i_spu new video subtitle to select
456 * \param p_e an initialized exception pointer
458 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_instance_t *, int , libvlc_exception_t * );
461 * Get current crop filter geometry.
463 * \param p_input the input
464 * \param p_e an initialized exception pointer
465 * \return the crop filter geometry
467 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_instance_t *, libvlc_exception_t * );
470 * Set new crop filter geometry.
472 * \param p_input the input
473 * \param psz_geometry new crop filter geometry
474 * \param p_e an initialized exception pointer
476 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_instance_t *, char *, libvlc_exception_t * );
479 * Toggle teletext transparent status on video output.
481 * \param p_input the input
482 * \param p_e an initialized exception pointer
484 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_instance_t *, libvlc_exception_t * );
487 * Get current teletext page requested.
489 * \param p_input the input
490 * \param p_e an initialized exception pointer
491 * \return the current teletext page requested.
493 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_instance_t *, libvlc_exception_t * );
496 * Set new teletext page to retrieve.
498 * \param p_input the input
499 * \param i_page teletex page number requested
500 * \param p_e an initialized exception pointer
502 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_instance_t *, int, libvlc_exception_t * );
505 * Take a snapshot of the current video window.
507 * If i_width AND i_height is 0, original size is used.
508 * If i_width XOR i_height is 0, original aspect-ratio is preserved.
510 * \param p_input the input
511 * \param psz_filepath the path where to save the screenshot to
512 * \param i_width the snapshot's width
513 * \param i_height the snapshot's height
514 * \param p_e an initialized exception pointer
516 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_instance_t *, char *,unsigned int, unsigned int, libvlc_exception_t * );
518 VLC_PUBLIC_API int libvlc_video_destroy( libvlc_media_instance_t *, libvlc_exception_t *);
521 * Resize the current video output window.
523 * \param p_instance libvlc instance
524 * \param width new width for video output window
525 * \param height new height for video output window
526 * \param p_e an initialized exception pointer
527 * \return the success status (boolean)
529 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_instance_t *, int, int, libvlc_exception_t *);
532 * Change the parent for the current the video output.
534 * \param p_instance libvlc instance
535 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
536 * \param p_e an initialized exception pointer
537 * \return the success status (boolean)
539 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
542 * Tell windowless video output to redraw rectangular area (MacOS X only).
544 * \param p_instance libvlc instance
545 * \param area coordinates within video drawable
546 * \param p_e an initialized exception pointer
548 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_instance_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
551 * Set the default video output's parent.
553 * This setting will be used as default for all video outputs.
555 * \param p_instance libvlc instance
556 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
557 * \param p_e an initialized exception pointer
559 VLC_PUBLIC_API void libvlc_video_set_parent( libvlc_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
562 * Set the default video output parent.
564 * This setting will be used as default for all video outputs.
566 * \param p_instance libvlc instance
567 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
568 * \param p_e an initialized exception pointer
570 VLC_PUBLIC_API libvlc_drawable_t libvlc_video_get_parent( libvlc_instance_t *, libvlc_exception_t * );
573 * Set the default video output size.
575 * This setting will be used as default for all video outputs.
577 * \param p_instance libvlc instance
578 * \param width new width for video drawable
579 * \param height new height for video drawable
580 * \param p_e an initialized exception pointer
582 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
585 * Set the default video output viewport for a windowless video output
588 * This setting will be used as default for all video outputs.
590 * \param p_instance libvlc instance
591 * \param view coordinates within video drawable
592 * \param clip coordinates within video drawable
593 * \param p_e an initialized exception pointer
595 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
599 /** defgroup libvlc_audio Audio
600 * \ingroup libvlc_media_instance
601 * LibVLC Audio handling
606 * Toggle mute status.
608 * \param p_instance libvlc instance
609 * \param p_e an initialized exception pointer
611 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
614 * Get current mute status.
616 * \param p_instance libvlc instance
617 * \param p_e an initialized exception pointer
618 * \return the mute status (boolean)
620 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
625 * \param p_instance libvlc instance
626 * \param status If status is VLC_TRUE then mute, otherwise unmute
627 * \param p_e an initialized exception pointer
629 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, int , libvlc_exception_t * );
632 * Get current audio level.
634 * \param p_instance libvlc instance
635 * \param p_e an initialized exception pointer
636 * \return the audio level (int)
638 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
641 * Set current audio level.
643 * \param p_instance libvlc instance
644 * \param i_volume the volume (int)
645 * \param p_e an initialized exception pointer
647 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
650 * Get number of available audio tracks.
652 * \param p_mi media instance
653 * \param p_e an initialized exception
654 * \return the number of available audio tracks (int)
656 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_instance_t *, libvlc_exception_t * );
659 * Get current audio track.
661 * \param p_input input instance
662 * \param p_e an initialized exception pointer
663 * \return the audio track (int)
665 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_instance_t *, libvlc_exception_t * );
668 * Set current audio track.
670 * \param p_input input instance
671 * \param i_track the track (int)
672 * \param p_e an initialized exception pointer
674 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_instance_t *, int, libvlc_exception_t * );
677 * Get current audio channel.
679 * \param p_instance input instance
680 * \param p_e an initialized exception pointer
681 * \return the audio channel (int)
683 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
686 * Set current audio channel.
688 * \param p_instance input instance
689 * \param i_channel the audio channel (int)
690 * \param p_e an initialized exception pointer
692 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
696 /** @} media_instance */
698 /*****************************************************************************
700 *****************************************************************************/
702 /** defgroup libvlc_callbacks Callbacks
709 * Register for an event notification.
711 * \param p_event_manager the event manager to which you want to attach to.
712 * Generally it is obtained by vlc_my_object_event_manager() where
713 * my_object is the object you want to listen to.
714 * \param i_event_type the desired event to which we want to listen
715 * \param f_callback the function to call when i_event_type occurs
716 * \param user_data user provided data to carry with the event
717 * \param p_e an initialized exception pointer
719 VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
720 libvlc_event_type_t i_event_type,
721 libvlc_callback_t f_callback,
723 libvlc_exception_t *p_e );
726 * Unregister an event notification.
728 * \param p_event_manager the event manager
729 * \param i_event_type the desired event to which we want to unregister
730 * \param f_callback the function to call when i_event_type occurs
731 * \param p_e an initialized exception pointer
733 VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
734 libvlc_event_type_t i_event_type,
735 libvlc_callback_t f_callback,
737 libvlc_exception_t *p_e );
740 * Get an event's type name.
742 * \param i_event_type the desired event
744 VLC_PUBLIC_API const char * libvlc_event_type_name( libvlc_event_type_t event_type );
748 /*****************************************************************************
750 *****************************************************************************/
751 /** defgroup libvlc_media_list MediaList
756 VLC_PUBLIC_API libvlc_media_list_t *
757 libvlc_media_list_new( libvlc_instance_t *, libvlc_exception_t * );
760 libvlc_media_list_release( libvlc_media_list_t * );
763 libvlc_media_list_retain( libvlc_media_list_t * );
766 libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist,
767 const char * psz_uri,
768 libvlc_exception_t * p_e );
771 libvlc_media_list_set_media_descriptor( libvlc_media_list_t *,
772 libvlc_media_descriptor_t *,
773 libvlc_exception_t *);
775 VLC_PUBLIC_API libvlc_media_descriptor_t *
776 libvlc_media_list_media_descriptor( libvlc_media_list_t *,
777 libvlc_exception_t *);
780 libvlc_media_list_add_media_descriptor( libvlc_media_list_t *,
781 libvlc_media_descriptor_t *,
782 libvlc_exception_t * );
784 libvlc_media_list_insert_media_descriptor( libvlc_media_list_t *,
785 libvlc_media_descriptor_t *,
787 libvlc_exception_t * );
789 libvlc_media_list_remove_index( libvlc_media_list_t *, int,
790 libvlc_exception_t * );
793 libvlc_media_list_count( libvlc_media_list_t * p_mlist,
794 libvlc_exception_t * p_e );
796 VLC_PUBLIC_API libvlc_media_descriptor_t *
797 libvlc_media_list_item_at_index( libvlc_media_list_t *, int,
798 libvlc_exception_t * );
800 libvlc_media_list_index_of_item( libvlc_media_list_t *,
801 libvlc_media_descriptor_t *,
802 libvlc_exception_t * );
804 /* This indicates if this media list is read-only from a user point of view */
806 libvlc_media_list_is_readonly( libvlc_media_list_t * p_mlist );
809 libvlc_media_list_lock( libvlc_media_list_t * );
811 libvlc_media_list_unlock( libvlc_media_list_t * );
813 VLC_PUBLIC_API libvlc_media_list_view_t *
814 libvlc_media_list_flat_view( libvlc_media_list_t *,
815 libvlc_exception_t * );
817 VLC_PUBLIC_API libvlc_media_list_view_t *
818 libvlc_media_list_hierarchical_view( libvlc_media_list_t *,
819 libvlc_exception_t * );
821 VLC_PUBLIC_API libvlc_media_list_view_t *
822 libvlc_media_list_hierarchical_node_view( libvlc_media_list_t *,
823 libvlc_exception_t * );
825 VLC_PUBLIC_API libvlc_event_manager_t *
826 libvlc_media_list_event_manager( libvlc_media_list_t *,
827 libvlc_exception_t * );
829 /*****************************************************************************
831 *****************************************************************************/
832 /** defgroup libvlc_media_list_view MediaListView
833 * \ingroup libvlc_media_list
834 * LibVLC Media List View
838 libvlc_media_list_view_retain( libvlc_media_list_view_t * p_mlv );
841 libvlc_media_list_view_release( libvlc_media_list_view_t * p_mlv );
843 VLC_PUBLIC_API libvlc_event_manager_t *
844 libvlc_media_list_view_event_manager( libvlc_media_list_view_t * p_mlv );
847 libvlc_media_list_view_count( libvlc_media_list_view_t * p_mlv,
848 libvlc_exception_t * p_e );
850 VLC_PUBLIC_API libvlc_media_descriptor_t *
851 libvlc_media_list_view_item_at_index( libvlc_media_list_view_t * p_mlv,
853 libvlc_exception_t * p_e );
855 VLC_PUBLIC_API libvlc_media_list_view_t *
856 libvlc_media_list_view_children_at_index( libvlc_media_list_view_t * p_mlv,
858 libvlc_exception_t * p_e );
860 VLC_PUBLIC_API libvlc_media_list_view_t *
861 libvlc_media_list_view_children_for_item( libvlc_media_list_view_t * p_mlv,
862 libvlc_media_descriptor_t * p_md,
863 libvlc_exception_t * p_e );
867 libvlc_media_list_view_index_of_item( libvlc_media_list_view_t * p_mlv,
868 libvlc_media_descriptor_t * p_md,
869 libvlc_exception_t * p_e );
872 libvlc_media_list_view_insert_at_index( libvlc_media_list_view_t * p_mlv,
873 libvlc_media_descriptor_t * p_md,
875 libvlc_exception_t * p_e );
878 libvlc_media_list_view_remove_at_index( libvlc_media_list_view_t * p_mlv,
880 libvlc_exception_t * p_e );
883 libvlc_media_list_view_add_item( libvlc_media_list_view_t * p_mlv,
884 libvlc_media_descriptor_t * p_md,
885 libvlc_exception_t * p_e );
887 VLC_PUBLIC_API libvlc_media_list_t *
888 libvlc_media_list_view_parent_media_list( libvlc_media_list_view_t * p_mlv,
889 libvlc_exception_t * p_e );
891 /** @} media_list_view */
893 /*****************************************************************************
895 *****************************************************************************/
896 /** defgroup libvlc_media_list_player MediaListPlayer
898 * LibVLC Media List Player
901 VLC_PUBLIC_API libvlc_media_list_player_t *
902 libvlc_media_list_player_new( libvlc_instance_t * p_instance,
903 libvlc_exception_t * p_e );
905 libvlc_media_list_player_release( libvlc_media_list_player_t * p_mlp );
908 libvlc_media_list_player_set_media_instance(
909 libvlc_media_list_player_t * p_mlp,
910 libvlc_media_instance_t * p_mi,
911 libvlc_exception_t * p_e );
914 libvlc_media_list_player_set_media_list(
915 libvlc_media_list_player_t * p_mlp,
916 libvlc_media_list_t * p_mlist,
917 libvlc_exception_t * p_e );
920 libvlc_media_list_player_play( libvlc_media_list_player_t * p_mlp,
921 libvlc_exception_t * p_e );
924 libvlc_media_list_player_pause( libvlc_media_list_player_t * p_mlp,
925 libvlc_exception_t * p_e );
928 libvlc_media_list_player_is_playing( libvlc_media_list_player_t * p_mlp,
929 libvlc_exception_t * p_e );
931 VLC_PUBLIC_API libvlc_state_t
932 libvlc_media_list_player_get_state( libvlc_media_list_player_t * p_mlp,
933 libvlc_exception_t * p_e );
936 libvlc_media_list_player_play_item_at_index(
937 libvlc_media_list_player_t * p_mlp,
939 libvlc_exception_t * p_e );
942 libvlc_media_list_player_play_item(
943 libvlc_media_list_player_t * p_mlp,
944 libvlc_media_descriptor_t * p_md,
945 libvlc_exception_t * p_e );
948 libvlc_media_list_player_stop( libvlc_media_list_player_t * p_mlp,
949 libvlc_exception_t * p_e );
951 libvlc_media_list_player_next( libvlc_media_list_player_t * p_mlp,
952 libvlc_exception_t * p_e );
954 /** @} media_list_player*/
958 /*****************************************************************************
960 *****************************************************************************/
961 /** defgroup libvlc_media_library Media Library
963 * LibVLC Media Library
966 VLC_PUBLIC_API libvlc_media_library_t *
967 libvlc_media_library_new( libvlc_instance_t * p_inst,
968 libvlc_exception_t * p_e );
970 libvlc_media_library_release( libvlc_media_library_t * p_mlib );
972 libvlc_media_library_retain( libvlc_media_library_t * p_mlib );
976 libvlc_media_library_load( libvlc_media_library_t * p_mlib,
977 libvlc_exception_t * p_e );
980 libvlc_media_library_save( libvlc_media_library_t * p_mlib,
981 libvlc_exception_t * p_e );
983 VLC_PUBLIC_API libvlc_media_list_t *
984 libvlc_media_library_media_list( libvlc_media_library_t * p_mlib,
985 libvlc_exception_t * p_e );
991 /*****************************************************************************
992 * Services/Media Discovery
993 *****************************************************************************/
994 /** defgroup libvlc_media_discoverer Media Discoverer
996 * LibVLC Media Discoverer
1000 VLC_PUBLIC_API libvlc_media_discoverer_t *
1001 libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
1002 const char * psz_name,
1003 libvlc_exception_t * p_e );
1004 VLC_PUBLIC_API void libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
1005 VLC_PUBLIC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
1007 VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis );
1009 VLC_PUBLIC_API libvlc_event_manager_t *
1010 libvlc_media_discoverer_event_manager( libvlc_media_discoverer_t * p_mdis );
1013 libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis );
1018 /*****************************************************************************
1020 *****************************************************************************/
1021 /** defgroup libvlc_vlm VLM
1028 * Add a broadcast, with one input.
1030 * \param p_instance the instance
1031 * \param psz_name the name of the new broadcast
1032 * \param psz_input the input MRL
1033 * \param psz_output the output MRL (the parameter to the "sout" variable)
1034 * \param i_options number of additional options
1035 * \param ppsz_options additional options
1036 * \param b_enabled boolean for enabling the new broadcast
1037 * \param b_loop Should this broadcast be played in loop ?
1038 * \param p_e an initialized exception pointer
1040 VLC_PUBLIC_API void libvlc_vlm_add_broadcast( libvlc_instance_t *, char *, char *, char* ,
1041 int, char **, int, int, libvlc_exception_t * );
1044 * Delete a media (VOD or broadcast).
1046 * \param p_instance the instance
1047 * \param psz_name the media to delete
1048 * \param p_e an initialized exception pointer
1050 VLC_PUBLIC_API void libvlc_vlm_del_media( libvlc_instance_t *, char *, libvlc_exception_t * );
1053 * Enable or disable a media (VOD or broadcast).
1055 * \param p_instance the instance
1056 * \param psz_name the media to work on
1057 * \param b_enabled the new status
1058 * \param p_e an initialized exception pointer
1060 VLC_PUBLIC_API void libvlc_vlm_set_enabled( libvlc_instance_t *, char *, int,
1061 libvlc_exception_t *);
1064 * Set the output for a media.
1066 * \param p_instance the instance
1067 * \param psz_name the media to work on
1068 * \param psz_output the output MRL (the parameter to the "sout" variable)
1069 * \param p_e an initialized exception pointer
1071 VLC_PUBLIC_API void libvlc_vlm_set_output( libvlc_instance_t *, char *, char*,
1072 libvlc_exception_t *);
1075 * Set a media's input MRL. This will delete all existing inputs and
1076 * 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_e an initialized exception pointer
1083 VLC_PUBLIC_API void libvlc_vlm_set_input( libvlc_instance_t *, char *, char*,
1084 libvlc_exception_t *);
1087 * Add a media's input MRL. This will add the specified one.
1089 * \param p_instance the instance
1090 * \param psz_name the media to work on
1091 * \param psz_input the input MRL
1092 * \param p_e an initialized exception pointer
1094 VLC_PUBLIC_API void libvlc_vlm_add_input( libvlc_instance_t *, char *, char *,
1095 libvlc_exception_t *p_exception );
1097 * Set a media's loop status.
1099 * \param p_instance the instance
1100 * \param psz_name the media to work on
1101 * \param b_loop the new status
1102 * \param p_e an initialized exception pointer
1104 VLC_PUBLIC_API void libvlc_vlm_set_loop( libvlc_instance_t *, char *, int,
1105 libvlc_exception_t *);
1108 * Edit the parameters of a media. This will delete all existing inputs and
1109 * add the specified one.
1111 * \param p_instance the instance
1112 * \param psz_name the name of the new broadcast
1113 * \param psz_input the input MRL
1114 * \param psz_output the output MRL (the parameter to the "sout" variable)
1115 * \param i_options number of additional options
1116 * \param ppsz_options additional options
1117 * \param b_enabled boolean for enabling the new broadcast
1118 * \param b_loop Should this broadcast be played in loop ?
1119 * \param p_e an initialized exception pointer
1121 VLC_PUBLIC_API void libvlc_vlm_change_media( libvlc_instance_t *, char *, char *, char* ,
1122 int, char **, int, int, libvlc_exception_t * );
1125 * Play the named broadcast.
1127 * \param p_instance the instance
1128 * \param psz_name the name of the broadcast
1129 * \param p_e an initialized exception pointer
1131 VLC_PUBLIC_API void libvlc_vlm_play_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
1134 * Stop the named broadcast.
1136 * \param p_instance the instance
1137 * \param psz_name the name of the broadcast
1138 * \param p_e an initialized exception pointer
1140 VLC_PUBLIC_API void libvlc_vlm_stop_media ( libvlc_instance_t *, char *, libvlc_exception_t * );
1143 * Pause the named broadcast.
1145 * \param p_instance the instance
1146 * \param psz_name the name of the broadcast
1147 * \param p_e an initialized exception pointer
1149 VLC_PUBLIC_API void libvlc_vlm_pause_media( libvlc_instance_t *, char *, libvlc_exception_t * );
1152 * Seek in the named broadcast.
1154 * \param p_instance the instance
1155 * \param psz_name the name of the broadcast
1156 * \param f_percentage the percentage to seek to
1157 * \param p_e an initialized exception pointer
1159 VLC_PUBLIC_API void libvlc_vlm_seek_media( libvlc_instance_t *, char *,
1160 float, libvlc_exception_t * );
1163 * Return information about the named broadcast.
1165 * \param p_instance the instance
1166 * \param psz_name the name of the broadcast
1167 * \param p_e an initialized exception pointer
1169 VLC_PUBLIC_API char* libvlc_vlm_show_media( libvlc_instance_t *, char *, libvlc_exception_t * );
1171 #define LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( attr, returnType, getType, default)\
1172 returnType libvlc_vlm_get_media_## attr( libvlc_instance_t *, \
1173 char *, int , libvlc_exception_t * );
1175 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( position, float, Float, -1);
1176 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( time, int, Integer, -1);
1177 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( length, int, Integer, -1);
1178 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( rate, int, Integer, -1);
1179 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( title, int, Integer, 0);
1180 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( chapter, int, Integer, 0);
1181 VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( seekable, int, Bool, 0);
1183 #undef LIBVLC_VLM_GET_MEDIA_ATTRIBUTE
1187 /*****************************************************************************
1188 * Message log handling
1189 *****************************************************************************/
1191 /** defgroup libvlc_log Log
1193 * LibVLC Message Logging
1198 * Return the VLC messaging verbosity level.
1200 * \param p_instance libvlc instance
1201 * \param exception an initialized exception pointer
1203 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
1204 libvlc_exception_t *p_e );
1207 * Set the VLC messaging verbosity level.
1209 * \param p_log libvlc log instance
1210 * \param exception an initialized exception pointer
1212 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
1213 libvlc_exception_t *p_e );
1216 * Open a VLC message log instance.
1218 * \param p_instance libvlc instance
1219 * \param exception an initialized exception pointer
1221 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( libvlc_instance_t *, libvlc_exception_t *);
1224 * Close a VLC message log instance.
1226 * \param p_log libvlc log instance
1227 * \param exception an initialized exception pointer
1229 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
1232 * Returns the number of messages in a log instance.
1234 * \param p_log libvlc log instance
1235 * \param exception an initialized exception pointer
1237 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
1240 * Clear a log instance.
1242 * All messages in the log are removed. The log should be cleared on a
1243 * regular basis to avoid clogging.
1245 * \param p_log libvlc log instance
1246 * \param exception an initialized exception pointer
1248 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
1251 * Allocate and returns a new iterator to messages in log.
1253 * \param p_log libvlc log instance
1254 * \param exception an initialized exception pointer
1256 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
1259 * Release a previoulsy allocated iterator.
1261 * \param p_log libvlc log iterator
1262 * \param exception an initialized exception pointer
1264 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1267 * Return whether log iterator has more messages.
1269 * \param p_log libvlc log iterator
1270 * \param exception an initialized exception pointer
1272 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1275 * Return the next log message.
1277 * The message contents must not be freed
1279 * \param p_log libvlc log iterator
1280 * \param exception an initialized exception pointer
1282 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
1283 struct libvlc_log_message_t *buffer,
1284 libvlc_exception_t *p_e );
1288 /*****************************************************************************
1289 * Playlist (Deprecated)
1290 *****************************************************************************/
1291 /** defgroup libvlc_playlist Playlist
1293 * LibVLC Playlist handling
1298 * Set the playlist's loop attribute. If set, the playlist runs continuously
1299 * and wraps around when it reaches the end.
1301 * \param p_instance the playlist instance
1302 * \param loop the loop attribute. 1 sets looping, 0 disables it
1303 * \param p_e an initialized exception pointer
1305 VLC_DEPRECATED_API void libvlc_playlist_loop( libvlc_instance_t* , int,
1306 libvlc_exception_t * );
1311 * Additionnal playlist item options can be specified for addition to the
1312 * item before it is played.
1314 * \param p_instance the playlist instance
1315 * \param i_id the item to play. If this is a negative number, the next
1316 * item will be selected. Otherwise, the item with the given ID will be
1318 * \param i_options the number of options to add to the item
1319 * \param ppsz_options the options to add to the item
1320 * \param p_e an initialized exception pointer
1322 VLC_DEPRECATED_API void libvlc_playlist_play( libvlc_instance_t*, int, int,
1323 char **, libvlc_exception_t * );
1326 * Toggle the playlist's pause status.
1328 * If the playlist was running, it is paused. If it was paused, it is resumed.
1330 * \param p_instance the playlist instance to pause
1331 * \param p_e an initialized exception pointer
1333 VLC_DEPRECATED_API void libvlc_playlist_pause( libvlc_instance_t *,
1334 libvlc_exception_t * );
1337 * Checks whether the playlist is running
1339 * \param p_instance the playlist instance
1340 * \param p_e an initialized exception pointer
1341 * \return 0 if the playlist is stopped or paused, 1 if it is running
1343 VLC_DEPRECATED_API int libvlc_playlist_isplaying( libvlc_instance_t *,
1344 libvlc_exception_t * );
1347 * Get the number of items in the playlist
1349 * \param p_instance the playlist instance
1350 * \param p_e an initialized exception pointer
1351 * \return the number of items
1353 VLC_DEPRECATED_API int libvlc_playlist_items_count( libvlc_instance_t *,
1354 libvlc_exception_t * );
1357 * Lock the playlist.
1359 * \param p_instance the playlist instance
1361 VLC_DEPRECATED_API void libvlc_playlist_lock( libvlc_instance_t * );
1364 * Unlock the playlist.
1366 * \param p_instance the playlist instance
1368 VLC_DEPRECATED_API void libvlc_playlist_unlock( libvlc_instance_t * );
1373 * \param p_instance the playlist instance to stop
1374 * \param p_e an initialized exception pointer
1376 VLC_DEPRECATED_API void libvlc_playlist_stop( libvlc_instance_t *,
1377 libvlc_exception_t * );
1380 * Go to the next playlist item. If the playlist was stopped, playback
1383 * \param p_instance the playlist instance
1384 * \param p_e an initialized exception pointer
1386 VLC_DEPRECATED_API void libvlc_playlist_next( libvlc_instance_t *,
1387 libvlc_exception_t * );
1390 * Go to the previous playlist item. If the playlist was stopped, playback
1393 * \param p_instance the playlist instance
1394 * \param p_e an initialized exception pointer
1396 VLC_DEPRECATED_API void libvlc_playlist_prev( libvlc_instance_t *,
1397 libvlc_exception_t * );
1400 * Empty a playlist. All items in the playlist are removed.
1402 * \param p_instance the playlist instance
1403 * \param p_e an initialized exception pointer
1405 VLC_DEPRECATED_API void libvlc_playlist_clear( libvlc_instance_t *,
1406 libvlc_exception_t * );
1409 * Append an item to the playlist. The item is added at the end. If more
1410 * advanced options are required, \see libvlc_playlist_add_extended instead.
1412 * \param p_instance the playlist instance
1413 * \param psz_uri the URI to open, using VLC format
1414 * \param psz_name a name that you might want to give or NULL
1415 * \param p_e an initialized exception pointer
1416 * \return the identifier of the new item
1418 VLC_DEPRECATED_API int libvlc_playlist_add( libvlc_instance_t *, const char *,
1419 const char *, libvlc_exception_t * );
1422 * Append an item to the playlist. The item is added at the end, with
1423 * additional input options.
1425 * \param p_instance the playlist instance
1426 * \param psz_uri the URI to open, using VLC format
1427 * \param psz_name a name that you might want to give or NULL
1428 * \param i_options the number of options to add
1429 * \param ppsz_options strings representing the options to add
1430 * \param p_e an initialized exception pointer
1431 * \return the identifier of the new item
1433 VLC_DEPRECATED_API int libvlc_playlist_add_extended( libvlc_instance_t *, const char *,
1434 const char *, int, const char **,
1435 libvlc_exception_t * );
1438 * Delete the playlist item with the given ID.
1440 * \param p_instance the playlist instance
1441 * \param i_id the id to remove
1442 * \param p_e an initialized exception pointer
1443 * \return 0 in case of success, a non-zero value otherwise
1445 VLC_DEPRECATED_API int libvlc_playlist_delete_item( libvlc_instance_t *, int,
1446 libvlc_exception_t * );
1448 /** Get the input that is currently being played by the playlist.
1450 * \param p_instance the playlist instance to use
1451 * \param p_e an initialized exception pointern
1452 * \return a media instance object
1454 VLC_DEPRECATED_API libvlc_media_instance_t * libvlc_playlist_get_media_instance(
1455 libvlc_instance_t *, libvlc_exception_t * );
1463 #endif /* <vlc/libvlc.h> */