libvlc.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * libvlc.h:  libvlc external API
00003  *****************************************************************************
00004  * Copyright (C) 1998-2005 the VideoLAN team
00005  * $Id$
00006  *
00007  * Authors: Clément Stenac <zorglub@videolan.org>
00008  *          Jean-Paul Saman <jpsaman _at_ m2x _dot_ nl>
00009  *          Pierre d'Herbemont <pdherbemont@videolan.org>
00010  *
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 of the License, or
00014  * (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00024  *****************************************************************************/
00025 
00026 /**
00027  * \defgroup libvlc libvlc
00028  * This is libvlc, the base library of the VLC program.
00029  *
00030  * @{
00031  */
00032 
00033 
00034 #ifndef VLC_LIBVLC_H
00035 #define VLC_LIBVLC_H 1
00036 
00037 #if defined (WIN32) && defined (DLL_EXPORT)
00038 # define VLC_PUBLIC_API __declspec(dllexport)
00039 #else
00040 # define VLC_PUBLIC_API
00041 #endif
00042 
00043 #ifdef __LIBVLC__
00044 /* Avoid unuseful warnings from libvlc with our deprecated APIs */
00045 #   define VLC_DEPRECATED_API VLC_PUBLIC_API
00046 #elif defined(__GNUC__) && \
00047       (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 0)
00048 # define VLC_DEPRECATED_API VLC_PUBLIC_API __attribute__((deprecated))
00049 #else
00050 # define VLC_DEPRECATED_API VLC_PUBLIC_API
00051 #endif
00052 
00053 # ifdef __cplusplus
00054 extern "C" {
00055 # endif
00056 
00057 /*****************************************************************************
00058  * Exception handling
00059  *****************************************************************************/
00060 /** \defgroup libvlc_exception libvlc_exception
00061  * \ingroup libvlc_core
00062  * LibVLC Exceptions handling
00063  * @{
00064  */
00065 
00066 /**
00067  * Initialize an exception structure. This can be called several times to
00068  * reuse an exception structure.
00069  *
00070  * \param p_exception the exception to initialize
00071  */
00072 VLC_PUBLIC_API void libvlc_exception_init( libvlc_exception_t *p_exception );
00073 
00074 /**
00075  * Has an exception been raised?
00076  *
00077  * \param p_exception the exception to query
00078  * \return 0 if the exception was raised, 1 otherwise
00079  */
00080 VLC_PUBLIC_API int
00081 libvlc_exception_raised( const libvlc_exception_t *p_exception );
00082 
00083 /**
00084  * Raise an exception using a user-provided message.
00085  *
00086  * \param p_exception the exception to raise
00087  * \param psz_format the exception message format string
00088  * \param ... the format string arguments
00089  */
00090 VLC_PUBLIC_API void
00091 libvlc_exception_raise( libvlc_exception_t *p_exception,
00092                         const char *psz_format, ... );
00093 
00094 /**
00095  * Clear an exception object so it can be reused.
00096  * The exception object must have be initialized.
00097  *
00098  * \param p_exception the exception to clear
00099  */
00100 VLC_PUBLIC_API void libvlc_exception_clear( libvlc_exception_t * );
00101 
00102 /**
00103  * Get an exception's message.
00104  *
00105  * \param p_exception the exception to query
00106  * \return the exception message or NULL if not applicable (exception not
00107  *         raised, for example)
00108  */
00109 VLC_PUBLIC_API const char *
00110 libvlc_exception_get_message( const libvlc_exception_t *p_exception );
00111 
00112 /**@} */
00113 
00114 /*****************************************************************************
00115  * Core handling
00116  *****************************************************************************/
00117 
00118 /** \defgroup libvlc_core libvlc_core
00119  * \ingroup libvlc
00120  * LibVLC Core
00121  * @{
00122  */
00123 
00124 /**
00125  * Create and initialize a libvlc instance.
00126  *
00127  * \param argc the number of arguments
00128  * \param argv command-line-type arguments. argv[0] must be the path of the
00129  *        calling program.
00130  * \param p_e an initialized exception pointer
00131  * \return the libvlc instance
00132  */
00133 VLC_PUBLIC_API libvlc_instance_t *
00134 libvlc_new( int , const char *const *, libvlc_exception_t *);
00135 
00136 /**
00137  * Return a libvlc instance identifier for legacy APIs. Use of this
00138  * function is discouraged, you should convert your program to use the
00139  * new API.
00140  *
00141  * \param p_instance the instance
00142  * \return the instance identifier
00143  */
00144 VLC_PUBLIC_API int libvlc_get_vlc_id( libvlc_instance_t *p_instance );
00145 
00146 /**
00147  * Decrement the reference count of a libvlc instance, and destroy it
00148  * if it reaches zero.
00149  *
00150  * \param p_instance the instance to destroy
00151  */
00152 VLC_PUBLIC_API void libvlc_release( libvlc_instance_t * );
00153 
00154 /**
00155  * Increments the reference count of a libvlc instance.
00156  * The initial reference count is 1 after libvlc_new() returns.
00157  *
00158  * \param p_instance the instance to reference
00159  */
00160 VLC_PUBLIC_API void libvlc_retain( libvlc_instance_t * );
00161 
00162 /**
00163  * Try to start a user interface for the libvlc instance, and wait until the
00164  * user exits.
00165  *
00166  * \param p_instance the instance
00167  * \param name interface name, or NULL for default
00168  * \param p_exception an initialized exception pointer
00169  */
00170 VLC_PUBLIC_API
00171 void libvlc_add_intf( libvlc_instance_t *p_instance, const char *name,
00172                       libvlc_exception_t *p_exception );
00173 
00174 /**
00175  * Waits until an interface causes the instance to exit.
00176  * You should start at least one interface first, using libvlc_add_intf().
00177  *
00178  * \param p_instance the instance
00179  */
00180 VLC_PUBLIC_API
00181 void libvlc_wait( libvlc_instance_t *p_instance );
00182 
00183 /**
00184  * Retrieve libvlc version.
00185  *
00186  * Example: "0.9.0-git Grishenko"
00187  *
00188  * \return a string containing the libvlc version
00189  */
00190 VLC_PUBLIC_API const char * libvlc_get_version(void);
00191 
00192 /**
00193  * Retrieve libvlc compiler version.
00194  *
00195  * Example: "gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu6)"
00196  *
00197  * \return a string containing the libvlc compiler version
00198  */
00199 VLC_PUBLIC_API const char * libvlc_get_compiler(void);
00200 
00201 /**
00202  * Retrieve libvlc changeset.
00203  *
00204  * Example: "aa9bce0bc4"
00205  *
00206  * \return a string containing the libvlc changeset
00207  */
00208 VLC_PUBLIC_API const char * libvlc_get_changeset(void);
00209 
00210 /** @}*/
00211 
00212 /*****************************************************************************
00213  * media
00214  *****************************************************************************/
00215 /** \defgroup libvlc_media libvlc_media
00216  * \ingroup libvlc
00217  * LibVLC Media
00218  * @{
00219  */
00220 
00221 /**
00222  * Create a media with the given MRL.
00223  *
00224  * \param p_instance the instance
00225  * \param psz_mrl the MRL to read
00226  * \param p_e an initialized exception pointer
00227  * \return the newly created media
00228  */
00229 VLC_PUBLIC_API libvlc_media_t * libvlc_media_new(
00230                                    libvlc_instance_t *p_instance,
00231                                    const char * psz_mrl,
00232                                    libvlc_exception_t *p_e );
00233 
00234 /**
00235  * Create a media as an empty node with the passed name.
00236  *
00237  * \param p_instance the instance
00238  * \param psz_name the name of the node
00239  * \param p_e an initialized exception pointer
00240  * \return the new empty media
00241  */
00242 VLC_PUBLIC_API libvlc_media_t * libvlc_media_new_as_node(
00243                                    libvlc_instance_t *p_instance,
00244                                    const char * psz_name,
00245                                    libvlc_exception_t *p_e );
00246 
00247 /**
00248  * Add an option to the media.
00249  *
00250  * This option will be used to determine how the media_player will
00251  * read the media. This allows to use VLC's advanced
00252  * reading/streaming options on a per-media basis.
00253  *
00254  * The options are detailed in vlc --long-help, for instance "--sout-all"
00255  *
00256  * \param p_instance the instance
00257  * \param ppsz_options the options (as a string)
00258  * \param p_e an initialized exception pointer
00259  */
00260 VLC_PUBLIC_API void libvlc_media_add_option(
00261                                    libvlc_media_t * p_md,
00262                                    const char * ppsz_options,
00263                                    libvlc_exception_t * p_e );
00264 
00265 /**
00266  * Retain a reference to a media descriptor object (libvlc_media_t). Use
00267  * libvlc_media_release() to decrement the reference count of a 
00268  * media descriptor object.
00269  *
00270  * \param p_meta_desc a media descriptor object.
00271  */
00272 VLC_PUBLIC_API void libvlc_media_retain(
00273                                    libvlc_media_t *p_meta_desc );
00274 
00275 /**
00276  * Decrement the reference count of a media descriptor object. If the
00277  * reference count is 0, then libvlc_media_release() will release the
00278  * media descriptor object. It will send out an libvlc_MediaFreed event
00279  * to all listeners. If the media descriptor object has been released it
00280  * should not be used again.
00281  *
00282  * \param p_meta_desc a media descriptor object.
00283  */
00284 VLC_PUBLIC_API void libvlc_media_release(
00285                                    libvlc_media_t *p_meta_desc );
00286 
00287 
00288 /**
00289  * Get the media resource locator (mrl) from a media descriptor object
00290  *
00291  * \param p_md a media descriptor object
00292  * \param p_e an initialized exception object
00293  * \return string with mrl of media descriptor object
00294  */
00295 VLC_PUBLIC_API char * libvlc_media_get_mrl( libvlc_media_t * p_md,
00296                                                        libvlc_exception_t * p_e );
00297 
00298 /**
00299  * Duplicate a media descriptor object.
00300  *
00301  * \param p_meta_desc a media descriptor object.
00302  */
00303 VLC_PUBLIC_API libvlc_media_t * libvlc_media_duplicate( libvlc_media_t * );
00304 
00305 /**
00306  * Read the meta of the media.
00307  *
00308  * \param p_meta_desc the media to read
00309  * \param e_meta_desc the meta to read
00310  * \param p_e an initialized exception pointer
00311  * \return the media's meta
00312  */
00313 VLC_PUBLIC_API char * libvlc_media_get_meta(
00314                                    libvlc_media_t *p_meta_desc,
00315                                    libvlc_meta_t e_meta,
00316                                    libvlc_exception_t *p_e );
00317 /**
00318  * Get current state of media descriptor object. Possible media states
00319  * are defined in libvlc_structures.c ( libvlc_NothingSpecial=0,
00320  * libvlc_Opening, libvlc_Buffering, libvlc_Playing, libvlc_Paused,
00321  * libvlc_Stopped, libvlc_Forward, libvlc_Backward, libvlc_Ended,
00322  * libvlc_Error).
00323  *
00324  * @see libvlc_state_t
00325  * \param p_meta_desc a media descriptor object
00326  * \param p_e an initialized exception object
00327  * \return state of media descriptor object
00328  */
00329 VLC_PUBLIC_API libvlc_state_t libvlc_media_get_state(
00330                                    libvlc_media_t *p_meta_desc,
00331                                    libvlc_exception_t *p_e );
00332 
00333 /**
00334  * Get subitems of media descriptor object. This will increment
00335  * the reference count of supplied media descriptor object. Use
00336  * libvlc_media_list_release() to decrement the reference counting.
00337  *
00338  * \param p_md media descriptor object
00339  * \param p_e initalized exception object
00340  * \return list of media descriptor subitems or NULL
00341  */
00342 VLC_PUBLIC_API libvlc_media_list_t *
00343     libvlc_media_subitems( libvlc_media_t *p_md,
00344                                       libvlc_exception_t *p_e );
00345 /**
00346  * Get event manager from media descriptor object.
00347  * NOTE: this function doesn't increment reference counting.
00348  *
00349  * \param p_md a media descriptor object
00350  * \param p_e an initialized exception object
00351  * \return event manager object
00352  */
00353 VLC_PUBLIC_API libvlc_event_manager_t *
00354     libvlc_media_event_manager( libvlc_media_t * p_md,
00355                                            libvlc_exception_t * p_e );
00356 
00357 /**
00358  * Get duration of media descriptor object item.
00359  *
00360  * \param p_md media descriptor object
00361  * \param p_e an initialized exception object
00362  * \return duration of media item
00363  */
00364 VLC_PUBLIC_API libvlc_time_t
00365    libvlc_media_get_duration( libvlc_media_t * p_md,
00366                                          libvlc_exception_t * p_e );
00367 
00368 /**
00369  * Get preparsed status for media descriptor object.
00370  *
00371  * \param p_md media descriptor object
00372  * \param p_e an initialized exception object
00373  * \return true if media object has been preparsed otherwise it returns false
00374  */
00375 VLC_PUBLIC_API int
00376    libvlc_media_is_preparsed( libvlc_media_t * p_md,
00377                                          libvlc_exception_t * p_e );
00378 
00379 /**
00380  * Sets media descriptor's user_data. user_data is specialized data 
00381  * accessed by the host application, VLC.framework uses it as a pointer to 
00382  * an native object that references a libvlc_media_t pointer
00383  *
00384  * \param p_md media descriptor object
00385  * \param p_new_user_data pointer to user data
00386  * \param p_e an initialized exception object
00387  */
00388 VLC_PUBLIC_API void
00389     libvlc_media_set_user_data( libvlc_media_t * p_md,
00390                                            void * p_new_user_data,
00391                                            libvlc_exception_t * p_e);
00392 
00393 /**
00394  * Get media descriptor's user_data. user_data is specialized data 
00395  * accessed by the host application, VLC.framework uses it as a pointer to 
00396  * an native object that references a libvlc_media_t pointer
00397  *
00398  * \param p_md media descriptor object
00399  * \param p_e an initialized exception object
00400  */
00401 VLC_PUBLIC_API void *
00402     libvlc_media_get_user_data( libvlc_media_t * p_md,
00403                                            libvlc_exception_t * p_e);
00404 
00405 /** @}*/
00406 
00407 /*****************************************************************************
00408  * Media Player
00409  *****************************************************************************/
00410 /** \defgroup libvlc_media_player libvlc_media_player
00411  * \ingroup libvlc
00412  * LibVLC Media Player, object that let you play a media
00413  * in a libvlc_drawable_t
00414  * @{
00415  */
00416 
00417 /**
00418  * Create an empty Media Player object
00419  *
00420  * \param p_libvlc_instance the libvlc instance in which the Media Player
00421  *        should be created.
00422  * \param p_e an initialized exception pointer
00423  */
00424 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t *, libvlc_exception_t * );
00425 
00426 /**
00427  * Create a Media Player object from a Media
00428  *
00429  * \param p_md the media. Afterwards the p_md can be safely
00430  *        destroyed.
00431  * \param p_e an initialized exception pointer
00432  */
00433 VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new_from_media( libvlc_media_t *, libvlc_exception_t * );
00434 
00435 /**
00436  * Release a media_player after use
00437  * Decrement the reference count of a media player object. If the
00438  * reference count is 0, then libvlc_media_player_release() will 
00439  * release the media player object. If the media player object 
00440  * has been released, then it should not be used again.
00441  *
00442  * \param p_mi the Media Player to free
00443  */
00444 VLC_PUBLIC_API void libvlc_media_player_release( libvlc_media_player_t * );
00445 
00446 /**
00447  * Retain a reference to a media player object. Use
00448  * libvlc_media_player_release() to decrement reference count.
00449  *
00450  * \param p_mi media player object
00451  */
00452 VLC_PUBLIC_API void libvlc_media_player_retain( libvlc_media_player_t * );
00453 
00454 /** 
00455  * Set the media that will be used by the media_player. If any,
00456  * previous md will be released.
00457  *
00458  * \param p_mi the Media Player
00459  * \param p_md the Media. Afterwards the p_md can be safely
00460  *        destroyed.
00461  * \param p_e an initialized exception pointer
00462  */
00463 VLC_PUBLIC_API void libvlc_media_player_set_media( libvlc_media_player_t *, libvlc_media_t *, libvlc_exception_t * );
00464 
00465 /**
00466  * Get the media used by the media_player.
00467  *
00468  * \param p_mi the Media Player
00469  * \param p_e an initialized exception pointer
00470  * \return the media associated with p_mi, or NULL if no
00471  *         media is associated
00472  */
00473 VLC_PUBLIC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t *, libvlc_exception_t * );
00474 
00475 /**
00476  * Get the Event Manager from which the media player send event.
00477  *
00478  * \param p_mi the Media Player
00479  * \param p_e an initialized exception pointer
00480  * \return the event manager associated with p_mi
00481  */
00482 VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *, libvlc_exception_t * );
00483 
00484 /**
00485  * Play
00486  *
00487  * \param p_mi the Media Player
00488  * \param p_e an initialized exception pointer
00489  */
00490 VLC_PUBLIC_API void libvlc_media_player_play ( libvlc_media_player_t *, libvlc_exception_t * );
00491 
00492 /**
00493  * Pause
00494  *
00495  * \param p_mi the Media Player
00496  * \param p_e an initialized exception pointer
00497  */
00498 VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *, libvlc_exception_t * );
00499 
00500 /**
00501  * Stop
00502  *
00503  * \param p_mi the Media Player
00504  * \param p_e an initialized exception pointer
00505  */
00506 VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *, libvlc_exception_t * );
00507 
00508 /**
00509  * Set the drawable where the media player should render its video output
00510  *
00511  * \param p_mi the Media Player
00512  * \param drawable the libvlc_drawable_t where the media player
00513  *        should render its video
00514  * \param p_e an initialized exception pointer
00515  */
00516 VLC_PUBLIC_API void libvlc_media_player_set_drawable ( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
00517 
00518 /**
00519  * Get the drawable where the media player should render its video output
00520  *
00521  * \param p_mi the Media Player
00522  * \param p_e an initialized exception pointer
00523  * \return the libvlc_drawable_t where the media player
00524  *         should render its video
00525  */
00526 VLC_PUBLIC_API libvlc_drawable_t
00527                     libvlc_media_player_get_drawable ( libvlc_media_player_t *, libvlc_exception_t * );
00528 
00529 /** \bug This might go away ... to be replaced by a broader system */
00530 /**
00531  * Get the current movie length (in ms).
00532  *
00533  * \param p_mi the Media Player
00534  * \param p_e an initialized exception pointer
00535  * \return the movie length (in ms).
00536  */
00537 VLC_PUBLIC_API libvlc_time_t  libvlc_media_player_get_length     ( libvlc_media_player_t *, libvlc_exception_t *);
00538 /**
00539  * Get the current movie time (in ms).
00540  *
00541  * \param p_mi the Media Player
00542  * \param p_e an initialized exception pointer
00543  * \return the movie time (in ms).
00544  */
00545 VLC_PUBLIC_API libvlc_time_t  libvlc_media_player_get_time       ( libvlc_media_player_t *, libvlc_exception_t *);
00546 /**
00547  * Set the movie time (in ms).
00548  *
00549  * \param p_mi the Media Player
00550  * \param the movie time (in ms).
00551  * \param p_e an initialized exception pointer
00552  */
00553 VLC_PUBLIC_API void           libvlc_media_player_set_time       ( libvlc_media_player_t *, libvlc_time_t, libvlc_exception_t *);
00554 VLC_PUBLIC_API float          libvlc_media_player_get_position   ( libvlc_media_player_t *, libvlc_exception_t *);
00555 VLC_PUBLIC_API void           libvlc_media_player_set_position   ( libvlc_media_player_t *, float, libvlc_exception_t *);
00556 VLC_PUBLIC_API void           libvlc_media_player_set_chapter    ( libvlc_media_player_t *, int, libvlc_exception_t *);
00557 VLC_PUBLIC_API int            libvlc_media_player_get_chapter    (libvlc_media_player_t *, libvlc_exception_t *);
00558 VLC_PUBLIC_API int            libvlc_media_player_get_chapter_count( libvlc_media_player_t *, libvlc_exception_t *);
00559 VLC_PUBLIC_API int            libvlc_media_player_will_play      ( libvlc_media_player_t *, libvlc_exception_t *);
00560 VLC_PUBLIC_API float          libvlc_media_player_get_rate       ( libvlc_media_player_t *, libvlc_exception_t *);
00561 VLC_PUBLIC_API void           libvlc_media_player_set_rate       ( libvlc_media_player_t *, float, libvlc_exception_t *);
00562 VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state   ( libvlc_media_player_t *, libvlc_exception_t *);
00563 VLC_PUBLIC_API float          libvlc_media_player_get_fps( libvlc_media_player_t *, libvlc_exception_t *);
00564 /** end bug */
00565 
00566 /**
00567  * Does this media player have a video output?
00568  *
00569  * \param p_md the media player
00570  * \param p_e an initialized exception pointer
00571  */
00572 VLC_PUBLIC_API int  libvlc_media_player_has_vout( libvlc_media_player_t *, libvlc_exception_t *);
00573 
00574 /**
00575  * Is this media player seekable?
00576  *
00577  * \param p_input the input
00578  * \param p_e an initialized exception pointer
00579  */
00580 VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
00581 
00582 /**
00583  * Can this media player be paused?
00584  *
00585  * \param p_input the input
00586  * \param p_e an initialized exception pointer
00587  */
00588 VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
00589 
00590 /** \defgroup libvlc_video libvlc_video
00591  * \ingroup libvlc_media_player
00592  * LibVLC Video handling
00593  * @{
00594  */
00595 
00596 /**
00597  * Toggle fullscreen status on video output.
00598  *
00599  * \param p_mediaplayer the media player
00600  * \param p_e an initialized exception pointer
00601  */
00602 VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
00603 
00604 /**
00605  * Enable or disable fullscreen on a video output.
00606  *
00607  * \param p_mediaplayer the media player
00608  * \param b_fullscreen boolean for fullscreen status
00609  * \param p_e an initialized exception pointer
00610  */
00611 VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *, int, libvlc_exception_t * );
00612 
00613 /**
00614  * Get current fullscreen status.
00615  *
00616  * \param p_mediaplayer the media player
00617  * \param p_e an initialized exception pointer
00618  * \return the fullscreen status (boolean)
00619  */
00620 VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
00621 
00622 /**
00623  * Get current video height.
00624  *
00625  * \param p_mediaplayer the media player
00626  * \param p_e an initialized exception pointer
00627  * \return the video height
00628  */
00629 VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_player_t *, libvlc_exception_t * );
00630 
00631 /**
00632  * Get current video width.
00633  *
00634  * \param p_mediaplayer the media player
00635  * \param p_e an initialized exception pointer
00636  * \return the video width
00637  */
00638 VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_player_t *, libvlc_exception_t * );
00639 
00640 /**
00641  * Get current video aspect ratio.
00642  *
00643  * \param p_mediaplayer the media player
00644  * \param p_e an initialized exception pointer
00645  * \return the video aspect ratio
00646  */
00647 VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *, libvlc_exception_t * );
00648 
00649 /**
00650  * Set new video aspect ratio.
00651  *
00652  * \param p_mediaplayer the media player
00653  * \param psz_aspect new video aspect-ratio
00654  * \param p_e an initialized exception pointer
00655  */
00656 VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *, char *, libvlc_exception_t * );
00657 
00658 /**
00659  * Get current video subtitle.
00660  *
00661  * \param p_mediaplayer the media player
00662  * \param p_e an initialized exception pointer
00663  * \return the video subtitle selected
00664  */
00665 VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *, libvlc_exception_t * );
00666 
00667 /**
00668  * Set new video subtitle.
00669  *
00670  * \param p_mediaplayer the media player
00671  * \param i_spu new video subtitle to select
00672  * \param p_e an initialized exception pointer
00673  */
00674 VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_player_t *, int , libvlc_exception_t * );
00675 
00676 /**
00677  * Set new video subtitle file.
00678  *
00679  * \param p_mediaplayer the media player
00680  * \param psz_subtitle new video subtitle file
00681  * \param p_e an initialized exception pointer
00682  * \return the success status (boolean)
00683  */
00684 VLC_PUBLIC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *, char *, libvlc_exception_t * );
00685 
00686 /**
00687  * Get current crop filter geometry.
00688  *
00689  * \param p_mediaplayer the media player
00690  * \param p_e an initialized exception pointer
00691  * \return the crop filter geometry
00692  */
00693 VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *, libvlc_exception_t * );
00694 
00695 /**
00696  * Set new crop filter geometry.
00697  *
00698  * \param p_mediaplayer the media player
00699  * \param psz_geometry new crop filter geometry
00700  * \param p_e an initialized exception pointer
00701  */
00702 VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_player_t *, char *, libvlc_exception_t * );
00703 
00704 /**
00705  * Toggle teletext transparent status on video output.
00706  *
00707  * \param p_mediaplayer the media player
00708  * \param p_e an initialized exception pointer
00709  */
00710 VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *, libvlc_exception_t * );
00711 
00712 /**
00713  * Get current teletext page requested.
00714  *
00715  * \param p_mediaplayer the media player
00716  * \param p_e an initialized exception pointer
00717  * \return the current teletext page requested.
00718  */
00719 VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t *, libvlc_exception_t * );
00720 
00721 /**
00722  * Set new teletext page to retrieve.
00723  *
00724  * \param p_mediaplayer the media player
00725  * \param i_page teletex page number requested
00726  * \param p_e an initialized exception pointer
00727  */
00728 VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *, int, libvlc_exception_t * );
00729 
00730 /**
00731  * Take a snapshot of the current video window.
00732  *
00733  * If i_width AND i_height is 0, original size is used.
00734  * If i_width XOR i_height is 0, original aspect-ratio is preserved.
00735  *
00736  * \param p_mediaplayer the media player
00737  * \param psz_filepath the path where to save the screenshot to
00738  * \param i_width the snapshot's width
00739  * \param i_height the snapshot's height
00740  * \param p_e an initialized exception pointer
00741  */
00742 VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_player_t *, char *,unsigned int, unsigned int, libvlc_exception_t * );
00743 
00744 /**
00745  * Resize the current video output window.
00746  *
00747  * \param p_instance libvlc instance
00748  * \param width new width for video output window
00749  * \param height new height for video output window
00750  * \param p_e an initialized exception pointer
00751  * \return the success status (boolean)
00752  */
00753 VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_player_t *, int, int, libvlc_exception_t *);
00754 
00755 /**
00756  * Change the parent for the current the video output.
00757  *
00758  * \param p_instance libvlc instance
00759  * \param drawable the new parent window (Drawable on X11, CGrafPort on MacOSX, HWND on Win32)
00760  * \param p_e an initialized exception pointer
00761  * \return the success status (boolean)
00762  */
00763 VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
00764 
00765 /**
00766  * Tell windowless video output to redraw rectangular area (MacOS X only).
00767  *
00768  * \param p_instance libvlc instance
00769  * \param area coordinates within video drawable
00770  * \param p_e an initialized exception pointer
00771  */
00772 VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_player_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
00773 
00774 /**
00775  * Set the default video output size.
00776  *
00777  * This setting will be used as default for all video outputs.
00778  *
00779  * \param p_instance libvlc instance
00780  * \param width new width for video drawable
00781  * \param height new height for video drawable
00782  * \param p_e an initialized exception pointer
00783  */
00784 VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc_exception_t * );
00785 
00786 /**
00787  * Set the default video output viewport for a windowless video output
00788  * (MacOS X only).
00789  *
00790  * This setting will be used as default for all video outputs.
00791  *
00792  * \param p_instance libvlc instance
00793  * \param view coordinates within video drawable
00794  * \param clip coordinates within video drawable
00795  * \param p_e an initialized exception pointer
00796  */
00797 VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
00798 
00799 /** @} video */
00800 
00801 /** \defgroup libvlc_audio libvlc_audio
00802  * \ingroup libvlc_media_player
00803  * LibVLC Audio handling
00804  * @{
00805  */
00806 
00807 /**
00808  * Toggle mute status.
00809  *
00810  * \param p_instance libvlc instance
00811  * \param p_e an initialized exception pointer
00812  */
00813 VLC_PUBLIC_API void libvlc_audio_toggle_mute( libvlc_instance_t *, libvlc_exception_t * );
00814 
00815 /**
00816  * Get current mute status.
00817  *
00818  * \param p_instance libvlc instance
00819  * \param p_e an initialized exception pointer
00820  * \return the mute status (boolean)
00821  */
00822 VLC_PUBLIC_API int libvlc_audio_get_mute( libvlc_instance_t *, libvlc_exception_t * );
00823 
00824 /**
00825  * Set mute status.
00826  *
00827  * \param p_instance libvlc instance
00828  * \param status If status is true then mute, otherwise unmute
00829  * \param p_e an initialized exception pointer
00830  */
00831 VLC_PUBLIC_API void libvlc_audio_set_mute( libvlc_instance_t *, int , libvlc_exception_t * );
00832 
00833 /**
00834  * Get current audio level.
00835  *
00836  * \param p_instance libvlc instance
00837  * \param p_e an initialized exception pointer
00838  * \return the audio level (int)
00839  */
00840 VLC_PUBLIC_API int libvlc_audio_get_volume( libvlc_instance_t *, libvlc_exception_t * );
00841 
00842 /**
00843  * Set current audio level.
00844  *
00845  * \param p_instance libvlc instance
00846  * \param i_volume the volume (int)
00847  * \param p_e an initialized exception pointer
00848  */
00849 VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_exception_t *);
00850 
00851 /**
00852  * Get number of available audio tracks.
00853  *
00854  * \param p_mi media player
00855  * \param p_e an initialized exception
00856  * \return the number of available audio tracks (int)
00857  */
00858 VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *,  libvlc_exception_t * );
00859 
00860 /**
00861  * Get current audio track.
00862  *
00863  * \param p_mi media player
00864  * \param p_e an initialized exception pointer
00865  * \return the audio track (int)
00866  */
00867 VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *, libvlc_exception_t * );
00868 
00869 /**
00870  * Set current audio track.
00871  *
00872  * \param p_mi media player
00873  * \param i_track the track (int)
00874  * \param p_e an initialized exception pointer
00875  */
00876 VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_player_t *, int, libvlc_exception_t * );
00877 
00878 /**
00879  * Get current audio channel.
00880  *
00881  * \param p_instance vlc instance
00882  * \param p_e an initialized exception pointer
00883  * \return the audio channel (int)
00884  */
00885 VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_instance_t *, libvlc_exception_t * );
00886 
00887 /**
00888  * Set current audio channel.
00889  *
00890  * \param p_instance vlc instance
00891  * \param i_channel the audio channel (int)
00892  * \param p_e an initialized exception pointer
00893  */
00894 VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_exception_t * );
00895 
00896 /** @} audio */
00897 
00898 /** @} media_player */
00899 
00900 /*****************************************************************************
00901  * Event handling
00902  *****************************************************************************/
00903 
00904 /** \defgroup libvlc_event libvlc_event
00905  * \ingroup libvlc_core
00906  * LibVLC Events
00907  * @{
00908  */
00909 
00910 /**
00911  * Register for an event notification.
00912  *
00913  * \param p_event_manager the event manager to which you want to attach to.
00914  *        Generally it is obtained by vlc_my_object_event_manager() where
00915  *        my_object is the object you want to listen to.
00916  * \param i_event_type the desired event to which we want to listen
00917  * \param f_callback the function to call when i_event_type occurs
00918  * \param user_data user provided data to carry with the event
00919  * \param p_e an initialized exception pointer
00920  */
00921 VLC_PUBLIC_API void libvlc_event_attach( libvlc_event_manager_t *p_event_manager,
00922                                          libvlc_event_type_t i_event_type,
00923                                          libvlc_callback_t f_callback,
00924                                          void *user_data,
00925                                          libvlc_exception_t *p_e );
00926 
00927 /**
00928  * Unregister an event notification.
00929  *
00930  * \param p_event_manager the event manager
00931  * \param i_event_type the desired event to which we want to unregister
00932  * \param f_callback the function to call when i_event_type occurs
00933  * \param p_user_data user provided data to carry with the event
00934  * \param p_e an initialized exception pointer
00935  */
00936 VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager,
00937                                          libvlc_event_type_t i_event_type,
00938                                          libvlc_callback_t f_callback,
00939                                          void *p_user_data,
00940                                          libvlc_exception_t *p_e );
00941 
00942 /**
00943  * Get an event's type name.
00944  *
00945  * \param i_event_type the desired event
00946  */
00947 VLC_PUBLIC_API const char * libvlc_event_type_name( libvlc_event_type_t event_type );
00948 
00949 /** @} */
00950 
00951 /*****************************************************************************
00952  * Media Library
00953  *****************************************************************************/
00954 /** \defgroup libvlc_media_library libvlc_media_library
00955  * \ingroup libvlc
00956  * LibVLC Media Library
00957  * @{
00958  */
00959 VLC_PUBLIC_API libvlc_media_library_t *
00960     libvlc_media_library_new( libvlc_instance_t * p_inst,
00961                               libvlc_exception_t * p_e );
00962 
00963 /**
00964  * Release media library object. This functions decrements the
00965  * reference count of the media library object. If it reaches 0,
00966  * then the object will be released.
00967  *
00968  * \param p_mlib media library object
00969  */
00970 VLC_PUBLIC_API void
00971     libvlc_media_library_release( libvlc_media_library_t * p_mlib );
00972 
00973 /**
00974  * Retain a reference to a media library object. This function will
00975  * increment the reference counting for this object. Use 
00976  * libvlc_media_library_release() to decrement the reference count.
00977  *
00978  * \param p_mlib media library object
00979  */
00980 VLC_PUBLIC_API void
00981     libvlc_media_library_retain( libvlc_media_library_t * p_mlib );
00982 
00983 /**
00984  * Load media library.
00985  *
00986  * \param p_mlib media library object
00987  * \param p_e an initialized exception object.
00988  */
00989 VLC_PUBLIC_API void
00990     libvlc_media_library_load( libvlc_media_library_t * p_mlib,
00991                                libvlc_exception_t * p_e );
00992 
00993 /**
00994  * Save media library.
00995  *
00996  * \param p_mlib media library object
00997  * \param p_e an initialized exception object.
00998  */
00999 VLC_PUBLIC_API void
01000     libvlc_media_library_save( libvlc_media_library_t * p_mlib,
01001                                libvlc_exception_t * p_e );
01002 
01003 /**
01004  * Get media library subitems.
01005  *
01006  * \param p_mlib media library object
01007  * \param p_e an initialized exception object.
01008  * \return media list subitems
01009  */
01010 VLC_PUBLIC_API libvlc_media_list_t *
01011     libvlc_media_library_media_list( libvlc_media_library_t * p_mlib,
01012                                      libvlc_exception_t * p_e );
01013 
01014 
01015 /** @} */
01016 
01017 
01018 /*****************************************************************************
01019  * Services/Media Discovery
01020  *****************************************************************************/
01021 /** \defgroup libvlc_media_discoverer libvlc_media_discoverer
01022  * \ingroup libvlc
01023  * LibVLC Media Discoverer
01024  * @{
01025  */
01026 
01027 /**
01028  * Discover media service by name.
01029  *
01030  * \param p_inst libvlc instance
01031  * \param psz_name service name
01032  * \param p_e an initialized exception object
01033  * \return media discover object
01034  */
01035 VLC_PUBLIC_API libvlc_media_discoverer_t *
01036 libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
01037                                        const char * psz_name,
01038                                        libvlc_exception_t * p_e );
01039 
01040 /**
01041  * Release media discover object. If the reference count reaches 0, then
01042  * the object will be released.
01043  *
01044  * \param p_mdis media service discover object
01045  */
01046 VLC_PUBLIC_API void   libvlc_media_discoverer_release( libvlc_media_discoverer_t * p_mdis );
01047 
01048 /**
01049  * Get media service discover object its localized name.
01050  *
01051  * \param media discover object
01052  * \return localized name
01053  */
01054 VLC_PUBLIC_API char * libvlc_media_discoverer_localized_name( libvlc_media_discoverer_t * p_mdis );
01055 
01056 /**
01057  * Get media service discover media list.
01058  *
01059  * \param p_mdis media service discover object
01060  * \return list of media items
01061  */
01062 VLC_PUBLIC_API libvlc_media_list_t * libvlc_media_discoverer_media_list( libvlc_media_discoverer_t * p_mdis );
01063 
01064 /**
01065  * Get event manager from media service discover object.
01066  *
01067  * \param p_mdis media service discover object
01068  * \return event manager object.
01069  */
01070 VLC_PUBLIC_API libvlc_event_manager_t *
01071         libvlc_media_discoverer_event_manager( libvlc_media_discoverer_t * p_mdis );
01072 
01073 /**
01074  * Query if media service discover object is running.
01075  *
01076  * \param p_mdis media service discover object
01077  * \return true if running, false if not
01078  */
01079 VLC_PUBLIC_API int
01080         libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis );
01081 
01082 /**@} */
01083 
01084 
01085 /*****************************************************************************
01086  * Message log handling
01087  *****************************************************************************/
01088 
01089 /** \defgroup libvlc_log libvlc_log
01090  * \ingroup libvlc_core
01091  * LibVLC Message Logging
01092  * @{
01093  */
01094 
01095 /**
01096  * Return the VLC messaging verbosity level.
01097  *
01098  * \param p_instance libvlc instance
01099  * \param p_e an initialized exception pointer
01100  * \return verbosity level for messages
01101  */
01102 VLC_PUBLIC_API unsigned libvlc_get_log_verbosity( const libvlc_instance_t *p_instance,
01103                                                   libvlc_