summaryrefslogtreecommitdiff
path: root/gst/rtmp2
diff options
context:
space:
mode:
authorStéphane Cerveau <scerveau@collabora.com>2021-02-25 15:22:15 +0100
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2021-04-11 16:16:55 +0000
commit891be511057dbcdf1f38740e55cbd376c4b25894 (patch)
treeb077e8cd0b584ebe2a10950ef2398ab3f60b48b4 /gst/rtmp2
parent7f60138ef68e2a1fef8ccd4ff3710dfccd243314 (diff)
downloadgstreamer-plugins-bad-891be511057dbcdf1f38740e55cbd376c4b25894.tar.gz
gst-plugins: 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/2110>
Diffstat (limited to 'gst/rtmp2')
-rw-r--r--gst/rtmp2/gstrtmp2.c16
-rw-r--r--gst/rtmp2/gstrtmp2element.c41
-rw-r--r--gst/rtmp2/gstrtmp2elements.h36
-rw-r--r--gst/rtmp2/gstrtmp2sink.c3
-rw-r--r--gst/rtmp2/gstrtmp2src.c3
-rw-r--r--gst/rtmp2/meson.build1
6 files changed, 89 insertions, 11 deletions
diff --git a/gst/rtmp2/gstrtmp2.c b/gst/rtmp2/gstrtmp2.c
index 1be1a3c5e..35650227a 100644
--- a/gst/rtmp2/gstrtmp2.c
+++ b/gst/rtmp2/gstrtmp2.c
@@ -23,24 +23,18 @@
#include "config.h"
#endif
-#include "gstrtmp2src.h"
-#include "gstrtmp2sink.h"
+#include "gstrtmp2elements.h"
-#include "rtmp/rtmpclient.h"
static gboolean
plugin_init (GstPlugin * plugin)
{
- gst_element_register (plugin, "rtmp2src", GST_RANK_PRIMARY + 1,
- GST_TYPE_RTMP2_SRC);
- gst_element_register (plugin, "rtmp2sink", GST_RANK_PRIMARY + 1,
- GST_TYPE_RTMP2_SINK);
+ gboolean ret = FALSE;
- gst_type_mark_as_plugin_api (GST_TYPE_RTMP_SCHEME, 0);
- gst_type_mark_as_plugin_api (GST_TYPE_RTMP_AUTHMOD, 0);
- gst_type_mark_as_plugin_api (GST_TYPE_RTMP_STOP_COMMANDS, 0);
+ ret |= GST_ELEMENT_REGISTER (rtmp2src, plugin);
+ ret |= GST_ELEMENT_REGISTER (rtmp2sink, plugin);
- return TRUE;
+ return ret;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
diff --git a/gst/rtmp2/gstrtmp2element.c b/gst/rtmp2/gstrtmp2element.c
new file mode 100644
index 000000000..2a01c06e0
--- /dev/null
+++ b/gst/rtmp2/gstrtmp2element.c
@@ -0,0 +1,41 @@
+/* GStreamer
+ * Copyright (C) 2014 David Schleef <ds@schleef.org>
+ * Copyright (C) 2017 Make.TV, Inc. <info@make.tv>
+ * Contact: Jan Alexander Steffens (heftig) <jsteffens@make.tv>
+ *
+ * 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 "gstrtmp2elements.h"
+
+#include "rtmp/rtmpclient.h"
+
+void
+rtmp2_element_init (GstPlugin * plugin)
+{
+ static gsize res = FALSE;
+
+ if (g_once_init_enter (&res)) {
+ gst_type_mark_as_plugin_api (GST_TYPE_RTMP_SCHEME, 0);
+ gst_type_mark_as_plugin_api (GST_TYPE_RTMP_AUTHMOD, 0);
+ gst_type_mark_as_plugin_api (GST_TYPE_RTMP_STOP_COMMANDS, 0);
+ g_once_init_leave (&res, TRUE);
+ }
+}
diff --git a/gst/rtmp2/gstrtmp2elements.h b/gst/rtmp2/gstrtmp2elements.h
new file mode 100644
index 000000000..be20c169a
--- /dev/null
+++ b/gst/rtmp2/gstrtmp2elements.h
@@ -0,0 +1,36 @@
+/* GStreamer
+ * Copyright (C) 2020 Huawei Technologies Co., Ltd.
+ * @Author: Stéphane Cerveau <stephane.cerveau@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_RTMP2_ELEMENTS_H__
+#define __GST_RTMP2_ELEMENTS_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gst/gst.h>
+
+void rtmp2_element_init (GstPlugin * plugin);
+
+GST_ELEMENT_REGISTER_DECLARE (rtmp2sink);
+GST_ELEMENT_REGISTER_DECLARE (rtmp2src);
+
+#endif /* __GST_RTMP2_ELEMENTS_H__ */
diff --git a/gst/rtmp2/gstrtmp2sink.c b/gst/rtmp2/gstrtmp2sink.c
index 13b4d0825..46dbe355d 100644
--- a/gst/rtmp2/gstrtmp2sink.c
+++ b/gst/rtmp2/gstrtmp2sink.c
@@ -38,6 +38,7 @@
#include "config.h"
#endif
+#include "gstrtmp2elements.h"
#include "gstrtmp2sink.h"
#include "gstrtmp2locationhandler.h"
@@ -167,6 +168,8 @@ G_DEFINE_TYPE_WITH_CODE (GstRtmp2Sink, gst_rtmp2_sink, GST_TYPE_BASE_SINK,
G_IMPLEMENT_INTERFACE (GST_TYPE_URI_HANDLER,
gst_rtmp2_sink_uri_handler_init);
G_IMPLEMENT_INTERFACE (GST_TYPE_RTMP_LOCATION_HANDLER, NULL));
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (rtmp2sink, "rtmp2sink",
+ GST_RANK_PRIMARY + 1, GST_TYPE_RTMP2_SINK, rtmp2_element_init (plugin));
static void
gst_rtmp2_sink_class_init (GstRtmp2SinkClass * klass)
diff --git a/gst/rtmp2/gstrtmp2src.c b/gst/rtmp2/gstrtmp2src.c
index 2df92e4e7..6cad882ff 100644
--- a/gst/rtmp2/gstrtmp2src.c
+++ b/gst/rtmp2/gstrtmp2src.c
@@ -36,6 +36,7 @@
#include "config.h"
#endif
+#include "gstrtmp2elements.h"
#include "gstrtmp2src.h"
#include "gstrtmp2locationhandler.h"
@@ -157,6 +158,8 @@ G_DEFINE_TYPE_WITH_CODE (GstRtmp2Src, gst_rtmp2_src, GST_TYPE_PUSH_SRC,
G_IMPLEMENT_INTERFACE (GST_TYPE_URI_HANDLER,
gst_rtmp2_src_uri_handler_init);
G_IMPLEMENT_INTERFACE (GST_TYPE_RTMP_LOCATION_HANDLER, NULL));
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (rtmp2src, "rtmp2src",
+ GST_RANK_PRIMARY + 1, GST_TYPE_RTMP2_SRC, rtmp2_element_init (plugin));
static void
gst_rtmp2_src_class_init (GstRtmp2SrcClass * klass)
diff --git a/gst/rtmp2/meson.build b/gst/rtmp2/meson.build
index c67a24867..e9cabbd64 100644
--- a/gst/rtmp2/meson.build
+++ b/gst/rtmp2/meson.build
@@ -1,5 +1,6 @@
rtmp2_sources = [
'gstrtmp2.c',
+ 'gstrtmp2element.c',
'gstrtmp2locationhandler.c',
'gstrtmp2sink.c',
'gstrtmp2src.c',