diff --git a/configure.ac b/configure.ac index e6e9842849..0b9af9b012 100644 --- a/configure.ac +++ b/configure.ac @@ -333,9 +333,7 @@ pkgconfig/gstreamer-vaapi-glx.pc.in pkgconfig/gstreamer-vaapi-x11-$GST_MAJORMINOR.pc:\ pkgconfig/gstreamer-vaapi-x11.pc.in gst/Makefile - gst/vaapiconvert/Makefile - gst/vaapidecode/Makefile - gst/vaapisink/Makefile + gst/vaapi/Makefile tests/Makefile ]) diff --git a/docs/reference/plugins/Makefile.am b/docs/reference/plugins/Makefile.am index 457dfd13ab..0bb388cb96 100644 --- a/docs/reference/plugins/Makefile.am +++ b/docs/reference/plugins/Makefile.am @@ -90,9 +90,7 @@ INCLUDES = \ GTKDOC_LIBS = \ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-$(GST_MAJORMINOR).la \ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11-$(GST_MAJORMINOR).la \ - $(top_builddir)/gst/vaapidecode/libgstvaapidecode.la \ - $(top_builddir)/gst/vaapiconvert/libgstvaapiconvert.la \ - $(top_builddir)/gst/vaapisink/libgstvaapisink.la \ + $(top_builddir)/gst/vaapi/libgstvaapi.la \ $(GLIB_LIBS) \ $(GST_LIBS) \ $(NULL) diff --git a/gst/Makefile.am b/gst/Makefile.am index 195d0e9dd2..37d365da29 100644 --- a/gst/Makefile.am +++ b/gst/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = vaapiconvert vaapidecode vaapisink +SUBDIRS = vaapi # Extra clean files so that maintainer-clean removes *everything* MAINTAINERCLEANFILES = Makefile.in diff --git a/gst/vaapisink/Makefile.am b/gst/vaapi/Makefile.am similarity index 66% rename from gst/vaapisink/Makefile.am rename to gst/vaapi/Makefile.am index a11b1b59ec..19bd410ba2 100644 --- a/gst/vaapisink/Makefile.am +++ b/gst/vaapi/Makefile.am @@ -1,4 +1,4 @@ -plugin_LTLIBRARIES = libgstvaapisink.la +plugin_LTLIBRARIES = libgstvaapi.la libgstvaapi_CFLAGS = \ $(LIBVA_CFLAGS) \ @@ -12,30 +12,37 @@ libgstvaapi_LIBS = \ $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11-$(GST_MAJORMINOR).la endif -libgstvaapisink_la_SOURCES = \ +libgstvaapi_la_SOURCES = \ + gstvaapi.c \ + gstvaapiconvert.c \ + gstvaapidecode.c \ gstvaapisink.c \ $(NULL) noinst_HEADERS = \ + gstvaapiconvert.h \ + gstvaapidecode.h \ gstvaapisink.h \ $(NULL) -libgstvaapisink_la_CFLAGS = \ +libgstvaapi_la_CFLAGS = \ $(libgstvaapi_CFLAGS) \ $(GST_CFLAGS) \ + $(GST_BASE_CFLAGS) \ $(GST_VIDEO_CFLAGS) \ $(GST_INTERFACES_CFLAGS) \ $(GST_PLUGINS_BASE_CFLAGS) -libgstvaapisink_la_LIBADD = \ +libgstvaapi_la_LIBADD = \ $(libgstvaapi_LIBS) \ $(GST_LIBS) \ + $(GST_BASE_LIBS) \ $(GST_VIDEO_LIBS) \ $(GST_INTERFACES_LIBS) \ $(GST_PLUGINS_BASE_LIBS) -libgstvaapisink_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) -libgstvaapisink_la_LIBTOOLFLAGS = --tag=disable-static +libgstvaapi_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstvaapi_la_LIBTOOLFLAGS = --tag=disable-static # Extra clean files so that maintainer-clean removes *everything* MAINTAINERCLEANFILES = Makefile.in diff --git a/gst/vaapi/gstvaapi.c b/gst/vaapi/gstvaapi.c new file mode 100644 index 0000000000..1675a2a7c6 --- /dev/null +++ b/gst/vaapi/gstvaapi.c @@ -0,0 +1,57 @@ +/* + * gstvaapi.c - VA-API element registration + * + * Copyright (C) 2011 Intel Corporation + * Copyright (C) 2011 Collabora Ltd. + * Author: Nicolas Dufresne + * + * This library 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 library 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 library; if not, write to the Free + * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include "gstvaapiconvert.h" +#include "gstvaapidecode.h" +#include "gstvaapisink.h" + +static gboolean +plugin_init (GstPlugin *plugin) +{ + gst_element_register(plugin, "vaapiconvert", + GST_RANK_PRIMARY, + GST_TYPE_VAAPICONVERT); + gst_element_register(plugin, "vaapidecode", + GST_RANK_PRIMARY, + GST_TYPE_VAAPIDECODE); + gst_element_register(plugin, "vaapisink", + GST_RANK_PRIMARY, + GST_TYPE_VAAPISINK); + return TRUE; +} + +GST_PLUGIN_DEFINE( + GST_VERSION_MAJOR, GST_VERSION_MINOR, + "vaapi", + "VA-API based elements", + plugin_init, + PACKAGE_VERSION, + "LGPL", + PACKAGE, + PACKAGE_BUGREPORT); diff --git a/gst/vaapiconvert/gstvaapiconvert.c b/gst/vaapi/gstvaapiconvert.c similarity index 98% rename from gst/vaapiconvert/gstvaapiconvert.c rename to gst/vaapi/gstvaapiconvert.c index 9b3b0b4e37..769176ac31 100644 --- a/gst/vaapiconvert/gstvaapiconvert.c +++ b/gst/vaapi/gstvaapiconvert.c @@ -240,6 +240,9 @@ gst_vaapiconvert_class_init(GstVaapiConvertClass *klass) GObjectClass * const object_class = G_OBJECT_CLASS(klass); GstBaseTransformClass * const trans_class = GST_BASE_TRANSFORM_CLASS(klass); + GST_DEBUG_CATEGORY_INIT(gst_debug_vaapiconvert, + GST_PLUGIN_NAME, 0, GST_PLUGIN_DESC); + object_class->finalize = gst_vaapiconvert_finalize; object_class->set_property = gst_vaapiconvert_set_property; object_class->get_property = gst_vaapiconvert_get_property; @@ -762,25 +765,3 @@ gst_vaapiconvert_prepare_output_buffer( *poutbuf = buffer; return GST_FLOW_OK; } - -static gboolean -plugin_init(GstPlugin *plugin) -{ - GST_DEBUG_CATEGORY_INIT(gst_debug_vaapiconvert, - GST_PLUGIN_NAME, 0, GST_PLUGIN_DESC); - - return gst_element_register(plugin, - GST_PLUGIN_NAME, - GST_RANK_SECONDARY, - GST_TYPE_VAAPICONVERT); -} - -GST_PLUGIN_DEFINE( - GST_VERSION_MAJOR, GST_VERSION_MINOR, - GST_PLUGIN_NAME, - GST_PLUGIN_DESC, - plugin_init, - PACKAGE_VERSION, - "LGPL", - PACKAGE, - PACKAGE_BUGREPORT); diff --git a/gst/vaapiconvert/gstvaapiconvert.h b/gst/vaapi/gstvaapiconvert.h similarity index 100% rename from gst/vaapiconvert/gstvaapiconvert.h rename to gst/vaapi/gstvaapiconvert.h diff --git a/gst/vaapidecode/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c similarity index 97% rename from gst/vaapidecode/gstvaapidecode.c rename to gst/vaapi/gstvaapidecode.c index a31877636e..19f0e91780 100644 --- a/gst/vaapidecode/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -465,6 +465,9 @@ gst_vaapidecode_class_init(GstVaapiDecodeClass *klass) GObjectClass * const object_class = G_OBJECT_CLASS(klass); GstElementClass * const element_class = GST_ELEMENT_CLASS(klass); + GST_DEBUG_CATEGORY_INIT(gst_debug_vaapidecode, + GST_PLUGIN_NAME, 0, GST_PLUGIN_DESC); + object_class->finalize = gst_vaapidecode_finalize; object_class->set_property = gst_vaapidecode_set_property; object_class->get_property = gst_vaapidecode_get_property; @@ -655,25 +658,3 @@ gst_vaapidecode_init(GstVaapiDecode *decode, GstVaapiDecodeClass *klass) gst_pad_set_event_function(decode->srcpad, gst_vaapidecode_src_event); gst_element_add_pad(GST_ELEMENT(decode), decode->srcpad); } - -static gboolean -plugin_init(GstPlugin *plugin) -{ - GST_DEBUG_CATEGORY_INIT(gst_debug_vaapidecode, - GST_PLUGIN_NAME, 0, GST_PLUGIN_DESC); - - return gst_element_register(plugin, - GST_PLUGIN_NAME, - GST_RANK_PRIMARY, - GST_TYPE_VAAPIDECODE); -} - -GST_PLUGIN_DEFINE( - GST_VERSION_MAJOR, GST_VERSION_MINOR, - GST_PLUGIN_NAME, - GST_PLUGIN_DESC, - plugin_init, - PACKAGE_VERSION, - "LGPL", - PACKAGE, - PACKAGE_BUGREPORT); diff --git a/gst/vaapidecode/gstvaapidecode.h b/gst/vaapi/gstvaapidecode.h similarity index 100% rename from gst/vaapidecode/gstvaapidecode.h rename to gst/vaapi/gstvaapidecode.h diff --git a/gst/vaapisink/gstvaapisink.c b/gst/vaapi/gstvaapisink.c similarity index 98% rename from gst/vaapisink/gstvaapisink.c rename to gst/vaapi/gstvaapisink.c index 10f791b364..b59f738d2f 100644 --- a/gst/vaapisink/gstvaapisink.c +++ b/gst/vaapi/gstvaapisink.c @@ -808,6 +808,9 @@ gst_vaapisink_class_init(GstVaapiSinkClass *klass) GObjectClass * const object_class = G_OBJECT_CLASS(klass); GstBaseSinkClass * const basesink_class = GST_BASE_SINK_CLASS(klass); + GST_DEBUG_CATEGORY_INIT(gst_debug_vaapisink, + GST_PLUGIN_NAME, 0, GST_PLUGIN_DESC); + object_class->finalize = gst_vaapisink_finalize; object_class->set_property = gst_vaapisink_set_property; object_class->get_property = gst_vaapisink_get_property; @@ -900,25 +903,3 @@ gst_vaapisink_get_display(GstVaapiSink *sink) return NULL; return sink->display; } - -static gboolean -plugin_init(GstPlugin *plugin) -{ - GST_DEBUG_CATEGORY_INIT(gst_debug_vaapisink, - GST_PLUGIN_NAME, 0, GST_PLUGIN_DESC); - - return gst_element_register(plugin, - GST_PLUGIN_NAME, - GST_RANK_PRIMARY, - GST_TYPE_VAAPISINK); -} - -GST_PLUGIN_DEFINE( - GST_VERSION_MAJOR, GST_VERSION_MINOR, - GST_PLUGIN_NAME, - GST_PLUGIN_DESC, - plugin_init, - PACKAGE_VERSION, - "LGPL", - PACKAGE, - PACKAGE_BUGREPORT); diff --git a/gst/vaapisink/gstvaapisink.h b/gst/vaapi/gstvaapisink.h similarity index 100% rename from gst/vaapisink/gstvaapisink.h rename to gst/vaapi/gstvaapisink.h diff --git a/gst/vaapiconvert/Makefile.am b/gst/vaapiconvert/Makefile.am deleted file mode 100644 index 545e4cbed7..0000000000 --- a/gst/vaapiconvert/Makefile.am +++ /dev/null @@ -1,36 +0,0 @@ -plugin_LTLIBRARIES = libgstvaapiconvert.la - -libgstvaapi_CFLAGS = \ - $(LIBVA_CFLAGS) \ - -I$(top_srcdir)/gst-libs - -libgstvaapi_LIBS = \ - $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-$(GST_MAJORMINOR).la - -libgstvaapiconvert_la_SOURCES = \ - gstvaapiconvert.c \ - $(NULL) - -noinst_HEADERS = \ - gstvaapiconvert.h \ - $(NULL) - -libgstvaapiconvert_la_CFLAGS = \ - $(libgstvaapi_CFLAGS) \ - $(GST_CFLAGS) \ - $(GST_BASE_CFLAGS) \ - $(GST_VIDEO_CFLAGS) \ - $(GST_PLUGINS_BASE_CFLAGS) - -libgstvaapiconvert_la_LIBADD = \ - $(libgstvaapi_LIBS) \ - $(GST_LIBS) \ - $(GST_BASE_LIBS) \ - $(GST_VIDEO_LIBS) \ - $(GST_PLUGINS_BASE_LIBS) - -libgstvaapiconvert_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) -libgstvaapiconvert_la_LIBTOOLFLAGS = --tag=disable-static - -# Extra clean files so that maintainer-clean removes *everything* -MAINTAINERCLEANFILES = Makefile.in diff --git a/gst/vaapidecode/Makefile.am b/gst/vaapidecode/Makefile.am deleted file mode 100644 index 17bf0c988a..0000000000 --- a/gst/vaapidecode/Makefile.am +++ /dev/null @@ -1,36 +0,0 @@ -plugin_LTLIBRARIES = libgstvaapidecode.la - -libgstvaapi_CFLAGS = \ - $(LIBVA_CFLAGS) \ - -I$(top_srcdir)/gst-libs - -libgstvaapi_LIBS = \ - $(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11-$(GST_MAJORMINOR).la - -libgstvaapidecode_la_SOURCES = \ - gstvaapidecode.c \ - $(NULL) - -noinst_HEADERS = \ - gstvaapidecode.h \ - $(NULL) - -libgstvaapidecode_la_CFLAGS = \ - $(libgstvaapi_CFLAGS) \ - $(GST_CFLAGS) \ - $(GST_BASE_CFLAGS) \ - $(GST_VIDEO_CFLAGS) \ - $(GST_PLUGINS_BASE_CFLAGS) - -libgstvaapidecode_la_LIBADD = \ - $(libgstvaapi_LIBS) \ - $(GST_LIBS) \ - $(GST_BASE_LIBS) \ - $(GST_VIDEO_LIBS) \ - $(GST_PLUGINS_BASE_LIBS) - -libgstvaapidecode_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) -libgstvaapidecode_la_LIBTOOLFLAGS = --tag=disable-static - -# Extra clean files so that maintainer-clean removes *everything* -MAINTAINERCLEANFILES = Makefile.in