]> git.sesse.net Git - vlc/blobdiff - include/vlc/libvlc_media_player.h
Qt: clarify a text
[vlc] / include / vlc / libvlc_media_player.h
index ad866768471646b631e365c697028a67c697a1dc..5233ecb79ae210887d9369bcaaf1262acd90466c 100644 (file)
@@ -179,6 +179,8 @@ LIBVLC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_m
  *
  * \param p_mi the Media Player
  * \return 1 if the media player is playing, 0 otherwise
+ *
+ * \libvlc_return_bool
  */
 LIBVLC_API int libvlc_media_player_is_playing ( libvlc_media_player_t *p_mi );
 
@@ -473,10 +475,40 @@ LIBVLC_API void *libvlc_media_player_get_hwnd ( libvlc_media_player_t *p_mi );
 typedef void (*libvlc_audio_play_cb)(void *data, const void *samples,
                                      unsigned count, int64_t pts);
 
+/**
+ * Callback prototype for audio pause.
+ * \note The pause callback is never called if the audio is already paused.
+ * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
+ * \param pts time stamp of the pause request (should be elapsed already)
+ */
+typedef void (*libvlc_audio_pause_cb)(void *data, int64_t pts);
+
+/**
+ * Callback prototype for audio resumption (i.e. restart from pause).
+ * \note The resume callback is never called if the audio is not paused.
+ * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
+ * \param pts time stamp of the resumption request (should be elapsed already)
+ */
+typedef void (*libvlc_audio_resume_cb)(void *data, int64_t pts);
+
+/**
+ * Callback prototype for audio buffer flush
+ * (i.e. discard all pending buffers and stop playback as soon as possible).
+ * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
+ */
+typedef void (*libvlc_audio_flush_cb)(void *data, int64_t pts);
+
+/**
+ * Callback prototype for audio buffer drain
+ * (i.e. wait for pending buffers to be played).
+ * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
+ */
+typedef void (*libvlc_audio_drain_cb)(void *data);
+
 /**
  * Callback prototype for audio volume change.
  * \param data data pointer as passed to libvlc_audio_set_callbacks() [IN]
- * \param volume linear volume (1. = nominal, 0. = mute)
+ * \param volume software volume (1. = nominal, 0. = mute)
  * \param mute muted flag
  */
 typedef void (*libvlc_audio_set_volume_cb)(void *data,
@@ -489,16 +521,36 @@ typedef void (*libvlc_audio_set_volume_cb)(void *data,
  *
  * \param mp the media player
  * \param play callback to play audio samples (must not be NULL)
- * \param set_volume callback to set audio volume, or NULL for software volume
- * \param opaque private pointer for the two callbacks (as first parameter)
+ * \param pause callback to pause playback (or NULL to ignore)
+ * \param resume callback to resume playback (or NULL to ignore)
+ * \param flush callback to flush audio buffers (or NULL to ignore)
+ * \param drain callback to drain audio buffers (or NULL to ignore)
+ * \param opaque private pointer for the audio callbacks (as first parameter)
  * \version LibVLC 1.2.0 or later
  */
 LIBVLC_API
 void libvlc_audio_set_callbacks( libvlc_media_player_t *mp,
                                  libvlc_audio_play_cb play,
-                                 libvlc_audio_set_volume_cb set_volume,
+                                 libvlc_audio_pause_cb pause,
+                                 libvlc_audio_resume_cb resume,
+                                 libvlc_audio_flush_cb flush,
+                                 libvlc_audio_drain_cb drain,
                                  void *opaque );
 
+/**
+ * Set callbacks and private data for decoded audio.
+ * Use libvlc_audio_set_format() or libvlc_audio_set_format_callbacks()
+ * to configure the decoded audio format.
+ *
+ * \param mp the media player
+ * \param set_volume callback to apply audio volume,
+ *                   or NULL to apply volume in software
+ * \version LibVLC 1.2.0 or later
+ */
+LIBVLC_API
+void libvlc_audio_set_volume_callback( libvlc_media_player_t *mp,
+                                       libvlc_audio_set_volume_cb set_volume );
+
 /**
  * Callback prototype to setup the audio playback.
  * This is called when the media player needs to create a new audio output.
@@ -539,7 +591,7 @@ void libvlc_audio_set_format_callbacks( libvlc_media_player_t *mp,
  * and is mutually exclusive with libvlc_audio_set_format_callbacks().
  *
  * \param mp the media player
- * \param fourcc a four-characters string identifying the sample format
+ * \param format a four-characters string identifying the sample format
  *               (e.g. "S16N" or "FL32")
  * \param rate sample rate (expressed in Hz)
  * \param channels channels count
@@ -622,6 +674,8 @@ LIBVLC_API int libvlc_media_player_get_chapter_count( libvlc_media_player_t *p_m
  *
  * \param p_mi the Media Player
  * \return boolean
+ *
+ * \libvlc_return_bool
  */
 LIBVLC_API int libvlc_media_player_will_play( libvlc_media_player_t *p_mi );
 
@@ -724,6 +778,8 @@ LIBVLC_API unsigned libvlc_media_player_has_vout( libvlc_media_player_t *p_mi );
  *
  * \param p_mi the media player
  * \return true if the media player can seek
+ *
+ * \libvlc_return_bool
  */
 LIBVLC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi );
 
@@ -732,6 +788,8 @@ LIBVLC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi );
  *
  * \param p_mi the media player
  * \return true if the media player can pause
