[vlc-commits] hw: vaapi: merge chroma and filters libraries

Thomas Guillem git at videolan.org
Tue Jul 4 19:54:21 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Jul  4 19:13:36 2017 +0200| [6e7bf32ed0e5e7bcb23becee2f368020b42c6a21] | committer: Thomas Guillem

hw: vaapi: merge chroma and filters libraries

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6e7bf32ed0e5e7bcb23becee2f368020b42c6a21
---

 modules/MODULES_LIST         |  3 +--
 modules/hw/vaapi/Makefile.am | 11 ++++-------
 modules/hw/vaapi/chroma.c    | 21 +++++----------------
 modules/hw/vaapi/filters.c   |  8 ++++----
 modules/hw/vaapi/filters.h   | 34 ++++++++++++++++++++++++++++++++++
 po/POTFILES.in               |  1 -
 6 files changed, 48 insertions(+), 30 deletions(-)

diff --git a/modules/MODULES_LIST b/modules/MODULES_LIST
index d4d600a39d..5c9e96bd18 100644
--- a/modules/MODULES_LIST
+++ b/modules/MODULES_LIST
@@ -418,10 +418,9 @@ $Id$
  * uleaddvaudio: codec for DV Audio from Ulead
  * upnp: libupnp UPNP service discovery
  * v4l2: Video 4 Linux 2 input module
- * vaapi_chroma: VAAPI chroma conversion
  * vaapi_dr: VAAPI hardware-accelerated decoding with vout backend (direct rendering)
  * vaapi_drm: VAAPI hardware-accelerated decoding with drm backend
- * vaapi_filters: VAAPI hardware-accelerated deinterlacing/adjust/sharpen/chroma filters
+ * vaapi_filters: VAAPI hardware-accelerated deinterlacing/chroma/adjust/sharpen/chroma filters
  * vaapi_x11: VAAPI hardware-accelerated decoding with x11 backend
  * vc1: VC-1 Video demuxer
  * vcd: input module for accessing Video CDs
diff --git a/modules/hw/vaapi/Makefile.am b/modules/hw/vaapi/Makefile.am
index 563bad2844..cdd6e72c39 100644
--- a/modules/hw/vaapi/Makefile.am
+++ b/modules/hw/vaapi/Makefile.am
@@ -1,16 +1,13 @@
 vaapidir = $(pluginsdir)/vaapi
 
-libvaapi_chroma_plugin_la_SOURCES = hw/vaapi/chroma.c hw/vaapi/vlc_vaapi.c hw/vaapi/vlc_vaapi.h	\
-				    video_chroma/copy.c video_chroma/copy.h
-libvaapi_chroma_plugin_la_CFLAGS = $(AM_CFLAGS) $(LIBVA_CFLAGS)
-libvaapi_chroma_plugin_la_LIBADD = $(AM_LIBADD) $(LIBVA_LIBS)
+libvaapi_filters_plugin_la_SOURCES = hw/vaapi/filters.c \
+	hw/vaapi/vlc_vaapi.c hw/vaapi/vlc_vaapi.h \
+	hw/vaapi/chroma.c video_chroma/copy.c video_chroma/copy.h
 
-libvaapi_filters_plugin_la_SOURCES = hw/vaapi/filters.c hw/vaapi/vlc_vaapi.c hw/vaapi/vlc_vaapi.h
 libvaapi_filters_plugin_la_CPPFLAGS = $(AM_CPPFLAGS)
 libvaapi_filters_plugin_la_CFLAGS = $(AM_CFLAGS) $(LIBVA_CFLAGS)
 libvaapi_filters_plugin_la_LIBADD = $(AM_LIBADD) $(LIBVA_LIBS)
 
 if HAVE_VAAPI
-vaapi_LTLIBRARIES = libvaapi_chroma_plugin.la	\
-		    libvaapi_filters_plugin.la
+vaapi_LTLIBRARIES = libvaapi_filters_plugin.la
 endif
diff --git a/modules/hw/vaapi/chroma.c b/modules/hw/vaapi/chroma.c
index a202f3f8aa..028b2e2ede 100644
--- a/modules/hw/vaapi/chroma.c
+++ b/modules/hw/vaapi/chroma.c
@@ -33,7 +33,7 @@
 #include <vlc_plugin.h>
 
 #include "../../video_chroma/copy.h"
