1 /*****************************************************************************
2 * libvlc.h: libvlc 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>
9 * Pierre d'Herbemont <pdherbemont@videolan.org>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24 *****************************************************************************/
27 * \defgroup libvlc libvlc
28 * This is libvlc, the base library of the VLC program.
35 #define VLC_LIBVLC_H 1
37 #if defined (WIN32) && defined (DLL_EXPORT)
38 # define VLC_PUBLIC_API __declspec(dllexport)
40 # define VLC_PUBLIC_API
44 /* Avoid unuseful warnings from libvlc with our deprecated APIs */
45 # define VLC_DEPRECATED_API VLC_PUBLIC_API
46 #elif defined(__GNUC__) && \
47 (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
48 # define VLC_DEPRECATED_API VLC_PUBLIC_API __attribute__((deprecated))
50 # define VLC_DEPRECATED_API VLC_PUBLIC_API
57 /*****************************************************************************
59 *****************************************************************************/
60 /** \defgroup libvlc_exception libvlc_exception
61 * \ingroup libvlc_core
62 * LibVLC Exceptions handling
67 * Initialize an exception structure. This can be called several times to
68 * reuse an exception structure.
70 * \param p_exception the exception to initialize
72 VLC_PUBLIC_API void libvlc_exception_init( libvlc_exception_t *p_exception );
75 * Has an exception been raised?
77 * \param p_exception the exception to query
78 * \return 0 if the exception was raised, 1 otherwise
81 libvlc_exception_raised( const libvlc_exception_t *p_exception );
84 * Raise an exception using a user-provided message.
86 * \param p_exception the exception to raise
87 * \param psz_format the exception message format string
88 * \param ... the format string arguments
91 libvlc_exception_raise( libvlc_exception_t *p_exception,
92 const char *psz_format, ... );
95 * Clear an exception object so it can be reused.
96 * The exception object must have be initialized.
98 * \param p_exception the exception to clear
100 VLC_PUBLIC_API void libvlc_exception_clear( libvlc_exception_t * );
103 * Get an exception's message.
105 * \param p_exception the exception to query
106 * \return the exception message or NULL if not applicable (exception not
107 * raised, for example)
109 VLC_PUBLIC_API const char *
110 libvlc_exception_get_message( const libvlc_exception_t *p_exception );
114 /*****************************************************************************
116 *****************************************************************************/
118 /** \defgroup libvlc_core libvlc_core
125 * Create and initialize a libvlc instance.
127 * \param argc the number of arguments
128 * \param argv command-line-type arguments. argv[0] must be the path of the
130 * \param p_e an initialized exception pointer
131 * \return the libvlc instance
133 VLC_PUBLIC_API libvlc_instance_t *
134 libvlc_new( int , const char *const *, libvlc_exception_t *);
137 * Return a libvlc instance identifier for legacy APIs. Use of this
138 * function is discouraged, you should convert your program to use the
141 * \param p_instance the instance
142 * \return the instance identifier
144 VLC_PUBLIC_API int libvlc_get_vlc_id( libvlc_instance_t *p_instance );
147 * Decrement the reference count of a libvlc instance, and destroy it
148 * if it reaches zero.
150 * \param p_instance the instance to destroy
152 VLC_PUBLIC_API void libvlc_release( libvlc_instance_t * );
155 * Increments the reference count of a libvlc instance.
156 * The initial reference count is 1 after libvlc_new() returns.
158 * \param p_instance the instance to reference
160 VLC_PUBLIC_API void libvlc_retain( libvlc_instance_t * );
163 * Try to start a user interface for the libvlc instance, and wait until the
166 * \param p_instance the instance
167 * \param name interface name, or NULL for default
168 * \param p_exception an initialized exception pointer
171 void libvlc_add_intf( libvlc_instance_t *p_instance, const char *name,
172 libvlc_exception_t *p_exception );
175 * Waits until an interface causes the instance to exit.
176 * You should start at least one interface first, using libvlc_add_intf().
178 * \param p_instance the instance
181 void libvlc_wait( libvlc_instance_t *p_instance );
184 * Retrieve libvlc version.
186 * Example: "0.9.0-git Grishenko"
188 * \return a string containing the libvlc version
190 VLC_PUBLIC_API const char * libvlc_get_version(void);
193 * Retrieve libvlc compiler version.
195 * Example: "gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu6)"
197 * \return a string containing the libvlc compiler version
199 VLC_PUBLIC_API const char * libvlc_get_compiler(void);
202 * Retrieve libvlc changeset.
204 * Example: "aa9bce0bc4"
206 * \return a string containing the libvlc changeset
208 VLC_PUBLIC_API const char * libvlc_get_changeset(void);
212 /*****************************************************************************
214 *****************************************************************************/
215 /** \defgroup libvlc_media libvlc_media
222 * Create a media with the given MRL.
224 * \param p_instance the instance
225 * \param psz_mrl the MRL to read
226 * \param p_e an initialized exception pointer
227 * \return the newly created media
229 VLC_PUBLIC_API libvlc_media_t * libvlc_media_new(
230 libvlc_instance_t *p_instance,
231 const char * psz_mrl,
232 libvlc_exception_t *p_e );
235 * Create a media as an empty node with the passed name.
237 * \param p_instance the instance
238 * \param psz_name the name of the node
239 * \param p_e an initialized exception pointer
240 * \return the new empty media
242 VLC_PUBLIC_API libvlc_media_t * libvlc_media_new_as_node(
243 libvlc_instance_t *p_instance,
244 const char * psz_name,
245 libvlc_exception_t *p_e );
248 * Add an option to the media.
250 * This option will be used to determine how the media_player will
251 * read the media. This allows to use VLC's advanced
252 * reading/streaming options on a per-media basis.
254 * The options are detailed in vlc --long-help, for instance "--sout-all"
256 * \param p_instance the instance
257 * \param ppsz_options the options (as a string)
258 * \param p_e an initialized exception pointer
260 VLC_PUBLIC_API void libvlc_media_add_option(
261 libvlc_media_t * p_md,
262 const char * ppsz_options,
263 libvlc_exception_t * p_e );
266 * Retain a reference to a media descriptor object (libvlc_media_t). Use
267 * libvlc_media_release() to decrement the reference count of a
268 * media descriptor object.
270 * \param p_meta_desc a media descriptor object.
272 VLC_PUBLIC_API void libvlc_media_retain(
273 libvlc_media_t *p_meta_desc );
276 * Decrement the reference count of a media descriptor object. If the
277 * reference count is 0, then libvlc_media_release() will release the
278 * media descriptor object. It will send out an libvlc_MediaFreed event
279 * to all listeners. If the media descriptor object has been released it
280 * should not be used again.
282 * \param p_meta_desc a media descriptor object.
284 VLC_PUBLIC_API void libvlc_media_release(
285 libvlc_media_t *p_meta_desc );
289 * Get the media resource locator (mrl) from a media descriptor object
291 * \param p_md a media descriptor object
292 * \param p_e an initialized exception object
293 * \return string with mrl of media descriptor object
295 VLC_PUBLIC_API char * libvlc_media_get_mrl( libvlc_media_t * p_md,
296 libvlc_exception_t * p_e );
299 * Duplicate a media descriptor object.
301 * \param p_meta_desc a media descriptor object.
303 VLC_PUBLIC_API libvlc_media_t * libvlc_media_duplicate( libvlc_media_t * );
306 * Read the meta of the media.
308 * \param p_meta_desc the media to read
309 * \param e_meta_desc the meta to read
310 * \param p_e an initialized exception pointer
311 * \return the media's meta
313 VLC_PUBLIC_API char * libvlc_media_get_meta(
314 libvlc_media_t *p_meta_desc,
315 libvlc_meta_t e_meta,
316 libvlc_exception_t *p_e );
318 * Get current state of media descriptor object. Possible media states
319 * are defined in libvlc_structures.c ( libvlc_NothingSpecial=0,
320 * libvlc_Opening, libvlc_Buffering, libvlc_Playing, libvlc_Paused,
321 * libvlc_Stopped, libvlc_Forward, libvlc_Backward, libvlc_Ended,
324 * @see libvlc_state_t
325 * \param p_meta_desc a media descriptor object
326 * \param p_e an initialized exception object
327 * \return state of media descriptor object
329 VLC_PUBLIC_API libvlc_state_t libvlc_media_get_state(
330 libvlc_media_t *p_meta_desc,
331 libvlc_exception_t *p_e );
334 * Get subitems of media descriptor object. This will increment
335 * the reference count of supplied media descriptor object. Use
336 * libvlc_media_list_release() to decrement the reference counting.
338 * \param p_md media descriptor object
339 * \param p_e initalized exception object
340 * \return list of media descriptor subitems or NULL
342 VLC_PUBLIC_API libvlc_media_list_t *
343 libvlc_media_subitems( libvlc_media_t *p_md,
344 libvlc_exception_t *p_e );
346 * Get event manager from media descriptor object.
347 * NOTE: this function doesn't increment reference counting.
349 * \param p_md a media descriptor object
350 * \param p_e an initialized exception object
351 * \return event manager object
353 VLC_PUBLIC_API libvlc_event_manager_t *
354 libvlc_media_event_manager( libvlc_media_t * p_md,
355 libvlc_exception_t * p_e );
358 * Get duration of media descriptor object item.
360 * \param p_md media descriptor object
361 * \param p_e an initialized exception object
362 * \return duration of media item
364 VLC_PUBLIC_API libvlc_time_t
365 libvlc_media_get_duration( libvlc_media_t * p_md,
366 libvlc_exception_t * p_e );
369 * Get preparsed status for media descriptor object.
371 * \param p_md media descriptor object
372 * \param p_e an initialized exception object
373 * \return true if media object has been preparsed otherwise it returns false
376 libvlc_media_is_preparsed( libvlc_media_t * p_md,
377 libvlc_exception_t * p_e );
380 * Sets media descriptor's user_data. user_data is specialized data
381 * accessed by the host application, VLC.framework uses it as a pointer to
382 * an native object that references a libvlc_media_t pointer
384 * \param p_md media descriptor object
385 * \param p_new_user_data pointer to user data
386 * \param p_e an initialized exception object
389 libvlc_media_set_user_data( libvlc_media_t * p_md,
390 void * p_new_user_data,
391 libvlc_exception_t * p_e);
394 * Get media descriptor's user_data. user_data is specialized data
395 * accessed by the host application, VLC.framework uses it as a pointer to
396 * an native object that references a libvlc_media_t pointer
398 * \param p_md media descriptor object
399 * \param p_e an initialized exception object
401 VLC_PUBLIC_API void *
402 libvlc_media_get_user_data( libvlc_media_t * p_md,
403 libvlc_exception_t * p_e);
407 /*****************************************************************************
409 *****************************************************************************/
410 /** \defgroup libvlc_media_player libvlc_media_player
412 * LibVLC Media Player, object that let you play a media
413 * in a libvlc_drawable_t
418 * Create an empty Media Player object
420 * \param p_libvlc_instance the libvlc instance in which the Media Player
422 * \param p_e an initialized exception pointer
424 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t *, libvlc_exception_t * );
427 * Create a Media Player object from a Media
429 * \param p_md the media. Afterwards the p_md can be safely
431 * \param p_e an initialized exception pointer
433 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new_from_media( libvlc_media_t *, libvlc_exception_t * );
436 * Release a media_player after use
437 * Decrement the reference count of a media player object. If the
438 * reference count is 0, then libvlc_media_player_release() will
439 * release the media player object. If the media player object
440 * has been released, then it should not be used again.
442 * \param p_mi the Media Player to free
444 VLC_PUBLIC_API void libvlc_media_player_release( libvlc_media_player_t * );
447 * Retain a reference to a media player object. Use
448 * libvlc_media_player_release() to decrement reference count.
450 * \param p_mi media player object
452 VLC_PUBLIC_API void libvlc_media_player_retain( libvlc_media_player_t * );
455 * Set the media that will be used by the media_player. If any,
456 * previous md will be released.
458 * \param p_mi the Media Player
459 * \param p_md the Media. Afterwards the p_md can be safely
461 * \param p_e an initialized exception pointer
463 VLC_PUBLIC_API void libvlc_media_player_set_media( libvlc_media_player_t *, libvlc_media_t *, libvlc_exception_t * );
466 * Get the media used by the media_player.
468 * \param p_mi the Media Player
469 * \param p_e an initialized exception pointer
470 * \return the media associated with p_mi, or NULL if no
471 * media is associated
473 VLC_PUBLIC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t *, libvlc_exception_t * );
476 * Get the Event Manager from which the media player send event.
478 * \param p_mi the Media Player
479 * \param p_e an initialized exception pointer
480 * \return the event manager associated with p_mi
482 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *, libvlc_exception_t * );
487 * \param p_mi the Media Player
488 * \param p_e an initialized exception pointer
490 VLC_PUBLIC_API void libvlc_media_player_play ( libvlc_media_player_t *, libvlc_exception_t * );
495 * \param p_mi the Media Player
496 * \param p_e an initialized exception pointer
498 VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *, libvlc_exception_t * );
503 * \param p_mi the Media Player
504 * \param p_e an initialized exception pointer
506 VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *, libvlc_exception_t * );
509 * Set the drawable where the media player should render its video output
511 * \param p_mi the Media Player
512 * \param drawable the libvlc_drawable_t where the media player
513 * should render its video
514 * \param p_e an initialized exception pointer
516 VLC_PUBLIC_API void libvlc_media_player_set_drawable ( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
519 * Get the drawable where the media player should render its video output
521 * \param p_mi the Media Player
522 * \param p_e an initialized exception pointer
523 * \return the libvlc_drawable_t where the media player
524 * should render its video
526 VLC_PUBLIC_API libvlc_drawable_t
527 libvlc_media_player_get_drawable ( libvlc_media_player_t *, libvlc_exception_t * );
529 /** \bug This might go away ... to be replaced by a broader system */
531 * Get the current movie length (in ms).
533 * \param p_mi the Media Player
534 * \param p_e an initialized exception pointer
535 * \return the movie length (in ms).
537 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_length ( libvlc_media_player_t *, libvlc_exception_t *);
539 * Get the current movie time (in ms).
541 * \param p_mi the Media Player
542 * \param p_e an initialized exception pointer
543 * \return the movie time (in ms).
545 VLC_PUBLIC_API libvlc_time_t libvlc_media_player_get_time ( libvlc_media_player_t *, libvlc_exception_t *);
547 * Set the movie time (in ms).
549 * \param p_mi the Media Player
550 * \param the movie time (in ms).
551 * \param p_e an initialized exception pointer
553 VLC_PUBLIC_API void libvlc_media_player_set_time ( libvlc_media_player_t *, libvlc_time_t, libvlc_exception_t *);
554 VLC_PUBLIC_API float libvlc_media_player_get_position ( libvlc_media_player_t *, libvlc_exception_t *);
555 VLC_PUBLIC_API void libvlc_media_player_set_position ( libvlc_media_player_t *, float, libvlc_exception_t *);
556 VLC_PUBLIC_API void libvlc_media_player_set_chapter ( libvlc_media_player_t *, int, libvlc_exception_t *);
557 VLC_PUBLIC_API int libvlc_media_player_get_chapter (libvlc_media_player_t *, libvlc_exception_t *);
558 VLC_PUBLIC_API int libvlc_media_player_get_chapter_count( libvlc_media_player_t *, libvlc_exception_t *);
559 VLC_PUBLIC_API int libvlc_media_player_will_play ( libvlc_media_player_t *, libvlc_exception_t *);
560 VLC_PUBLIC_API float libvlc_media_player_get_rate ( libvlc_media_player_t *, libvlc_exception_t *);
561 VLC_PUBLIC_API void libvlc_media_player_set_rate ( libvlc_media_player_t *, float, libvlc_exception_t *);
562 VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state ( libvlc_media_player_t *, libvlc_exception_t *);
563 VLC_PUBLIC_API float libvlc_media_player_get_fps( libvlc_media_player_t *, libvlc_exception_t *);
567 * Does this media player have a video output?
569 * \param p_md the media player
570 * \param p_e an initialized exception pointer
572 VLC_PUBLIC_API int libvlc_media_player_has_vout( libvlc_media_player_t *, libvlc_exception_t *);
575 * Is this media player seekable?
577 * \param p_input the input
578 * \param p_e an initialized exception pointer
580 VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
583 * Can this media player be paused?
585 * \param p_input the input
586 * \param p_e an initialized exception pointer
588 VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
590 /** \defgroup libvlc_video libvlc_video
591 * \ingroup libvlc_media_player
592 * LibVLC Video handling
597 * Toggle fullscreen status on video output.
599 * \param p_mediaplayer the media player
600 * \param p_e an initialized exception pointer
602 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
605 * Enable or disable fullscreen on a video output.
607 * \param p_mediaplayer the media player
608 * \param b_fullscreen boolean for fullscreen status
609 * \param p_e an initialized exception pointer
611 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *, int, libvlc_exception_t * );
614 * Get current fullscreen status.
616 * \param p_mediaplayer the media player
617 * \param p_e an initialized exception pointer
618 * \return the fullscreen status (boolean)
620 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
623 * Get current video height.
625 * \param p_mediaplayer the media player
626 * \param p_e an initialized exception pointer
627 * \return the video height
629 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_player_t *, libvlc_exception_t * );
632 * Get current video width.
634 * \param p_mediaplayer the media player
635 * \param p_e an initialized exception pointer
636 * \return the video width
638 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_player_t *, libvlc_exception_t * );
641 * Get current video aspect ratio.
643 * \param p_mediaplayer the media player
644 * \param p_e an initialized exception pointer
645 * \return the video aspect ratio
647 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *, libvlc_exception_t * );
650 * Set new video aspect ratio.
652 * \param p_mediaplayer the media player
653 * \param psz_aspect new video aspect-ratio
654 * \param p_e an initialized exception pointer
656 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *, char *, libvlc_exception_t * );
659 * Get current video subtitle.
661 * \param p_mediaplayer the media player
662 * \param p_e an initialized exception pointer
663 * \return the video subtitle selected
665 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *, libvlc_exception_t * );
668 * Set new video subtitle.
670 * \param p_mediaplayer the media player
671 * \param i_spu new video subtitle to select
672 * \param p_e an initialized exception pointer
674 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_player_t *, int , libvlc_exception_t * );
677 * Set new video subtitle file.
679 * \param p_mediaplayer the media player
680 * \param psz_subtitle new video subtitle file
681 * \param p_e an initialized exception pointer
682 * \return the success status (boolean)
684 VLC_PUBLIC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *, char *, libvlc_exception_t * );
687 * Get current crop filter geometry.
689 * \param p_mediaplayer the media player
690 * \param p_e an initialized exception pointer
691 * \return the crop filter geometry
693 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *, libvlc_exception_t * );
696 * Set new crop filter geometry.
698 * \param p_mediaplayer the media player
699 * \param psz_geometry new crop filter geometry
700 * \param p_e an initialized exception pointer
702 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_player_t *, char *, libvlc_exception_t * );
705 * Toggle teletext transparent status on video output.
707 * \param p_mediaplayer the media player
708 * \param p_e an initialized exception pointer
710 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *, libvlc_exception_t * );
713 * Get current teletext page requested.
715 * \param p_mediaplayer the media player
716 * \param p_e an initialized exception pointer
717 * \return the current teletext page requested.
719 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t *, libvlc_exception_t * );
722 * Set new teletext page to retrieve.
724 * \param p_mediaplayer the media player
725 * \param i_page teletex page number requested
726 * \param p_e an initialized exception pointer
728 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *, int, libvlc_exception_t * );
731 * Take a snapshot of the current video window.
733 * If i_width AND i_height is 0, original size is used.
734 * If i_width XOR i_height is 0, original aspect-ratio is preserved.
736 * \param p_mediaplayer the media player
737 * \param psz_filepath the path where to save the screenshot to
738 * \param i_width the snapshot's width
739 * \param i_height the snapshot's height
740 * \param p_e an initialized exception pointer
742 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_player_t *, char *,unsigned int, unsigned int, libvlc_exception_t * );
745 * Resize the current video output window.
747 * \param p_instance libvlc instance
748 * \param width new width for video output window
749 * \param height new height for video output window
750 * \param p_e an initialized exception pointer
751 * \return the success status (boolean)
753 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_player_t *, int, int, libvlc_exception_t *);
756 * Change the parent for the current the video output.
758 * \param p_instance libvlc instance
759 * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
760 * \param p_e an initialized exception pointer
761 * \return the success status (boolean)
763 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
766 * Tell windowless video output to redraw rectangular area (MacOS X only).
768 * \param p_instance libvlc instance
769 * \param area coordinates within video drawable
770 * \param p_e an initialized exception pointer
772 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_player_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
775 * Set the default video output size.
777 * This setting will be used as default for all video outputs.
779 * \param p_instance libvlc instance
780 * \param width new width for video drawable
781 * \param height new height for video drawable
782 * \param p_e an initialized exception pointer
784 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
787 * Set the default video output viewport for a windowless video output
790 * This setting will be used as default for all video outputs.
792 * \param p_instance libvlc instance
793 * \param view coordinates within video drawable
794 * \param clip coordinates within video drawable
795 * \param p_e an initialized exception pointer
797 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
801 /** \defgroup libvlc_audio libvlc_audio
802 * \ingroup libvlc_media_player
803 * LibVLC Audio handling
808 * Toggle mute status.
810 * \param p_instance libvlc instance
811 * \param p_e an initialized exception pointer
813 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
816 * Get current mute status.
818 * \param p_instance libvlc instance
819 * \param p_e an initialized exception pointer
820 * \return the mute status (boolean)
822 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
827 * \param p_instance libvlc instance
828 * \param status If status is true then mute, otherwise unmute
829 * \param p_e an initialized exception pointer
831 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, int , libvlc_exception_t * );
834 * Get current audio level.
836 * \param p_instance libvlc instance
837 * \param p_e an initialized exception pointer
838 * \return the audio level (int)
840 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
843 * Set current audio level.
845 * \param p_instance libvlc instance
846 * \param i_volume the volume (int)
847 * \param p_e an initialized exception pointer
849 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
852 * Get number of available audio tracks.
854 * \param p_mi media player
855 * \param p_e an initialized exception
856 * \return the number of available audio tracks (int)
858 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *, libvlc_exception_t * );
861 * Get current audio track.
863 * \param p_mi media player
864 * \param p_e an initialized exception pointer
865 * \return the audio track (int)
867 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *, libvlc_exception_t * );
870 * Set current audio track.
872 * \param p_mi media player
873 * \param i_track the track (int)
874 * \param p_e an initialized exception pointer
876 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_player_t *, int, libvlc_exception_t * );
879 * Get current audio channel.
881 * \param p_instance vlc instance
882 * \param p_e an initialized exception pointer
883 * \return the audio channel (int)
885 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
888 * Set current audio channel.
890 * \param p_instance vlc instance
891 * \param i_channel the audio channel (int)
892 * \param p_e an initialized exception pointer
894 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
898 /** @} media_player */
900 /*****************************************************************************
902 *****************************************************************************/
904 /** \defgroup libvlc_event libvlc_event
905 * \ingroup libvlc_core
911 * Register for an event notification.
913 * \param p_event_manager the event manager to which you want to attach to.
914 * Generally it is obtained by vlc_my_object_event_manager() where
915 * my_object is the object you want to listen to.
916 * \param i_event_type the desired event to which we want to listen
917 * \param f_callback the function to call when i_event_type occurs
918 * \param user_data user provided data to carry with the event
919 * \param p_e an initialized exception pointer
921 VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
922 libvlc_event_type_t i_event_type,
923 libvlc_callback_t f_callback,
925 libvlc_exception_t *p_e );
928 * Unregister an event notification.
930 * \param p_event_manager the event manager
931 * \param i_event_type the desired event to which we want to unregister
932 * \param f_callback the function to call when i_event_type occurs
933 * \param p_user_data user provided data to carry with the event
934 * \param p_e an initialized exception pointer
936 VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
937 libvlc_event_type_t i_event_type,
938 libvlc_callback_t f_callback,
940 libvlc_exception_t *p_e );
943 * Get an event's type name.
945 * \param i_event_type the desired event
947 VLC_PUBLIC_API const char * libvlc_event_type_name( libvlc_event_type_t event_type );
951 /*****************************************************************************
953 *****************************************************************************/
954 /** \defgroup libvlc_media_library libvlc_media_library
956 * LibVLC Media Library
959 VLC_PUBLIC_API libvlc_media_library_t *
960 libvlc_media_library_new( libvlc_instance_t * p_inst,
961 libvlc_exception_t * p_e );
964 * Release media library object. This functions decrements the
965 * reference count of the media library object. If it reaches 0,
966 * then the object will be released.
968 * \param p_mlib media library object
971 libvlc_media_library_release( libvlc_media_library_t * p_mlib );
974 * Retain a reference to a media library object. This function will
975 * increment the reference counting for this object. Use
976 * libvlc_media_library_release() to decrement the reference count.
978 * \param p_mlib media library object
981 libvlc_media_library_retain( libvlc_media_library_t * p_mlib );
984 * Load media library.
986 * \param p_mlib media library object
987 * \param p_e an initialized exception object.
990 libvlc_media_library_load( libvlc_media_library_t * p_mlib,
991 libvlc_exception_t * p_e );
994 * Save media library.
996 * \param p_mlib media library object
997 * \param p_e an initialized exception object.
1000 libvlc_media_library_save( libvlc_media_library_t * p_mlib,
1001 libvlc_exception_t * p_e );
1004 * Get media library subitems.
1006 * \param p_mlib media library object
1007 * \param p_e an initialized exception object.
1008 * \return media list subitems
1010 VLC_PUBLIC_API libvlc_media_list_t *
1011 libvlc_media_library_media_list( libvlc_media_library_t * p_mlib,
1012 libvlc_exception_t * p_e );
1018 /*****************************************************************************
1019 * Services/Media Discovery
1020 *****************************************************************************/
1021 /** \defgroup libvlc_media_discoverer libvlc_media_discoverer
1023 * LibVLC Media Discoverer
1028 * Discover media service by name.
1030 * \param p_inst libvlc instance
1031 * \param psz_name service name
1032 * \param p_e an initialized exception object
1033 * \return media discover object
1035 VLC_PUBLIC_API libvlc_media_discoverer_t *
1036 libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
1037 const char * psz_name,
1038 libvlc_exception_t * p_e );
1041 * Release media discover object. If the reference count reaches 0, then
1042 * the object will be released.
1044 * \param p_mdis media service discover object
1046 VLC_PUBLIC_API void libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
1049 * Get media service discover object its localized name.
1051 * \param media discover object
1052 * \return localized name
1054 VLC_PUBLIC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
1057 * Get media service discover media list.
1059 * \param p_mdis media service discover object
1060 * \return list of media items
1062 VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis );
1065 * Get event manager from media service discover object.
1067 * \param p_mdis media service discover object
1068 * \return event manager object.
1070 VLC_PUBLIC_API libvlc_event_manager_t *
1071 libvlc_media_discoverer_event_manager( libvlc_media_discoverer_t * p_mdis );
1074 * Query if media service discover object is running.
1076 * \param p_mdis media service discover object
1077 * \return true if running, false if not
1080 libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis );
1085 /*****************************************************************************
1086 * Message log handling
1087 *****************************************************************************/
1089 /** \defgroup libvlc_log libvlc_log
1090 * \ingroup libvlc_core
1091 * LibVLC Message Logging
1096 * Return the VLC messaging verbosity level.
1098 * \param p_instance libvlc instance
1099 * \param p_e an initialized exception pointer
1100 * \return verbosity level for messages
1102 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
1103 libvlc_exception_t *p_e );
1106 * Set the VLC messaging verbosity level.
1108 * \param p_instance libvlc log instance
1109 * \param level log level
1110 * \param p_e an initialized exception pointer
1112 VLC_PUBLIC_API void libvlc_set_log_verbosity( libvlc_instance_t *p_instance, unsigned level,
1113 libvlc_exception_t *p_e );
1116 * Open a VLC message log instance.
1118 * \param p_instance libvlc instance
1119 * \param p_e an initialized exception pointer
1120 * \return log message instance
1122 VLC_PUBLIC_API libvlc_log_t *libvlc_log_open( libvlc_instance_t *, libvlc_exception_t *);
1125 * Close a VLC message log instance.
1127 * \param p_log libvlc log instance
1128 * \param p_e an initialized exception pointer
1130 VLC_PUBLIC_API void libvlc_log_close( libvlc_log_t *, libvlc_exception_t *);
1133 * Returns the number of messages in a log instance.
1135 * \param p_log libvlc log instance
1136 * \param p_e an initialized exception pointer
1137 * \return number of log messages
1139 VLC_PUBLIC_API unsigned libvlc_log_count( const libvlc_log_t *, libvlc_exception_t *);
1142 * Clear a log instance.
1144 * All messages in the log are removed. The log should be cleared on a
1145 * regular basis to avoid clogging.
1147 * \param p_log libvlc log instance
1148 * \param p_e an initialized exception pointer
1150 VLC_PUBLIC_API void libvlc_log_clear( libvlc_log_t *, libvlc_exception_t *);
1153 * Allocate and returns a new iterator to messages in log.
1155 * \param p_log libvlc log instance
1156 * \param p_e an initialized exception pointer
1157 * \return log iterator object
1159 VLC_PUBLIC_API libvlc_log_iterator_t *libvlc_log_get_iterator( const libvlc_log_t *, libvlc_exception_t *);
1162 * Release a previoulsy allocated iterator.
1164 * \param p_iter libvlc log iterator
1165 * \param p_e an initialized exception pointer
1167 VLC_PUBLIC_API void libvlc_log_iterator_free( libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1170 * Return whether log iterator has more messages.
1172 * \param p_iter libvlc log iterator
1173 * \param p_e an initialized exception pointer
1174 * \return true if iterator has more message objects, else false
1176 VLC_PUBLIC_API int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_exception_t *p_e );
1179 * Return the next log message.
1181 * The message contents must not be freed
1183 * \param p_iter libvlc log iterator
1184 * \param p_buffer log buffer
1185 * \param p_e an initialized exception pointer
1186 * \return log message object
1188 VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
1189 libvlc_log_message_t *p_buffer,
1190 libvlc_exception_t *p_e );
1198 #endif /* <vlc/libvlc.h> */