+ *
+ * \libvlc_return_bool
  */
 LIBVLC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi );
 
@@ -794,6 +852,8 @@ LIBVLC_API void libvlc_set_fullscreen( libvlc_media_player_t *p_mi, int b_fullsc
  *
  * \param p_mi the media player
  * \return the fullscreen status (boolean)
+ *
+ * \libvlc_return_bool
  */
 LIBVLC_API int libvlc_get_fullscreen( libvlc_media_player_t *p_mi );
 
@@ -820,7 +880,7 @@ void libvlc_video_set_key_input( libvlc_media_player_t *p_mi, unsigned on );
  * handled. This is needed for DVD menus to work, as well as a few video
  * filters such as "puzzle".
  *
- * \note See also libvlc_video_set_key_input().
+ * \see libvlc_video_set_key_input().
  *
  * \warning This function is only implemented for X11 and Win32 at the moment.
  *
@@ -1296,7 +1356,7 @@ LIBVLC_API void libvlc_audio_output_list_release( libvlc_audio_output_t *p_list
  * \param p_mi media player
  * \param psz_name name of audio output,
  *               use psz_name of \see libvlc_audio_output_t
- * \return true if function succeded
+ * \return 0 if function succeded, -1 on error
  */
 LIBVLC_API int libvlc_audio_output_set( libvlc_media_player_t *p_mi,
                                             const char *psz_name );
@@ -1379,6 +1439,8 @@ LIBVLC_API void libvlc_audio_toggle_mute( libvlc_media_player_t *p_mi );
  *
  * \param p_mi media player
  * \return the mute status (boolean)
+ *
+ * \libvlc_return_bool
  */
 LIBVLC_API int libvlc_audio_get_mute( libvlc_media_player_t *p_mi );
 
@@ -1391,18 +1453,19 @@ LIBVLC_API int libvlc_audio_get_mute( libvlc_media_player_t *p_mi );
 LIBVLC_API void libvlc_audio_set_mute( libvlc_media_player_t *p_mi, int status );
 
 /**
- * Get current audio level.
+ * Get current software audio volume.
  *
  * \param p_mi media player
- * \return the audio level (int)
+ * \return the software volume in percents
+ * (0 = mute, 100 = nominal / 0dB)
  */
 LIBVLC_API int libvlc_audio_get_volume( libvlc_media_player_t *p_mi );
 
 /**
- * Set current audio level.
+ * Set current software audio volume.
  *
  * \param p_mi media player
- * \param i_volume the volume (int)
+ * \param i_volume the volume in percents (0 = mute, 100 = 0dB)
  * \return 0 if the volume was set, -1 if it was out of range
  */
 LIBVLC_API int libvlc_audio_set_volume( libvlc_media_player_t *p_mi, int i_volume );