libvlc_media_player.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * libvlc_media_player.h:  libvlc_media_player external API
00003  *****************************************************************************
00004  * Copyright (C) 1998-2010 VLC authors and VideoLAN
00005  * $Id: cc575218a9341d3f8371cff1c2e0e3440edca9f2 $
00006  *
00007  * Authors: Clément Stenac <zorglub@videolan.org>
00008  *          Jean-Paul Saman <jpsaman@videolan.org>
00009  *          Pierre d'Herbemont <pdherbemont@videolan.org>
00010  *
00011  * This program is free software; you can redistribute it and/or modify it
00012  * under the terms of the GNU Lesser General Public License as published by
00013  * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU Lesser General Public License
00022  * along with this program; if not, write to the Free Software Foundation,
00023  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00024  *****************************************************************************/
00025 
00026 /**
00027  * \file
00028  * This file defines libvlc_media_player external API
00029  */
00030 
00031 #ifndef VLC_LIBVLC_MEDIA_PLAYER_H
00032 #define VLC_LIBVLC_MEDIA_PLAYER_H 1
00033 
00034 # ifdef __cplusplus
00035 extern "C" {
00036 # else
00037 #  include <stdbool.h>
00038 # endif
00039 
00040 /*****************************************************************************
00041  * Media Player
00042  *****************************************************************************/
00043 /** \defgroup libvlc_media_player LibVLC media player
00044  * \ingroup libvlc
00045  * A LibVLC media player plays one media (usually in a custom drawable).
00046  * @{
00047  */
00048 
00049 typedef struct libvlc_media_player_t libvlc_media_player_t;
00050 
00051 /**
00052  * Description for video, audio tracks and subtitles. It contains
00053  * id, name (description string) and pointer to next record.
00054  */
00055 typedef struct libvlc_track_description_t
00056 {
00057     int   i_id;
00058     char *psz_name;
00059     struct libvlc_track_description_t *p_next;
00060 
00061 } libvlc_track_description_t;
00062 
00063 /**
00064  * Description for audio output. It contains
00065  * name, description and pointer to next record.
00066  */
00067 typedef struct libvlc_audio_output_t
00068 {
00069     char *psz_name;
00070     char *psz_description;
00071     struct libvlc_audio_output_t *p_next;
00072 
00073 } libvlc_audio_output_t;
00074 
00075 /**
00076  * Rectangle type for video geometry
00077  */
00078 typedef struct libvlc_rectangle_t
00079 {
00080     int top, left;
00081     int bottom, right;
00082 } libvlc_rectangle_t;
00083 
00084 /**
00085  * Marq options definition
00086  */
00087 typedef enum libvlc_video_marquee_option_t {
00088     libvlc_marquee_Enable = 0,
00089     libvlc_marquee_Text,                  /** string argument */
00090     libvlc_marquee_Color,
00091     libvlc_marquee_Opacity,
00092     libvlc_marquee_Position,
00093     libvlc_marquee_Refresh,
00094     libvlc_marquee_Size,
00095     libvlc_marquee_Timeout,
00096     libvlc_marquee_X,
00097     libvlc_marquee_Y
00098 } libvlc_video_marquee_option_t;
00099 
00100 /**
00101  * Navigation mode
00102  */
00103 typedef enum libvlc_navigate_mode_t
00104 {
00105     libvlc_navigate_activate = 0,
00106     libvlc_navigate_up,
00107     libvlc_navigate_down,
00108     libvlc_navigate_left,
00109     libvlc_navigate_right
00110 } libvlc_navigate_mode_t;
00111 
00112 /**
00113  * Create an empty Media Player object
00114  *
00115  * \param p_libvlc_instance the libvlc instance in which the Media Player
00116  *        should be created.
00117  * \return a new media player object, or NULL on error.
00118  */
00119 LIBVLC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t *p_libvlc_instance );
00120 
00121 /**
00122  * Create a Media Player object from a Media
00123  *
00124  * \param p_md the media. Afterwards the p_md can be safely
00125  *        destroyed.
00126  * \return a new media player object, or NULL on error.
00127  */
00128 LIBVLC_API libvlc_media_player_t * libvlc_media_player_new_from_media( libvlc_media_t *p_md );
00129 
00130 /**
00131  * Release a media_player after use
00132  * Decrement the reference count of a media player object. If the
00133  * reference count is 0, then libvlc_media_player_release() will
00134  * release the media player object. If the media player object
00135  * has been released, then it should not be used again.
00136  *
00137  * \param p_mi the Media Player to free
00138  */
00139 LIBVLC_API void libvlc_media_player_release( libvlc_media_player_t *p_mi );
00140 
00141 /**
00142  * Retain a reference to a media player object. Use
00143  * libvlc_media_player_release() to decrement reference count.
00144  *
00145  * \param p_mi media player object
00146  */
00147 LIBVLC_API void libvlc_media_player_retain( libvlc_media_player_t *p_mi );
00148 
00149 /**
00150  * Set the media that will be used by the media_player. If any,
00151  * previous md will be released.
00152  *
00153  * \param p_mi the Media Player
00154  * \param p_md the Media. Afterwards the p_md can be safely
00155  *        destroyed.
00156  */
00157 LIBVLC_API void libvlc_media_player_set_media( libvlc_media_player_t *p_mi,
00158                                                    libvlc_media_t *p_md );
00159 
00160 /**
00161  * Get the media used by the media_player.
00162  *
00163  * \param p_mi the Media Player
00164  * \return the media associated with p_mi, or NULL if no
00165  *         media is associated
00166  */
00167 LIBVLC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t *p_mi );
00168 
00169 /**
00170  * Get the Event Manager from which the media player send event.
00171  *
00172  * \param p_mi the Media Player
00173  * \return the event manager associated with p_mi
00174  */
00175 LIBVLC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *p_mi );
00176 
00177 /**
00178  * is_playing
00179  *
00180  * \param p_mi the Media Player
00181  * \return 1 if the media player is playing, 0 otherwise
00182  *
00183  * \libvlc_return_bool
00184  */
00185 LIBVLC_API int libvlc_media_player_is_playing ( libvlc_media_player_t *p_mi );
00186 
00187 /**
00188  * Play
00189  *
00190  * \param p_mi the Media Player
00191  * \return 0 if playback started (and was already started), or -1 on error.
00192  */
00193 LIBVLC_API int libvlc_media_player_play ( libvlc_media_player_t *p_mi );
00194 
00195 /**
00196  * Pause or resume (no effect if there is no media)
00197  *
00198  * \param mp the Media Player
00199  * \param do_pause play/resume if zero, pause if non-zero
00200  * \version LibVLC 1.1.1 or later
00201  */
00202 LIBVLC_API void libvlc_media_player_set_pause ( libvlc_media_player_t *mp,
00203                                                     int do_pause );
00204 
00205 /**
00206  * Toggle pause (no effect if there is no media)
00207  *
00208  * \param p_mi the Media Player
00209  */
00210 LIBVLC_API void libvlc_media_player_pause ( libvlc_media_player_t *p_mi );
00211 
00212 /**
00213  * Stop (no effect if there is no media)
00214  *
00215  * \param p_mi the Media Player
00216  */
00217 LIBVLC_API void libvlc_media_player_stop ( libvlc_media_player_t *p_mi );
00218 
00219 /**
00220  * Callback prototype to allocate and lock a picture buffer.
00221  *
00222  * Whenever a new video frame needs to be decoded, the lock callback is
00223  * invoked. Depending on the video chroma, one or three pixel planes of
00224  * adequate dimensions must be returned via the second parameter. Those
00225  * planes must be aligned on 32-bytes boundaries.
00226  *
00227  * \param opaque private pointer as passed to libvlc_video_set_callbacks() [IN]
00228  * \param planes start address of the pixel planes (LibVLC allocates the array
00229  *             of void pointers, this callback must initialize the array) [OUT]
00230  * \return a private pointer for the display and unlock callbacks to identify
00231  *         the picture buffers
00232  */
00233 typedef void *(*libvlc_video_lock_cb)(void *opaque, void **planes);
00234 
00235 /**
00236  * Callback prototype to unlock a picture buffer.
00237  *
00238  * When the video frame decoding is complete, the unlock callback is invoked.
00239  * This callback might not be needed at all. It is only an indication that the
00240  * application can now read the pixel values if it needs to.
00241  *
00242  * \warning A picture buffer is unlocked after the picture is decoded,
00243  * but before the picture is displayed.
00244  *
00245  * \param opaque private pointer as passed to libvlc_video_set_callbacks() [IN]
00246  * \param picture private pointer returned from the @ref libvlc_video_lock_cb
00247  *                callback [IN]
00248  * \param planes pixel planes as defined by the @ref libvlc_video_lock_cb
00249  *               callback (this parameter is only for convenience) [IN]
00250  */
00251 typedef void (*libvlc_video_unlock_cb)(void *opaque, void *picture,
00252                                        void *const *planes);
00253 
00254 /**
00255  * Callback prototype to display a picture.
00256  *
00257  * When the video frame needs to be shown, as determined by the media playback
00258  * clock, the display callback is invoked.
00259  *
00260  * \param opaque private pointer as passed to libvlc_video_set_callbacks() [IN]
00261  * \param picture private pointer returned from the @ref libvlc_video_lock_cb
00262  *                callback [IN]
00263  */
00264 typedef void (*libvlc_video_display_cb)(void *opaque, void *picture);
00265 
00266 /**
00267  * Callback prototype to configure picture buffers format.
00268  * This callback gets the format of the video as output by the video decoder
00269  * and the chain of video filters (if any). It can opt to change any parameter
00270  * as it needs. In that case, LibVLC will attempt to convert the video format
00271  * (rescaling and chroma conversion) but these operations can be CPU intensive.
00272  *
00273  * \param opaque pointer to the private pointer passed to
00274  *               libvlc_video_set_callbacks() [IN/OUT]
00275  * \param chroma pointer to the 4 bytes video format identifier [IN/OUT]
00276  * \param width pointer to the pixel width [IN/OUT]
00277  * \param height pointer to the pixel height [IN/OUT]
00278  * \param pitches table of scanline pitches in bytes for each pixel plane
00279  *                (the table is allocated by LibVLC) [OUT]
00280  * \param lines table of scanlines count for each plane [OUT]
00281  * \return the number of picture buffers allocated, 0 indicates failure
00282  *
00283  * \note
00284  * For each pixels plane, the scanline pitch must be bigger than or equal to
00285  * the number of bytes per pixel multiplied by the pixel width.
00286  * Similarly, the number of scanlines must be bigger than of equal to
00287  * the pixel height.
00288  * Furthermore, we recommend that pitches and lines be multiple of 32
00289  * to not break assumption that might be made by various optimizations
00290  * in the video decoders, video filters and/or video converters.
00291  */
00292 typedef unsigned (*libvlc_video_format_cb)(void **opaque, char *chroma,
00293                                            unsigned *width, unsigned *height,
00294                                            unsigned *pitches,
00295                                            unsigned *lines);
00296 
00297 /**
00298  * Callback prototype to configure picture buffers format.
00299  *
00300  * \param opaque private pointer as passed to libvlc_video_set_callbacks()
00301  *               (and possibly modified by @ref libvlc_video_format_cb) [IN]
00302  */
00303 typedef void (*libvlc_video_cleanup_cb)(void *opaque);
00304 
00305 
00306 /**
00307  * Set callbacks and private data to render decoded video to a custom area
00308  * in memory.
00309  * Use libvlc_video_set_format() or libvlc_video_set_format_callbacks()
00310  * to configure the decoded format.
00311  *
00312  * \param mp the media player
00313  * \param lock callback to lock video memory (must not be NULL)
00314  * \param unlock callback to unlock video memory (or NULL if not needed)
00315  * \param display callback to display video (or NULL if not needed)
00316  * \param opaque private pointer for the three callbacks (as first parameter)
00317  * \version LibVLC 1.1.1 or later
00318  */
00319 LIBVLC_API
00320 void libvlc_video_set_callbacks( libvlc_media_player_t *mp,
00321                                  libvlc_video_lock_cb lock,
00322                                  libvlc_video_unlock_cb unlock,
00323                                  libvlc_video_display_cb display,
00324                                  void *opaque );
00325 
00326 /**
00327  * Set decoded video chroma and dimensions.
00328  * This only works in combination with libvlc_video_set_callbacks(),
00329  * and is mutually exclusive with libvlc_video_set_format_callbacks().
00330  *
00331  * \param mp the media player
00332  * \param chroma a four-characters string identifying the chroma
00333  *               (e.g. "RV32" or "YUYV")
00334  * \param width pixel width
00335  * \param height pixel height
00336  * \param pitch line pitch (in bytes)
00337  * \version LibVLC 1.1.1 or later
00338  * \bug All pixel planes are expected to have the same pitch.
00339  * To use the YCbCr color space with chrominance subsampling,
00340  * consider using libvlc_video_set_format_callbacks() instead.
00341  */
00342 LIBVLC_API
00343 void libvlc_video_set_format( libvlc_media_player_t *mp, const char *chroma,
00344                               unsigned width, unsigned height,
00345                               unsigned pitch );
00346 
00347 /**
00348  * Set decoded video chroma and dimensions. This only works in combination with
00349  * libvlc_video_set_callbacks().
00350  *
00351  * \param mp the media player
00352  * \param setup callback to select the video format (cannot be NULL)
00353  * \param cleanup callback to release any allocated resources (or NULL)
00354  * \version LibVLC 2.0.0 or later
00355  */
00356 LIBVLC_API
00357 void libvlc_video_set_format_callbacks( libvlc_media_player_t *mp,
00358                                         libvlc_video_format_cb setup,
00359                                         libvlc_video_cleanup_cb cleanup );
00360 
00361 /**
00362  * Set the NSView handler where the media player should render its video output.
00363  *
00364  * Use the vout called "macosx".
00365  *
00366  * The drawable is an NSObject that follow the VLCOpenGLVideoViewEmbedding
00367  * protocol:
00368  *
00369  * @begincode
00370  * \@protocol VLCOpenGLVideoViewEmbedding <NSObject>
00371  * - (void)addVoutSubview:(NSView *)view;
00372  * - (void)removeVoutSubview:(NSView *)view;
00373  * \@end
00374  * @endcode
00375  *
00376  * Or it can be an NSView object.
00377  *
00378  * If you want to use it along with Qt4 see the QMacCocoaViewContainer. Then
00379  * the following code should work:
00380  * @begincode
00381  * {
00382  *     NSView *video = [[NSView alloc] init];
00383  *     QMacCocoaViewContainer *container = new QMacCocoaViewContainer(video, parent);
00384  *     libvlc_media_player_set_nsobject(mp, video);
00385  *     [video release];
00386  * }
00387  * @endcode
00388  *
00389  * You can find a live example in VLCVideoView in VLCKit.framework.
00390  *
00391  * \param p_mi the Media Player
00392  * \param drawable the drawable that is either an NSView or an object following
00393  * the VLCOpenGLVideoViewEmbedding protocol.
00394  */
00395 LIBVLC_API void libvlc_media_player_set_nsobject ( libvlc_media_player_t *p_mi, void * drawable );
00396 
00397 /**
00398  * Get the NSView handler previously set with libvlc_media_player_set_nsobject().
00399  *
00400  * \param p_mi the Media Player
00401  * \return the NSView handler or 0 if none where set
00402  */
00403 LIBVLC_API void * libvlc_media_player_get_nsobject ( libvlc_media_player_t *p_mi );
00404 
00405 /**
00406  * Set the agl handler where the media player should render its video output.
00407  *
00408  * \param p_mi the Media Player
00409  * \param drawable the agl handler
00410  */
00411 LIBVLC_API void libvlc_media_player_set_agl ( libvlc_media_player_t *p_mi, uint32_t drawable );
00412 
00413 /**
00414  * Get the agl handler previously set with libvlc_media_player_set_agl().
00415  *
00416  * \param p_mi the Media Player
00417  * \return the agl handler or 0 if none where set
00418  */
00419 LIBVLC_API uint32_t libvlc_media_player_get_agl ( libvlc_media_player_t *p_mi );
00420 
00421 /**
00422  * Set an X Window System drawable where the media player should render its
00423  * video output. If LibVLC was built without X11 output support, then this has
00424  * no effects.
00425  *
00426  * The specified identifier must correspond to an existing Input/Output class
00427  * X11 window. Pixmaps are <b>not</b> supported. The caller shall ensure that
00428  * the X11 server is the same as the one the VLC instance has been configured
00429  * with. This function must be called before video playback is started;
00430  * otherwise it will only take effect after playback stop and restart.
00431  *
00432  * \param p_mi the Media Player
00433  * \param drawable the ID of the X window
00434  */
00435 LIBVLC_API void libvlc_media_player_set_xwindow ( libvlc_media_player_t *p_mi, uint32_t drawable );
00436 
00437 /**
00438  * Get the X Window System window identifier previously set with
00439  * libvlc_media_player_set_xwindow(). Note that this will return the identifier
00440  * even if VLC is not currently using it (for instance if it is playing an
00441  * audio-only input).
00442  *
00443  * \param p_mi the Media Player
00444  * \return an X window ID, or 0 if none where set.
00445  */
00446 LIBVLC_API uint32_t libvlc_media_player_get_xwindow ( libvlc_media_player_t *p_mi );
00447 
00448 /**
00449  * Set a Win32/Win64 API window handle (HWND) where the media player should
00450  * render its video output. If LibVLC was built without Win32/Win64 API output
00451  * support, then this has no effects.
00452  *
00453  * \param p_mi the Media Player
00454  * \param drawable windows handle of the drawable
00455  */
00456 LIBVLC_API void libvlc_media_player_set_hwnd ( libvlc_media_player_t *p_mi, void *drawable );
00457 
00458 /**
00459  * Get the Windows API window handle (HWND) previously set with
00460  * libvlc_media_player_set_hwnd(). The handle will be returned even if LibVLC
00461  * is not currently outputting any video to it.
00462  *
00463  * \param p_mi the Media Player
00464  * \return a window handle or NULL if there are none.
00465  */
00466 LIBVLC_API void *libvlc_media_player_get_hwnd ( libvlc_media_player_t *p_mi );
00467 
00468 /**
00469  * Callback prototype for audio playback.
00470  * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
00471  * \param samples pointer to the first audio sample to play back [IN]
00472  * \param count number of audio samples to play back
00473  * \param pts expected play time stamp (see libvlc_delay())
00474  */
00475 typedef void (*libvlc_audio_play_cb)(void *data, const void *samples,
00476                                      unsigned count, int64_t pts);
00477 
00478 /**
00479  * Callback prototype for audio pause.
00480  * \note The pause callback is never called if the audio is already paused.
00481  * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
00482  * \param pts time stamp of the pause request (should be elapsed already)
00483  */
00484 typedef void (*libvlc_audio_pause_cb)(void *data, int64_t pts);
00485 
00486 /**
00487  * Callback prototype for audio resumption (i.e. restart from pause).
00488  * \note The resume callback is never called if the audio is not paused.
00489  * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
00490  * \param pts time stamp of the resumption request (should be elapsed already)
00491  */
00492 typedef void (*libvlc_audio_resume_cb)(void *data, int64_t pts);
00493 
00494 /**
00495  * Callback prototype for audio buffer flush
00496  * (i.e. discard all pending buffers and stop playback as soon as possible).
00497  * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
00498  */
00499 typedef void (*libvlc_audio_flush_cb)(void *data, int64_t pts);
00500 
00501 /**
00502  * Callback prototype for audio buffer drain
00503  * (i.e. wait for pending buffers to be played).
00504  * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
00505  */
00506 typedef void (*libvlc_audio_drain_cb)(void *data);
00507 
00508 /**
00509  * Callback prototype for audio volume change.
00510  * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
00511  * \param volume software volume (1. = nominal, 0. = mute)
00512  * \param mute muted flag
00513  */
00514 typedef void (*libvlc_audio_set_volume_cb)(void *data,
00515                                            float volume, bool mute);
00516 
00517 /**
00518  * Set callbacks and private data for decoded audio.
00519  * Use libvlc_audio_set_format() or libvlc_audio_set_format_callbacks()
00520  * to configure the decoded audio format.
00521  *
00522  * \param mp the media player
00523  * \param play callback to play audio samples (must not be NULL)
00524  * \param pause callback to pause playback (or NULL to ignore)
00525  * \param resume callback to resume playback (or NULL to ignore)
00526  * \param flush callback to flush audio buffers (or NULL to ignore)
00527  * \param drain callback to drain audio buffers (or NULL to ignore)
00528  * \param opaque private pointer for the audio callbacks (as first parameter)
00529  * \version LibVLC 2.0.0 or later
00530  */
00531 LIBVLC_API
00532 void libvlc_audio_set_callbacks( libvlc_media_player_t *mp,
00533                                  libvlc_audio_play_cb play,
00534                                  libvlc_audio_pause_cb pause,
00535                                  libvlc_audio_resume_cb resume,
00536                                  libvlc_audio_flush_cb flush,
00537                                  libvlc_audio_drain_cb drain,
00538                                  void *opaque );
00539 
00540 /**
00541  * Set callbacks and private data for decoded audio.
00542  * Use libvlc_audio_set_format() or libvlc_audio_set_format_callbacks()
00543  * to configure the decoded audio format.
00544  *
00545  * \param mp the media player
00546  * \param set_volume callback to apply audio volume,
00547  *                   or NULL to apply volume in software
00548  * \version LibVLC 2.0.0 or later
00549  */
00550 LIBVLC_API
00551 void libvlc_audio_set_volume_callback( libvlc_media_player_t *mp,
00552                                        libvlc_audio_set_volume_cb set_volume );
00553 
00554 /**
00555  * Callback prototype to setup the audio playback.
00556  * This is called when the media player needs to create a new audio output.
00557  * \param opaque pointer to the data pointer passed to
00558  *               libvlc_audio_set_callbacks() [IN/OUT]
00559  * \param format 4 bytes sample format [IN/OUT]
00560  * \param rate sample rate [IN/OUT]
00561  * \param channels channels count [IN/OUT]
00562  * \return 0 on success, anything else to skip audio playback
00563  */
00564 typedef int (*libvlc_audio_setup_cb)(void **data, char *format, unsigned *rate,
00565                                      unsigned *channels);
00566 
00567 /**
00568  * Callback prototype for audio playback cleanup.
00569  * This is called when the media player no longer needs an audio output.
00570  * \param opaque data pointer as passed to libvlc_audio_set_callbacks() [IN]
00571  */
00572 typedef void (*libvlc_audio_cleanup_cb)(void *data);
00573 
00574 /**
00575  * Set decoded audio format. This only works in combination with
00576  * libvlc_audio_set_callbacks().
00577  *
00578  * \param mp the media player
00579  * \param setup callback to select the audio format (cannot be NULL)
00580  * \param cleanup callback to release any allocated resources (or NULL)
00581  * \version LibVLC 2.0.0 or later
00582  */
00583 LIBVLC_API
00584 void libvlc_audio_set_format_callbacks( libvlc_media_player_t *mp,
00585                                         libvlc_audio_setup_cb setup,
00586                                         libvlc_audio_cleanup_cb cleanup );
00587 
00588 /**
00589  * Set decoded audio format.
00590  * This only works in combination with libvlc_audio_set_callbacks(),
00591  * and is mutually exclusive with libvlc_audio_set_format_callbacks().
00592  *
00593  * \param mp the media player
00594  * \param format a four-characters string identifying the sample format
00595  *               (e.g. "S16N" or "FL32")
00596  * \param rate sample rate (expressed in Hz)
00597  * \param channels channels count
00598  * \version LibVLC 2.0.0 or later
00599  */
00600 LIBVLC_API
00601 void libvlc_audio_set_format( libvlc_media_player_t *mp, const char *format,
00602                               unsigned rate, unsigned channels );
00603 
00604 /** \bug This might go away ... to be replaced by a broader system */
00605 
00606 /**
00607  * Get the current movie length (in ms).
00608  *
00609  * \param p_mi the Media Player
00610  * \return the movie length (in ms), or -1 if there is no media.
00611  */
00612 LIBVLC_API libvlc_time_t libvlc_media_player_get_length( libvlc_media_player_t *p_mi );
00613 
00614 /**
00615  * Get the current movie time (in ms).
00616  *
00617  * \param p_mi the Media Player
00618  * \return the movie time (in ms), or -1 if there is no media.
00619  */
00620 LIBVLC_API libvlc_time_t libvlc_media_player_get_time( libvlc_media_player_t *p_mi );
00621 
00622 /**
00623  * Set the movie time (in ms). This has no effect if no media is being played.
00624  * Not all formats and protocols support this.
00625  *
00626  * \param p_mi the Media Player
00627  * \param i_time the movie time (in ms).
00628  */
00629 LIBVLC_API void libvlc_media_player_set_time( libvlc_media_player_t *p_mi, libvlc_time_t i_time );
00630 
00631 /**
00632  * Get movie position.
00633  *
00634  * \param p_mi the Media Player
00635  * \return movie position, or -1. in case of error
00636  */
00637 LIBVLC_API float libvlc_media_player_get_position( libvlc_media_player_t *p_mi );
00638 
00639 /**
00640  * Set movie position. This has no effect if playback is not enabled.
00641  * This might not work depending on the underlying input format and protocol.
00642  *
00643  * \param p_mi the Media Player
00644  * \param f_pos the position
00645  */
00646 LIBVLC_API void libvlc_media_player_set_position( libvlc_media_player_t *p_mi, float f_pos );
00647 
00648 /**
00649  * Set movie chapter (if applicable).
00650  *
00651  * \param p_mi the Media Player
00652  * \param i_chapter chapter number to play
00653  */
00654 LIBVLC_API void libvlc_media_player_set_chapter( libvlc_media_player_t *p_mi, int i_chapter );
00655 
00656 /**
00657  * Get movie chapter.
00658  *
00659  * \param p_mi the Media Player
00660  * \return chapter number currently playing, or -1 if there is no media.
00661  */
00662 LIBVLC_API int libvlc_media_player_get_chapter( libvlc_media_player_t *p_mi );
00663 
00664 /**
00665  * Get movie chapter count
00666  *
00667  * \param p_mi the Media Player
00668  * \return number of chapters in movie, or -1.
00669  */
00670 LIBVLC_API int libvlc_media_player_get_chapter_count( libvlc_media_player_t *p_mi );
00671 
00672 /**
00673  * Is the player able to play
00674  *
00675  * \param p_mi the Media Player
00676  * \return boolean
00677  *
00678  * \libvlc_return_bool
00679  */
00680 LIBVLC_API int libvlc_media_player_will_play( libvlc_media_player_t *p_mi );
00681 
00682 /**
00683  * Get title chapter count
00684  *
00685  * \param p_mi the Media Player
00686  * \param i_title title
00687  * \return number of chapters in title, or -1
00688  */
00689 LIBVLC_API int libvlc_media_player_get_chapter_count_for_title(
00690                        libvlc_media_player_t *p_mi, int i_title );
00691 
00692 /**
00693  * Set movie title
00694  *
00695  * \param p_mi the Media Player
00696  * \param i_title title number to play
00697  */
00698 LIBVLC_API void libvlc_media_player_set_title( libvlc_media_player_t *p_mi, int i_title );
00699 
00700 /**
00701  * Get movie title
00702  *
00703  * \param p_mi the Media Player
00704  * \return title number currently playing, or -1
00705  */
00706 LIBVLC_API int libvlc_media_player_get_title( libvlc_media_player_t *p_mi );
00707 
00708 /**
00709  * Get movie title count
00710  *
00711  * \param p_mi the Media Player
00712  * \return title number count, or -1
00713  */
00714 LIBVLC_API int libvlc_media_player_get_title_count( libvlc_media_player_t *p_mi );
00715 
00716 /**
00717  * Set previous chapter (if applicable)
00718  *
00719  * \param p_mi the Media Player
00720  */
00721 LIBVLC_API void libvlc_media_player_previous_chapter( libvlc_media_player_t *p_mi );
00722 
00723 /**
00724  * Set next chapter (if applicable)
00725  *
00726  * \param p_mi the Media Player
00727  */
00728 LIBVLC_API void libvlc_media_player_next_chapter( libvlc_media_player_t *p_mi );
00729 
00730 /**
00731  * Get the requested movie play rate.
00732  * @warning Depending on the underlying media, the requested rate may be
00733  * different from the real playback rate.
00734  *
00735  * \param p_mi the Media Player
00736  * \return movie play rate
00737  */
00738 LIBVLC_API float libvlc_media_player_get_rate( libvlc_media_player_t *p_mi );
00739 
00740 /**
00741  * Set movie play rate
00742  *
00743  * \param p_mi the Media Player
00744  * \param rate movie play rate to set
00745  * \return -1 if an error was detected, 0 otherwise (but even then, it might
00746  * not actually work depending on the underlying media protocol)
00747  */
00748 LIBVLC_API int libvlc_media_player_set_rate( libvlc_media_player_t *p_mi, float rate );
00749 
00750 /**
00751  * Get current movie state
00752  *
00753  * \param p_mi the Media Player
00754  * \return the current state of the media player (playing, paused, ...) \see libvlc_state_t
00755  */
00756 LIBVLC_API libvlc_state_t libvlc_media_player_get_state( libvlc_media_player_t *p_mi );
00757 
00758 /**
00759  * Get movie fps rate
00760  *
00761  * \param p_mi the Media Player
00762  * \return frames per second (fps) for this playing movie, or 0 if unspecified
00763  */
00764 LIBVLC_API float libvlc_media_player_get_fps( libvlc_media_player_t *p_mi );
00765 
00766 /** end bug */
00767 
00768 /**
00769  * How many video outputs does this media player have?
00770  *
00771  * \param p_mi the media player
00772  * \return the number of video outputs
00773  */
00774 LIBVLC_API unsigned libvlc_media_player_has_vout( libvlc_media_player_t *p_mi );
00775 
00776 /**
00777  * Is this media player seekable?
00778  *
00779  * \param p_mi the media player
00780  * \return true if the media player can seek
00781  *
00782  * \libvlc_return_bool
00783  */
00784 LIBVLC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi );
00785 
00786 /**
00787  * Can this media player be paused?
00788  *
00789  * \param p_mi the media player
00790  * \return true if the media player can pause
00791  *
00792  * \libvlc_return_bool
00793  */
00794 LIBVLC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi );
00795 
00796 
00797 /**
00798  * Display the next frame (if supported)
00799  *
00800  * \param p_mi the media player
00801  */
00802 LIBVLC_API void libvlc_media_player_next_frame( libvlc_media_player_t *p_mi );
00803 
00804 /**
00805  * Navigate through DVD Menu
00806  *
00807  * \param p_mi the Media Player
00808  * \param navigate the Navigation mode
00809  * \version libVLC 2.0.0 or later
00810  */
00811 LIBVLC_API void libvlc_media_player_navigate( libvlc_media_player_t* p_mi,
00812                                               unsigned navigate );
00813 
00814 /**
00815  * Release (free) libvlc_track_description_t
00816  *
00817  * \param p_track_description the structure to release
00818  */
00819 LIBVLC_API void libvlc_track_description_list_release( libvlc_track_description_t *p_track_description );
00820 
00821 /**
00822  * \deprecated Use libvlc_track_description_list_release instead
00823  */
00824 LIBVLC_DEPRECATED
00825 LIBVLC_API void libvlc_track_description_release( libvlc_track_description_t *p_track_description );
00826 
00827 /** \defgroup libvlc_video LibVLC video controls
00828  * @{
00829  */
00830 
00831 /**
00832  * Toggle fullscreen status on non-embedded video outputs.
00833  *
00834  * @warning The same limitations applies to this function
00835  * as to libvlc_set_fullscreen().
00836  *
00837  * \param p_mi the media player
00838  */
00839 LIBVLC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *p_mi );
00840 
00841 /**
00842  * Enable or disable fullscreen.
00843  *
00844  * @warning With most window managers, only a top-level windows can be in
00845  * full-screen mode. Hence, this function will not operate properly if
00846  * libvlc_media_player_set_xwindow() was used to embed the video in a
00847  * non-top-level window. In that case, the embedding window must be reparented
00848  * to the root window <b>before</b> fullscreen mode is enabled. You will want
00849  * to reparent it back to its normal parent when disabling fullscreen.
00850  *
00851  * \param p_mi the media player
00852  * \param b_fullscreen boolean for fullscreen status
00853  */
00854 LIBVLC_API void libvlc_set_fullscreen( libvlc_media_player_t *p_mi, int b_fullscreen );
00855 
00856 /**
00857  * Get current fullscreen status.
00858  *
00859  * \param p_mi the media player
00860  * \return the fullscreen status (boolean)
00861  *
00862  * \libvlc_return_bool
00863  */
00864 LIBVLC_API int libvlc_get_fullscreen( libvlc_media_player_t *p_mi );
00865 
00866 /**
00867  * Enable or disable key press events handling, according to the LibVLC hotkeys
00868  * configuration. By default and for historical reasons, keyboard events are
00869  * handled by the LibVLC video widget.
00870  *
00871  * \note On X11, there can be only one subscriber for key press and mouse
00872  * click events per window. If your application has subscribed to those events
00873  * for the X window ID of the video widget, then LibVLC will not be able to
00874  * handle key presses and mouse clicks in any case.
00875  *
00876  * \warning This function is only implemented for X11 and Win32 at the moment.
00877  *
00878  * \param p_mi the media player
00879  * \param on true to handle key press events, false to ignore them.
00880  */
00881 LIBVLC_API
00882 void libvlc_video_set_key_input( libvlc_media_player_t *p_mi, unsigned on );
00883 
00884 /**
00885  * Enable or disable mouse click events handling. By default, those events are
00886  * handled. This is needed for DVD menus to work, as well as a few video
00887  * filters such as "puzzle".
00888  *
00889  * \see libvlc_video_set_key_input().
00890  *
00891  * \warning This function is only implemented for X11 and Win32 at the moment.
00892  *
00893  * \param p_mi the media player
00894  * \param on true to handle mouse click events, false to ignore them.
00895  */
00896 LIBVLC_API
00897 void libvlc_video_set_mouse_input( libvlc_media_player_t *p_mi, unsigned on );
00898 
00899 /**
00900  * Get the pixel dimensions of a video.
00901  *
00902  * \param p_mi media player
00903  * \param num number of the video (starting from, and most commonly 0)
00904  * \param px pointer to get the pixel width [OUT]
00905  * \param py pointer to get the pixel height [OUT]
00906  * \return 0 on success, -1 if the specified video does not exist
00907  */
00908 LIBVLC_API
00909 int libvlc_video_get_size( libvlc_media_player_t *p_mi, unsigned num,
00910                            unsigned *px, unsigned *py );
00911 
00912 /**
00913  * Get current video height.
00914  * \deprecated Use libvlc_video_get_size() instead.
00915  *
00916  * \param p_mi the media player
00917  * \return the video pixel height or 0 if not applicable
00918  */
00919 LIBVLC_DEPRECATED LIBVLC_API
00920 int libvlc_video_get_height( libvlc_media_player_t *p_mi );
00921 
00922 /**
00923  * Get current video width.
00924  * \deprecated Use libvlc_video_get_size() instead.
00925  *
00926  * \param p_mi the media player
00927  * \return the video pixel width or 0 if not applicable
00928  */
00929 LIBVLC_DEPRECATED LIBVLC_API
00930 int libvlc_video_get_width( libvlc_media_player_t *p_mi );
00931 
00932 /**
00933  * Get the mouse pointer coordinates over a video.
00934  * Coordinates are expressed in terms of the decoded video resolution,
00935  * <b>not</b> in terms of pixels on the screen/viewport (to get the latter,
00936  * you can query your windowing system directly).
00937  *
00938  * Either of the coordinates may be negative or larger than the corresponding
00939  * dimension of the video, if the cursor is outside the rendering area.
00940  *
00941  * @warning The coordinates may be out-of-date if the pointer is not located
00942  * on the video rendering area. LibVLC does not track the pointer if it is
00943  * outside of the video widget.
00944  *
00945  * @note LibVLC does not support multiple pointers (it does of course support
00946  * multiple input devices sharing the same pointer) at the moment.
00947  *
00948  * \param p_mi media player
00949  * \param num number of the video (starting from, and most commonly 0)
00950  * \param px pointer to get the abscissa [OUT]
00951  * \param py pointer to get the ordinate [OUT]
00952  * \return 0 on success, -1 if the specified video does not exist
00953  */
00954 LIBVLC_API
00955 int libvlc_video_get_cursor( libvlc_media_player_t *p_mi, unsigned num,
00956                              int *px, int *py );
00957 
00958 /**
00959  * Get the current video scaling factor.
00960  * See also libvlc_video_set_scale().
00961  *
00962  * \param p_mi the media player
00963  * \return the currently configured zoom factor, or 0. if the video is set
00964  * to fit to the output window/drawable automatically.
00965  */
00966 LIBVLC_API float libvlc_video_get_scale( libvlc_media_player_t *p_mi );
00967 
00968 /**
00969  * Set the video scaling factor. That is the ratio of the number of pixels on
00970  * screen to the number of pixels in the original decoded video in each
00971  * dimension. Zero is a special value; it will adjust the video to the output
00972  * window/drawable (in windowed mode) or the entire screen.
00973  *
00974  * Note that not all video outputs support scaling.
00975  *
00976  * \param p_mi the media player
00977  * \param f_factor the scaling factor, or zero
00978  */
00979 LIBVLC_API void libvlc_video_set_scale( libvlc_media_player_t *p_mi, float f_factor );
00980 
00981 /**
00982  * Get current video aspect ratio.
00983  *
00984  * \param p_mi the media player
00985  * \return the video aspect ratio or NULL if unspecified
00986  * (the result must be released with free() or libvlc_free()).
00987  */
00988 LIBVLC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *p_mi );
00989 
00990 /**
00991  * Set new video aspect ratio.
00992  *
00993  * \param p_mi the media player
00994  * \param psz_aspect new video aspect-ratio or NULL to reset to default
00995  * \note Invalid aspect ratios are ignored.
00996  */
00997 LIBVLC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *p_mi, const char *psz_aspect );
00998 
00999 /**
01000  * Get current video subtitle.
01001  *
01002  * \param p_mi the media player
01003  * \return the video subtitle selected, or -1 if none
01004  */
01005 LIBVLC_API int libvlc_video_get_spu( libvlc_media_player_t *p_mi );
01006 
01007 /**
01008  * Get the number of available video subtitles.
01009  *
01010  * \param p_mi the media player
01011  * \return the number of available video subtitles
01012  */
01013 LIBVLC_API int libvlc_video_get_spu_count( libvlc_media_player_t *p_mi );
01014 
01015 /**
01016  * Get the description of available video subtitles.
01017  *
01018  * \param p_mi the media player
01019  * \return list containing description of available video subtitles
01020  */
01021 LIBVLC_API libvlc_track_description_t *
01022         libvlc_video_get_spu_description( libvlc_media_player_t *p_mi );
01023 
01024 /**
01025  * Set new video subtitle.
01026  *
01027  * \param p_mi the media player
01028  * \param i_spu new video subtitle to select
01029  * \return 0 on success, -1 if out of range
01030  */
01031 LIBVLC_API int libvlc_video_set_spu( libvlc_media_player_t *p_mi, unsigned i_spu );
01032 
01033 /**
01034  * Set new video subtitle file.
01035  *
01036  * \param p_mi the media player
01037  * \param psz_subtitle new video subtitle file
01038  * \return the success status (boolean)
01039  */
01040 LIBVLC_API int libvlc_video_set_subtitle_file( libvlc_media_player_t *p_mi, const char *psz_subtitle );
01041 
01042 /**
01043  * Get the current subtitle delay. Positive values means subtitles are being
01044  * displayed later, negative values earlier.
01045  *
01046  * \param p_mi media player
01047  * \return time (in microseconds) the display of subtitles is being delayed
01048  * \version LibVLC 2.0.0 or later
01049  */
01050 LIBVLC_API int64_t libvlc_video_get_spu_delay( libvlc_media_player_t *p_mi );
01051 
01052 /**
01053  * Set the subtitle delay. This affects the timing of when the subtitle will
01054  * be displayed. Positive values result in subtitles being displayed later,
01055  * while negative values will result in subtitles being displayed earlier.
01056  *
01057  * The subtitle delay will be reset to zero each time the media changes.
01058  *
01059  * \param p_mi media player
01060  * \param i_delay time (in microseconds) the display of subtitles should be delayed
01061  * \return 0 on success, -1 on error
01062  * \version LibVLC 2.0.0 or later
01063  */
01064 LIBVLC_API int libvlc_video_set_spu_delay( libvlc_media_player_t *p_mi, int64_t i_delay );
01065 
01066 /**
01067  * Get the description of available titles.
01068  *
01069  * \param p_mi the media player
01070  * \return list containing description of available titles
01071  */
01072 LIBVLC_API libvlc_track_description_t *
01073         libvlc_video_get_title_description( libvlc_media_player_t *p_mi );
01074 
01075 /**
01076  * Get the description of available chapters for specific title.
01077  *
01078  * \param p_mi the media player
01079  * \param i_title selected title
01080  * \return list containing description of available chapter for title i_title
01081  */
01082 LIBVLC_API libvlc_track_description_t *
01083         libvlc_video_get_chapter_description( libvlc_media_player_t *p_mi, int i_title );
01084 
01085 /**
01086  * Get current crop filter geometry.
01087  *
01088  * \param p_mi the media player
01089  * \return the crop filter geometry or NULL if unset
01090  */
01091 LIBVLC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *p_mi );
01092 
01093 /**
01094  * Set new crop filter geometry.
01095  *
01096  * \param p_mi the media player
01097  * \param psz_geometry new crop filter geometry (NULL to unset)
01098  */
01099 LIBVLC_API
01100 void libvlc_video_set_crop_geometry( libvlc_media_player_t *p_mi, const char *psz_geometry );
01101 
01102 /**
01103  * Get current teletext page requested.
01104  *
01105  * \param p_mi the media player
01106  * \return the current teletext page requested.
01107  */
01108 LIBVLC_API int libvlc_video_get_teletext( libvlc_media_player_t *p_mi );
01109 
01110 /**
01111  * Set new teletext page to retrieve.
01112  *
01113  * \param p_mi the media player
01114  * \param i_page teletex page number requested
01115  */
01116 LIBVLC_API void libvlc_video_set_teletext( libvlc_media_player_t *p_mi, int i_page );
01117 
01118 /**
01119  * Toggle teletext transparent status on video output.
01120  *
01121  * \param p_mi the media player
01122  */
01123 LIBVLC_API void libvlc_toggle_teletext( libvlc_media_player_t *p_mi );
01124 
01125 /**
01126  * Get number of available video tracks.
01127  *
01128  * \param p_mi media player
01129  * \return the number of available video tracks (int)
01130  */
01131 LIBVLC_API int libvlc_video_get_track_count( libvlc_media_player_t *p_mi );
01132 
01133 /**
01134  * Get the description of available video tracks.
01135  *
01136  * \param p_mi media player
01137  * \return list with description of available video tracks, or NULL on error
01138  */
01139 LIBVLC_API libvlc_track_description_t *
01140         libvlc_video_get_track_description( libvlc_media_player_t *p_mi );
01141 
01142 /**
01143  * Get current video track.
01144  *
01145  * \param p_mi media player
01146  * \return the video track (int) or -1 if none
01147  */
01148 LIBVLC_API int libvlc_video_get_track( libvlc_media_player_t *p_mi );
01149 
01150 /**
01151  * Set video track.
01152  *
01153  * \param p_mi media player
01154  * \param i_track the track (int)
01155  * \return 0 on success, -1 if out of range
01156  */
01157 LIBVLC_API
01158 int libvlc_video_set_track( libvlc_media_player_t *p_mi, int i_track );
01159 
01160 /**
01161  * Take a snapshot of the current video window.
01162  *
01163  * If i_width AND i_height is 0, original size is used.
01164  * If i_width XOR i_height is 0, original aspect-ratio is preserved.
01165  *
01166  * \param p_mi media player instance
01167  * \param num number of video output (typically 0 for the first/only one)
01168  * \param psz_filepath the path where to save the screenshot to
01169  * \param i_width the snapshot's width
01170  * \param i_height the snapshot's height
01171  * \return 0 on success, -1 if the video was not found
01172  */
01173 LIBVLC_API
01174 int libvlc_video_take_snapshot( libvlc_media_player_t *p_mi, unsigned num,
01175                                 const char *psz_filepath, unsigned int i_width,
01176                                 unsigned int i_height );
01177 
01178 /**
01179  * Enable or disable deinterlace filter
01180  *
01181  * \param p_mi libvlc media player
01182  * \param psz_mode type of deinterlace filter, NULL to disable
01183  */
01184 LIBVLC_API void libvlc_video_set_deinterlace( libvlc_media_player_t *p_mi,
01185                                                   const char *psz_mode );
01186 
01187 /**
01188  * Get an integer marquee option value
01189  *
01190  * \param p_mi libvlc media player
01191  * \param option marq option to get \see libvlc_video_marquee_int_option_t
01192  */
01193 LIBVLC_API int libvlc_video_get_marquee_int( libvlc_media_player_t *p_mi,
01194                                                  unsigned option );
01195 
01196 /**
01197  * Get a string marquee option value
01198  *
01199  * \param p_mi libvlc media player
01200  * \param option marq option to get \see libvlc_video_marquee_string_option_t
01201  */
01202 LIBVLC_API char *libvlc_video_get_marquee_string( libvlc_media_player_t *p_mi,
01203                                                       unsigned option );
01204 
01205 /**
01206  * Enable, disable or set an integer marquee option
01207  *
01208  * Setting libvlc_marquee_Enable has the side effect of enabling (arg !0)
01209  * or disabling (arg 0) the marq filter.
01210  *
01211  * \param p_mi libvlc media player
01212  * \param option marq option to set \see libvlc_video_marquee_int_option_t
01213  * \param i_val marq option value
01214  */
01215 LIBVLC_API void libvlc_video_set_marquee_int( libvlc_media_player_t *p_mi,
01216                                                   unsigned option, int i_val );
01217 
01218 /**
01219  * Set a marquee string option
01220  *
01221  * \param p_mi libvlc media player
01222  * \param option marq option to set \see libvlc_video_marquee_string_option_t
01223  * \param psz_text marq option value
01224  */
01225 LIBVLC_API void libvlc_video_set_marquee_string( libvlc_media_player_t *p_mi,
01226                                                      unsigned option, const char *psz_text );
01227 
01228 /** option values for libvlc_video_{get,set}_logo_{int,string} */
01229 enum libvlc_video_logo_option_t {
01230     libvlc_logo_enable,
01231     libvlc_logo_file,           /**< string argument, "file,d,t;file,d,t;..." */
01232     libvlc_logo_x,
01233     libvlc_logo_y,
01234     libvlc_logo_delay,
01235     libvlc_logo_repeat,
01236     libvlc_logo_opacity,
01237     libvlc_logo_position
01238 };
01239 
01240 /**
01241  * Get integer logo option.
01242  *
01243  * \param p_mi libvlc media player instance
01244  * \param option logo option to get, values of libvlc_video_logo_option_t
01245  */
01246 LIBVLC_API int libvlc_video_get_logo_int( libvlc_media_player_t *p_mi,
01247                                               unsigned option );
01248 
01249 /**
01250  * Set logo option as integer. Options that take a different type value
01251  * are ignored.
01252  * Passing libvlc_logo_enable as option value has the side effect of
01253  * starting (arg !0) or stopping (arg 0) the logo filter.
01254  *
01255  * \param p_mi libvlc media player instance
01256  * \param option logo option to set, values of libvlc_video_logo_option_t
01257  * \param value logo option value
01258  */
01259 LIBVLC_API void libvlc_video_set_logo_int( libvlc_media_player_t *p_mi,
01260                                                unsigned option, int value );
01261 
01262 /**
01263  * Set logo option as string. Options that take a different type value
01264  * are ignored.
01265  *
01266  * \param p_mi libvlc media player instance
01267  * \param option logo option to set, values of libvlc_video_logo_option_t
01268  * \param psz_value logo option value
01269  */
01270 LIBVLC_API void libvlc_video_set_logo_string( libvlc_media_player_t *p_mi,
01271                                       unsigned option, const char *psz_value );
01272 
01273 
01274 /** option values for libvlc_video_{get,set}_adjust_{int,float,bool} */
01275 enum libvlc_video_adjust_option_t {
01276     libvlc_adjust_Enable = 0,
01277     libvlc_adjust_Contrast,
01278     libvlc_adjust_Brightness,
01279     libvlc_adjust_Hue,
01280     libvlc_adjust_Saturation,
01281     libvlc_adjust_Gamma
01282 };
01283 
01284 /**
01285  * Get integer adjust option.
01286  *
01287  * \param p_mi libvlc media player instance
01288  * \param option adjust option to get, values of libvlc_video_adjust_option_t
01289  * \version LibVLC 1.1.1 and later.
01290  */
01291 LIBVLC_API int libvlc_video_get_adjust_int( libvlc_media_player_t *p_mi,
01292                                                 unsigned option );
01293 
01294 /**
01295  * Set adjust option as integer. Options that take a different type value
01296  * are ignored.
01297  * Passing libvlc_adjust_enable as option value has the side effect of
01298  * starting (arg !0) or stopping (arg 0) the adjust filter.
01299  *
01300  * \param p_mi libvlc media player instance
01301  * \param option adust option to set, values of libvlc_video_adjust_option_t
01302  * \param value adjust option value
01303  * \version LibVLC 1.1.1 and later.
01304  */
01305 LIBVLC_API void libvlc_video_set_adjust_int( libvlc_media_player_t *p_mi,
01306                                                  unsigned option, int value );
01307 
01308 /**
01309  * Get float adjust option.
01310  *
01311  * \param p_mi libvlc media player instance
01312  * \param option adjust option to get, values of libvlc_video_adjust_option_t
01313  * \version LibVLC 1.1.1 and later.
01314  */
01315 LIBVLC_API float libvlc_video_get_adjust_float( libvlc_media_player_t *p_mi,
01316                                                     unsigned option );
01317 
01318 /**
01319  * Set adjust option as float. Options that take a different type value
01320  * are ignored.
01321  *
01322  * \param p_mi libvlc media player instance
01323  * \param option adust option to set, values of libvlc_video_adjust_option_t
01324  * \param value adjust option value
01325  * \version LibVLC 1.1.1 and later.
01326  */
01327 LIBVLC_API void libvlc_video_set_adjust_float( libvlc_media_player_t *p_mi,
01328                                                    unsigned option, float value );
01329 
01330 /** @} video */
01331 
01332 /** \defgroup libvlc_audio LibVLC audio controls
01333  * @{
01334  */
01335 
01336 /**
01337  * Audio device types
01338  */
01339 typedef enum libvlc_audio_output_device_types_t {
01340     libvlc_AudioOutputDevice_Error  = -1,
01341     libvlc_AudioOutputDevice_Mono   =  1,
01342     libvlc_AudioOutputDevice_Stereo =  2,
01343     libvlc_AudioOutputDevice_2F2R   =  4,
01344     libvlc_AudioOutputDevice_3F2R   =  5,
01345     libvlc_AudioOutputDevice_5_1    =  6,
01346     libvlc_AudioOutputDevice_6_1    =  7,
01347     libvlc_AudioOutputDevice_7_1    =  8,
01348     libvlc_AudioOutputDevice_SPDIF  = 10
01349 } libvlc_audio_output_device_types_t;
01350 
01351 /**
01352  * Audio channels
01353  */
01354 typedef enum libvlc_audio_output_channel_t {
01355     libvlc_AudioChannel_Error   = -1,
01356     libvlc_AudioChannel_Stereo  =  1,
01357     libvlc_AudioChannel_RStereo =  2,
01358     libvlc_AudioChannel_Left    =  3,
01359     libvlc_AudioChannel_Right   =  4,
01360     libvlc_AudioChannel_Dolbys  =  5
01361 } libvlc_audio_output_channel_t;
01362 
01363 
01364 /**
01365  * Get the list of available audio outputs
01366  *
01367  * \param p_instance libvlc instance
01368  * \return list of available audio outputs. It must be freed it with
01369 *          \see libvlc_audio_output_list_release \see libvlc_audio_output_t .
01370  *         In case of error, NULL is returned.
01371  */
01372 LIBVLC_API libvlc_audio_output_t *
01373         libvlc_audio_output_list_get( libvlc_instance_t *p_instance );
01374 
01375 /**
01376  * Free the list of available audio outputs
01377  *
01378  * \param p_list list with audio outputs for release
01379  */
01380 LIBVLC_API void libvlc_audio_output_list_release( libvlc_audio_output_t *p_list );
01381 
01382 /**
01383  * Set the audio output.
01384  * Change will be applied after stop and play.
01385  *
01386  * \param p_mi media player
01387  * \param psz_name name of audio output,
01388  *               use psz_name of \see libvlc_audio_output_t
01389  * \return 0 if function succeded, -1 on error
01390  */
01391 LIBVLC_API int libvlc_audio_output_set( libvlc_media_player_t *p_mi,
01392                                             const char *psz_name );
01393 
01394 /**
01395  * Get count of devices for audio output, these devices are hardware oriented
01396  * like analor or digital output of sound card
01397  *
01398  * \param p_instance libvlc instance
01399  * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
01400  * \return number of devices
01401  */
01402 LIBVLC_API int libvlc_audio_output_device_count( libvlc_instance_t *p_instance,
01403                                                      const char *psz_audio_output );
01404 
01405 /**
01406  * Get long name of device, if not available short name given
01407  *
01408  * \param p_instance libvlc instance
01409  * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
01410  * \param i_device device index
01411  * \return long name of device
01412  */
01413 LIBVLC_API char * libvlc_audio_output_device_longname( libvlc_instance_t *p_instance,
01414                                                            const char *psz_audio_output,
01415                                                            int i_device );
01416 
01417 /**
01418  * Get id name of device
01419  *
01420  * \param p_instance libvlc instance
01421  * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
01422  * \param i_device device index
01423  * \return id name of device, use for setting device, need to be free after use
01424  */
01425 LIBVLC_API char * libvlc_audio_output_device_id( libvlc_instance_t *p_instance,
01426                                                      const char *psz_audio_output,
01427                                                      int i_device );
01428 
01429 /**
01430  * Set audio output device. Changes are only effective after stop and play.
01431  *
01432  * \param p_mi media player
01433  * \param psz_audio_output - name of audio output, \see libvlc_audio_output_t
01434  * \param psz_device_id device
01435  */
01436 LIBVLC_API void libvlc_audio_output_device_set( libvlc_media_player_t *p_mi,
01437                                                     const char *psz_audio_output,
01438                                                     const char *psz_device_id );
01439 
01440 /**
01441  * Get current audio device type. Device type describes something like
01442  * character of output sound - stereo sound, 2.1, 5.1 etc
01443  *
01444  * \param p_mi media player
01445  * \return the audio devices type \see libvlc_audio_output_device_types_t
01446  */
01447 LIBVLC_API int libvlc_audio_output_get_device_type( libvlc_media_player_t *p_mi );
01448 
01449 /**
01450  * Set current audio device type.
01451  *
01452  * \param p_mi vlc instance
01453  * \param device_type the audio device type,
01454           according to \see libvlc_audio_output_device_types_t
01455  */
01456 LIBVLC_API void libvlc_audio_output_set_device_type( libvlc_media_player_t *p_mi,
01457                                                          int device_type );
01458 
01459 
01460 /**
01461  * Toggle mute status.
01462  *
01463  * \param p_mi media player
01464  */
01465 LIBVLC_API void libvlc_audio_toggle_mute( libvlc_media_player_t *p_mi );
01466 
01467 /**
01468  * Get current mute status.
01469  *
01470  * \param p_mi media player
01471  * \return the mute status (boolean)
01472  *
01473  * \libvlc_return_bool
01474  */
01475 LIBVLC_API int libvlc_audio_get_mute( libvlc_media_player_t *p_mi );
01476 
01477 /**
01478  * Set mute status.
01479  *
01480  * \param p_mi media player
01481  * \param status If status is true then mute, otherwise unmute
01482  */
01483 LIBVLC_API void libvlc_audio_set_mute( libvlc_media_player_t *p_mi, int status );
01484 
01485 /**
01486  * Get current software audio volume.
01487  *
01488  * \param p_mi media player
01489  * \return the software volume in percents
01490  * (0 = mute, 100 = nominal / 0dB)
01491  */
01492 LIBVLC_API int libvlc_audio_get_volume( libvlc_media_player_t *p_mi );
01493 
01494 /**
01495  * Set current software audio volume.
01496  *
01497  * \param p_mi media player
01498  * \param i_volume the volume in percents (0 = mute, 100 = 0dB)
01499  * \return 0 if the volume was set, -1 if it was out of range
01500  */
01501 LIBVLC_API int libvlc_audio_set_volume( libvlc_media_player_t *p_mi, int i_volume );
01502 
01503 /**
01504  * Get number of available audio tracks.
01505  *
01506  * \param p_mi media player
01507  * \return the number of available audio tracks (int), or -1 if unavailable
01508  */
01509 LIBVLC_API int libvlc_audio_get_track_count( libvlc_media_player_t *p_mi );
01510 
01511 /**
01512  * Get the description of available audio tracks.
01513  *
01514  * \param p_mi media player
01515  * \return list with description of available audio tracks, or NULL
01516  */
01517 LIBVLC_API libvlc_track_description_t *
01518         libvlc_audio_get_track_description( libvlc_media_player_t *p_mi );
01519 
01520 /**
01521  * Get current audio track.
01522  *
01523  * \param p_mi media player
01524  * \return the audio track (int), or -1 if none.
01525  */
01526 LIBVLC_API int libvlc_audio_get_track( libvlc_media_player_t *p_mi );
01527 
01528 /**
01529  * Set current audio track.
01530  *
01531  * \param p_mi media player
01532  * \param i_track the track (int)
01533  * \return 0 on success, -1 on error
01534  */
01535 LIBVLC_API int libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track );
01536 
01537 /**
01538  * Get current audio channel.
01539  *
01540  * \param p_mi media player
01541  * \return the audio channel \see libvlc_audio_output_channel_t
01542  */
01543 LIBVLC_API int libvlc_audio_get_channel( libvlc_media_player_t *p_mi );
01544 
01545 /**
01546  * Set current audio channel.
01547  *
01548  * \param p_mi media player
01549  * \param channel the audio channel, \see libvlc_audio_output_channel_t
01550  * \return 0 on success, -1 on error
01551  */
01552 LIBVLC_API int libvlc_audio_set_channel( libvlc_media_player_t *p_mi, int channel );
01553 
01554 /**
01555  * Get current audio delay.
01556  *
01557  * \param p_mi media player
01558  * \return the audio delay (microseconds)
01559  * \version LibVLC 1.1.1 or later
01560  */
01561 LIBVLC_API int64_t libvlc_audio_get_delay( libvlc_media_player_t *p_mi );
01562 
01563 /**
01564  * Set current audio delay. The audio delay will be reset to zero each time the media changes.
01565  *
01566  * \param p_mi media player
01567  * \param i_delay the audio delay (microseconds)
01568  * \return 0 on success, -1 on error
01569  * \version LibVLC 1.1.1 or later
01570  */
01571 LIBVLC_API int libvlc_audio_set_delay( libvlc_media_player_t *p_mi, int64_t i_delay );
01572 
01573 /** @} audio */
01574 
01575 /** @} media_player */
01576 
01577 # ifdef __cplusplus
01578 }
01579 # endif
01580 
01581 #endif /* VLC_LIBVLC_MEDIA_PLAYER_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines