]> git.sesse.net Git - vlc/blobdiff - include/vlc/libvlc_media_player.h
Add functions to get/set audio delay.
[vlc] / include / vlc / libvlc_media_player.h
index 0c1a4ef17be8effa3ade60e7216f311e6da37e19..f593599f3e1f999683b56352f1270f2598bc9310 100644 (file)
@@ -176,6 +176,16 @@ VLC_PUBLIC_API int libvlc_media_player_is_playing ( libvlc_media_player_t *p_mi
  */
 VLC_PUBLIC_API int libvlc_media_player_play ( libvlc_media_player_t *p_mi );
 
+/**
+ * Pause or resume (no effect if there is no media)
+ *
+ * \param mp the Media Player
+ * \param do_pause play/resume if zero, pause if non-zero
+ * \version LibVLC 1.1.1 or later
+ */
+VLC_PUBLIC_API void libvlc_media_player_set_pause ( libvlc_media_player_t *mp,
+                                                    int do_pause );
+
 /**
  * Toggle pause (no effect if there is no media)
  *
@@ -190,6 +200,53 @@ VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *p_mi );
  */
 VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *p_mi );
 
+/**
+ * Set callbacks and private data to render decoded video to a custom area
+ * in memory. Use libvlc_video_set_format() to configure the decoded format.
+ *
+ * Whenever a new video frame needs to be decoded, the lock callback is
+ * invoked. Depending on the video chroma, one or three pixel planes of
+ * adequate dimensions must be returned via the second parameter. Those
+ * planes must be aligned on 32-bytes boundaries.
+ *
+ * When the video frame is decoded, the unlock callback is invoked. The
+ * second parameter to the callback corresponds is the return value of the
+ * lock callback. The third parameter conveys the pixel planes for convenience.
+ *
+ * When the video frame needs to be shown, as determined by the media playback
+ * clock, the display callback is invoked. The second parameter also conveys
+ * the return value from the lock callback.
+ *
+ * \param mp the media player
+ * \param lock callback to allocate video memory
+ * \param unlock callback to release video memory
+ * \param opaque private pointer for the three callbacks (as first parameter)
+ * \version LibVLC 1.1.1 or later
+ */
+VLC_PUBLIC_API
+void libvlc_video_set_callbacks( libvlc_media_player_t *mp,
+    void *(*lock) (void *opaque, void **plane),
+    void (*unlock) (void *opaque, void *picture, void *const *plane),
+    void (*display) (void *opaque, void *picture),
+    void *opaque );
+
+/**
+ * Set decoded video chroma and dimensions. This only works in combination with
+ * libvlc_video_set_callbacks().
+ *
+ * \param mp the media player
+ * \param chroma a four-characters string identifying the chroma
+ *               (e.g. "RV32" or "I420")
+ * \param width pixel width
+ * \param height pixel height
+ * \param pitch line pitch (in bytes)
+ * \version LibVLC 1.1.1 or later
+ */
+VLC_PUBLIC_API
+void libvlc_video_set_format( libvlc_media_player_t *mp, const char *chroma,
+                              unsigned width, unsigned height,
+                              unsigned pitch );
+
 /**
  * Set the NSView handler where the media player should render its video output.
  *
@@ -940,6 +997,7 @@ enum libvlc_video_adjust_option_t {
  *
  * \param p_mi libvlc media player instance
  * \param option adjust option to get, values of libvlc_video_adjust_option_t
+ * \version LibVLC 1.1.1 and later.
  */
 VLC_PUBLIC_API int libvlc_video_get_adjust_int( libvlc_media_player_t *p_mi,
                                                 unsigned option );
@@ -953,6 +1011,7 @@ VLC_PUBLIC_API int libvlc_video_get_adjust_int( libvlc_media_player_t *p_mi,
  * \param p_mi libvlc media player instance
  * \param option adust option to set, values of libvlc_video_adjust_option_t
  * \param value adjust option value
+ * \version LibVLC 1.1.1 and later.
  */
 VLC_PUBLIC_API void libvlc_video_set_adjust_int( libvlc_media_player_t *p_mi,
                                                  unsigned option, int value );
@@ -962,6 +1021,7 @@ VLC_PUBLIC_API void libvlc_video_set_adjust_int( libvlc_media_player_t *p_mi,
  *
  * \param p_mi libvlc media player instance
  * \param option adjust option to get, values of libvlc_video_adjust_option_t
+ * \version LibVLC 1.1.1 and later.
  */
 VLC_PUBLIC_API float libvlc_video_get_adjust_float( libvlc_media_player_t *p_mi,
                                                     unsigned option );
@@ -973,6 +1033,7 @@ VLC_PUBLIC_API float libvlc_video_get_adjust_float( libvlc_media_player_t *p_mi,
  * \param p_mi libvlc media player instance
  * \param option adust option to set, values of libvlc_video_adjust_option_t
  * \param value adjust option value
+ * \version LibVLC 1.1.1 and later.
  */
 VLC_PUBLIC_API void libvlc_video_set_adjust_float( libvlc_media_player_t *p_mi,
                                                    unsigned option, float value );
@@ -1198,6 +1259,25 @@ VLC_PUBLIC_API int libvlc_audio_get_channel( libvlc_media_player_t *p_mi );
  */
 VLC_PUBLIC_API int libvlc_audio_set_channel( libvlc_media_player_t *p_mi, int channel );
 
+/**
+ * Get current audio delay.
+ *
+ * \param p_mi media player
+ * \return the audio delay (microseconds)
+ * \version LibVLC 1.1.1 or later
+ */
+VLC_PUBLIC_API int64_t libvlc_audio_get_delay( libvlc_media_player_t *p_mi );
+
+/**
+ * Set current audio delay. The audio delay will be reset to zero each time the media changes.
+ *
+ * \param p_mi media player
+ * \param i_delay the audio delay (microseconds)
+ * \return 0 on success, -1 on error
+ * \version LibVLC 1.1.1 or later
+ */
+VLC_PUBLIC_API int libvlc_audio_set_delay( libvlc_media_player_t *p_mi, int64_t i_delay );
+
 /** @} audio */
 
 /** @} media_player */