[vlc-devel] [PATCH 1/4] lib/video: provide API to set and get video filters

Rémi Denis-Courmont remi at remlab.net
Wed Sep 6 15:19:34 CEST 2017


Le 6 septembre 2017 16:02:52 GMT+03:00, Pierre Lamot <pierre at videolabs.io> a écrit :
>---
> include/vlc/libvlc_media_player.h | 20 ++++++++++++++++++++
> lib/libvlc.sym                    |  2 ++
> lib/video.c                       | 15 +++++++++++++++
> 3 files changed, 37 insertions(+)
>
>diff --git a/include/vlc/libvlc_media_player.h
>b/include/vlc/libvlc_media_player.h
>index 958318bce9..a9c62d3e6d 100644
>--- a/include/vlc/libvlc_media_player.h
>+++ b/include/vlc/libvlc_media_player.h
>@@ -1609,6 +1609,26 @@ LIBVLC_API float libvlc_video_get_adjust_float(
>libvlc_media_player_t *p_mi,
>LIBVLC_API void libvlc_video_set_adjust_float( libvlc_media_player_t
>*p_mi,
>                                        unsigned option, float value );
> 
>+/**
>+ * 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_video_set_filters(libvlc_media_player_t *p_mi,
>+                                          const char *psz_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_video_get_filters( libvlc_media_player_t
>*p_mi );
>+
>+
> /** @} video */
> 
> /** \defgroup libvlc_audio LibVLC audio controls
>diff --git a/lib/libvlc.sym b/lib/libvlc.sym
>index caa55981bf..b768cc919d 100644
>--- a/lib/libvlc.sym
>+++ b/lib/libvlc.sym
>@@ -248,6 +248,7 @@ libvlc_video_get_crop_geometry
> libvlc_video_get_size
> libvlc_video_get_height
> libvlc_video_get_cursor
>+libvlc_video_get_filters
> libvlc_video_get_logo_int
> libvlc_video_get_marquee_int
> libvlc_video_get_marquee_string
>@@ -268,6 +269,7 @@ libvlc_video_set_aspect_ratio
> libvlc_video_set_callbacks
> libvlc_video_set_crop_geometry
> libvlc_video_set_deinterlace
>+libvlc_video_set_filters
> libvlc_video_set_format
> libvlc_video_set_format_callbacks
> libvlc_video_set_key_input
>diff --git a/lib/video.c b/lib/video.c
>index f6e16ba601..7450e92fc4 100644
>--- a/lib/video.c
>+++ b/lib/video.c
>@@ -1079,3 +1079,18 @@ float libvlc_video_get_adjust_float(
>libvlc_media_player_t *p_mi,
> {
>    return get_float( p_mi, "adjust", adjust_option_bynumber(option) );
> }
>+
>+
>+void libvlc_video_set_filters( libvlc_media_player_t *p_mi,
>+                               const char *psz_value )
>+{
>+    static const opt_t opt = { "video-filter", VLC_VAR_STRING };
>+    set_value( p_mi, "video-filter", &opt, VLC_VAR_STRING,
>+               &(vlc_value_t) { .psz_string = (char *)psz_value },
>false );
>+}
>+
>+const char *libvlc_video_get_filters( libvlc_media_player_t *p_mi)
>+{
>+    static const opt_t opt = { "video-filter", VLC_VAR_STRING };
>+    return get_string( p_mi, "video-filter", &opt );
>+}
>-- 
>2.14.1
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

Hello,

This API (all 4 patches) shows poor usability, lack of abstraction and is fundamentally race-prone. If it were that easy, we would have implemented it a long time ago.

No thanks.
-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.


More information about the vlc-devel mailing list