[vlc-devel] [PATCH 2/4] lib/audio: provide API to set and get audio filters
Pierre Lamot
pierre at videolabs.io
Wed Sep 6 15:02:53 CEST 2017
---
include/vlc/libvlc_media_player.h | 19 +++++++++++++++++++
lib/audio.c | 15 +++++++++++++++
lib/libvlc.sym | 2 ++
3 files changed, 36 insertions(+)
diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
index a9c62d3e6d..579a6941ad 100644
--- a/include/vlc/libvlc_media_player.h
+++ b/include/vlc/libvlc_media_player.h
@@ -1937,6 +1937,25 @@ LIBVLC_API int64_t libvlc_audio_get_delay( libvlc_media_player_t *p_mi );
*/
LIBVLC_API int libvlc_audio_set_delay( libvlc_media_player_t *p_mi, int64_t i_delay );
+/**
+ * Set the active video filter as string.
+ *
+ * \param p_mi libvlc media player instance
+ * \param value colon separated list of plugin names
+ * \version LibVLC 3.0.0 and later.
+ */
+LIBVLC_API void libvlc_audio_set_filters( libvlc_media_player_t *p_mi,
+ const char *value );
+
+/**
+ * Get the active video filter as string.
+ *
+ * \param p_mi libvlc media player instance
+ * \return colon separated list of plugin names
+ * \version LibVLC 3.0.0 and later.
+ */
+LIBVLC_API const char *libvlc_audio_get_filters( libvlc_media_player_t *p_mi );
+
/**
* Get the number of equalizer presets.
*
diff --git a/lib/audio.c b/lib/audio.c
index 3aed6f5ff3..d83d9cdf36 100644
--- a/lib/audio.c
+++ b/lib/audio.c
@@ -506,6 +506,21 @@ int libvlc_audio_set_delay( libvlc_media_player_t *p_mi, int64_t i_delay )
return ret;
}
+void libvlc_audio_set_filters( libvlc_media_player_t *p_mi, const char *value )
+{
+ audio_output_t *p_aout = GetAOut( p_mi );
+ var_SetString( p_aout, "audio-filter", value );
+ vlc_object_release( p_aout );
+}
+
+const char *libvlc_audio_get_filters( libvlc_media_player_t *p_mi )
+{
+ audio_output_t *p_aout = GetAOut(p_mi);
+ char *psz_audio = var_GetNonEmptyString( p_aout, "audio-filter" );
+ vlc_object_release( p_aout );
+ return psz_audio;
+}
+
/*****************************************************************************
* libvlc_audio_equalizer_get_preset_count : Get the number of equalizer presets
*****************************************************************************/
diff --git a/lib/libvlc.sym b/lib/libvlc.sym
index b768cc919d..cd5f433365 100644
--- a/lib/libvlc.sym
+++ b/lib/libvlc.sym
@@ -29,6 +29,7 @@ libvlc_audio_output_set
libvlc_audio_output_set_device_type
libvlc_audio_get_channel
libvlc_audio_get_delay
+libvlc_audio_get_filters
libvlc_audio_get_mute
libvlc_audio_get_track
libvlc_audio_get_track_count
@@ -36,6 +37,7 @@ libvlc_audio_get_track_description
libvlc_audio_get_volume
libvlc_audio_set_channel
libvlc_audio_set_delay
+libvlc_audio_set_filters
libvlc_audio_set_mute
libvlc_audio_set_track
libvlc_audio_set_volume
--
2.14.1
More information about the vlc-devel
mailing list