-#include "vlc_vaapi.h"
+#include "filters.h"
 
 # define DEST_PICS_POOL_SZ 3
 
@@ -50,18 +50,6 @@ struct filter_sys_t
     VAImage             image_fallback;
 };
 
-static int              Open(vlc_object_t *obj);
-static void             Close(vlc_object_t *obj);
-
-vlc_module_begin()
-    set_shortname(N_("VAAPI"))
-    set_description(N_("VAAPI surface conversions"))
-    set_capability("video converter", 10)
-    set_category(CAT_VIDEO)
-    set_subcategory(SUBCAT_VIDEO_VFILTER)
-    set_callbacks(Open, Close)
-vlc_module_end()
-
 static int CreateFallbackImage(filter_t *filter, picture_t *src_pic)
 {
     filter_sys_t *const filter_sys = filter->p_sys;
@@ -265,7 +253,8 @@ error:
     goto ret;
 }
 
-static int Open(vlc_object_t *obj)
+int
+vlc_vaapi_OpenChroma(vlc_object_t *obj)
 {
     filter_t *const     filter = (filter_t *)obj;
     filter_sys_t *      filter_sys;
@@ -348,8 +337,8 @@ static int Open(vlc_object_t *obj)
     return VLC_SUCCESS;
 }
 
-static void
-Close(vlc_object_t *obj)
+void
+vlc_vaapi_CloseChroma(vlc_object_t *obj)
 {
     filter_sys_t *const filter_sys = ((filter_t *)obj)->p_sys;
 
diff --git a/modules/hw/vaapi/filters.c b/modules/hw/vaapi/filters.c
index f68c28a3e5..4e5a37d833 100644
--- a/modules/hw/vaapi/filters.c
+++ b/modules/hw/vaapi/filters.c
@@ -30,7 +30,7 @@
 #include <vlc_atomic.h>
 #include <vlc_filter.h>
 #include <vlc_plugin.h>
-#include "vlc_vaapi.h"
+#include "filters.h"
 
 /********************************
  * Common structures and macros *
@@ -1021,9 +1021,9 @@ vlc_module_begin()
                          "Set the Denoise strength, between 0 and 2. "
                             "Defaults to 1.",
                          false)
-    add_shortcut("denoise")
+    add_shortcut("denoise", "sharpen")
 
     add_submodule()
-    set_callbacks(OpenBasicFilter, CloseBasicFilter)
-    add_shortcut("sharpen")
+    set_capability("video converter", 10)
+    set_callbacks(vlc_vaapi_OpenChroma, vlc_vaapi_CloseChroma)
 vlc_module_end()
diff --git a/modules/hw/vaapi/filters.h b/modules/hw/vaapi/filters.h
new file mode 100644
index 0000000000..aafb1383f4
--- /dev/null
+++ b/modules/hw/vaapi/filters.h
@@ -0,0 +1,34 @@
+/*****************************************************************************
+ * filters.h: VAAPI filters helper for VLC
+ *****************************************************************************
+ * Copyright (C) 2017 VLC authors, VideoLAN and VideoLabs
+ *
+ * Authors: Thomas Guillem <thomas at gllm.fr>
+ *          Petri Hintukainen <phintuka at gmail.com>
+ *          Victorien Le Couviour--Tuffet <victorien.lecouviour.tuffet at gmail.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#ifndef VLC_VAAPI_FILTERS_H
+# define VLC_VAAPI_FILTERS_H
+
+#include "vlc_vaapi.h"
+
+/* chroma filters callbacks */
+int  vlc_vaapi_OpenChroma(vlc_object_t *obj);
+void vlc_vaapi_CloseChroma(vlc_object_t *obj);
+
+#endif /* VLC_VAAPI_FILTERS_H */
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 66ea2ddf6d..bf284db391 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -912,7 +912,6 @@ modules/hw/vdpau/chroma.c
 modules/hw/vdpau/deinterlace.c
 modules/hw/vdpau/display.c
 modules/hw/vdpau/sharpen.c
-modules/hw/vaapi/chroma.c
 modules/hw/vaapi/filters.c
 modules/keystore/keychain.m
 modules/lua/demux.c



More information about the vlc-commits mailing list