summaryrefslogtreecommitdiff
path: root/sys/ipcpipeline
diff options
context:
space:
mode:
authorStéphane Cerveau <scerveau@collabora.com>2021-03-26 11:00:50 +0100
committerOlivier CrĂȘte <olivier.crete@ocrete.ca>2021-04-09 19:23:40 +0000
commitda9e012e8a0b82e9487ab9802162023d87d63d3f (patch)
treec0a13fd3d7a2f34a9dfe61d3ef5943b46e96a692 /sys/ipcpipeline
parentfee725f3cc75a74b77ee3ce785e65f1d2d500305 (diff)
downloadgstreamer-plugins-bad-da9e012e8a0b82e9487ab9802162023d87d63d3f.tar.gz
plugins-sys: allow per feature registration
Split plugin into features including dynamic types which can be indiviually registered during a static build. More details here: https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/199 https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/661 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2116>
Diffstat (limited to 'sys/ipcpipeline')
-rw-r--r--sys/ipcpipeline/gstipcpipeline.c16
-rw-r--r--sys/ipcpipeline/gstipcpipelineelement.c37
-rw-r--r--sys/ipcpipeline/gstipcpipelineelements.h37
-rw-r--r--sys/ipcpipeline/gstipcpipelinesink.c4
-rw-r--r--sys/ipcpipeline/gstipcpipelinesrc.c4
-rw-r--r--sys/ipcpipeline/gstipcslavepipeline.c4
-rw-r--r--sys/ipcpipeline/meson.build1
7 files changed, 92 insertions, 11 deletions
diff --git a/sys/ipcpipeline/gstipcpipeline.c b/sys/ipcpipeline/gstipcpipeline.c
index 4d647d49d..5b2f5c53e 100644
--- a/sys/ipcpipeline/gstipcpipeline.c
+++ b/sys/ipcpipeline/gstipcpipeline.c
@@ -22,21 +22,15 @@
#include "config.h"
#endif
-#include "gstipcpipelinecomm.h"
-#include "gstipcpipelinesink.h"
-#include "gstipcpipelinesrc.h"
-#include "gstipcslavepipeline.h"
+#include "gstipcpipelineelements.h"
+
static gboolean
plugin_init (GstPlugin * plugin)
{
- gst_ipc_pipeline_comm_plugin_init ();
- gst_element_register (plugin, "ipcpipelinesrc", GST_RANK_NONE,
- GST_TYPE_IPC_PIPELINE_SRC);
- gst_element_register (plugin, "ipcpipelinesink", GST_RANK_NONE,
- GST_TYPE_IPC_PIPELINE_SINK);
- gst_element_register (plugin, "ipcslavepipeline", GST_RANK_NONE,
- GST_TYPE_IPC_SLAVE_PIPELINE);
+ GST_ELEMENT_REGISTER (ipcpipelinesrc, plugin);
+ GST_ELEMENT_REGISTER (ipcpipelinesink, plugin);
+ GST_ELEMENT_REGISTER (ipcslavepipeline, plugin);
return TRUE;
}
diff --git a/sys/ipcpipeline/gstipcpipelineelement.c b/sys/ipcpipeline/gstipcpipelineelement.c
new file mode 100644
index 000000000..ce22760d7
--- /dev/null
+++ b/sys/ipcpipeline/gstipcpipelineelement.c
@@ -0,0 +1,37 @@
+/* GStreamer
+ * Copyright (C) 2017 YouView TV Ltd
+ * Author: George Kiagiadakis <george.Kiagiadakis@collabora.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Suite 500,
+ * Boston, MA 02110-1335, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "gstipcpipelineelements.h"
+#include "gstipcpipelinecomm.h"
+
+
+void
+icepipeline_element_init (GstPlugin * plugin)
+{
+ static gsize res = FALSE;
+ if (g_once_init_enter (&res)) {
+ gst_ipc_pipeline_comm_plugin_init ();
+ g_once_init_leave (&res, TRUE);
+ }
+}
diff --git a/sys/ipcpipeline/gstipcpipelineelements.h b/sys/ipcpipeline/gstipcpipelineelements.h
new file mode 100644
index 000000000..97469221d
--- /dev/null
+++ b/sys/ipcpipeline/gstipcpipelineelements.h
@@ -0,0 +1,37 @@
+/* GStreamer
+ * Copyright (C) 2017 YouView TV Ltd
+ * Author: George Kiagiadakis <george.Kiagiadakis@collabora.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+
+#ifndef __GST_IPCPIPELINE_ELEMENTS_H__
+#define __GST_IPCPIPELINE_ELEMENTS_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gst/gst.h>
+
+void icepipeline_element_init (GstPlugin * plugin);
+
+GST_ELEMENT_REGISTER_DECLARE (ipcpipelinesink);
+GST_ELEMENT_REGISTER_DECLARE (ipcpipelinesrc);
+GST_ELEMENT_REGISTER_DECLARE (ipcslavepipeline);
+
+#endif /* __GST_IPCPIPELINE_ELEMENTS_H__ */
diff --git a/sys/ipcpipeline/gstipcpipelinesink.c b/sys/ipcpipeline/gstipcpipelinesink.c
index 398bbf8e6..cc31ebcb7 100644
--- a/sys/ipcpipeline/gstipcpipelinesink.c
+++ b/sys/ipcpipeline/gstipcpipelinesink.c
@@ -73,6 +73,7 @@
# include "config.h"
#endif
+#include "gstipcpipelineelements.h"
#include "gstipcpipelinesink.h"
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
@@ -109,6 +110,9 @@ enum
#define gst_ipc_pipeline_sink_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstIpcPipelineSink, gst_ipc_pipeline_sink,
GST_TYPE_ELEMENT, _do_init);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (ipcpipelinesink, "ipcpipelinesink",
+ GST_RANK_NONE, GST_TYPE_IPC_PIPELINE_SINK,
+ icepipeline_element_init (plugin));
static void gst_ipc_pipeline_sink_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
diff --git a/sys/ipcpipeline/gstipcpipelinesrc.c b/sys/ipcpipeline/gstipcpipelinesrc.c
index fbb756819..9d46d63b0 100644
--- a/sys/ipcpipeline/gstipcpipelinesrc.c
+++ b/sys/ipcpipeline/gstipcpipelinesrc.c
@@ -40,6 +40,7 @@
# include "config.h"
#endif
+#include "gstipcpipelineelements.h"
#include "gstipcpipelinesrc.h"
static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
@@ -79,6 +80,9 @@ static GQuark QUARK_UPSTREAM;
#define gst_ipc_pipeline_src_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstIpcPipelineSrc, gst_ipc_pipeline_src,
GST_TYPE_ELEMENT, _do_init);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (ipcpipelinesrc, "ipcpipelinesrc",
+ GST_RANK_NONE, GST_TYPE_IPC_PIPELINE_SRC,
+ icepipeline_element_init (plugin));
static void gst_ipc_pipeline_src_finalize (GObject * object);
static void gst_ipc_pipeline_src_dispose (GObject * object);
diff --git a/sys/ipcpipeline/gstipcslavepipeline.c b/sys/ipcpipeline/gstipcslavepipeline.c
index 3ec512ef8..90de4e939 100644
--- a/sys/ipcpipeline/gstipcslavepipeline.c
+++ b/sys/ipcpipeline/gstipcslavepipeline.c
@@ -42,6 +42,7 @@
#include <string.h>
+#include "gstipcpipelineelements.h"
#include "gstipcpipelinesrc.h"
#include "gstipcslavepipeline.h"
@@ -53,6 +54,9 @@ GST_DEBUG_CATEGORY_STATIC (gst_ipcslavepipeline_debug);
#define gst_ipc_slave_pipeline_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstIpcSlavePipeline, gst_ipc_slave_pipeline,
GST_TYPE_PIPELINE, _do_init);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (ipcslavepipeline, "ipcslavepipeline",
+ GST_RANK_NONE, GST_TYPE_IPC_SLAVE_PIPELINE,
+ icepipeline_element_init (plugin));
static gboolean gst_ipc_slave_pipeline_post_message (GstElement * element,
GstMessage * message);
diff --git a/sys/ipcpipeline/meson.build b/sys/ipcpipeline/meson.build
index aa7ce399a..8d449a020 100644
--- a/sys/ipcpipeline/meson.build
+++ b/sys/ipcpipeline/meson.build
@@ -1,5 +1,6 @@
ipcpipeline_sources = [
'gstipcpipeline.c',
+ 'gstipcpipelineelement.c',
'gstipcpipelinecomm.c',
'gstipcpipelinesink.c',
'gstipcpipelinesrc.c',