summaryrefslogtreecommitdiff
path: root/ext/dtls
diff options
context:
space:
mode:
authorStéphane Cerveau <scerveau@collabora.com>2021-02-17 12:22:07 +0100
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2021-03-23 14:19:16 +0000
commita216a1f2cf84b66601524be347ac4b45a995b044 (patch)
tree7e8bfffbffb6e1cdcdfd61a82a262dc67b2b6c25 /ext/dtls
parent8e1d1325fb4648065d915863f43ee21dc65c40fe (diff)
downloadgstreamer-plugins-bad-a216a1f2cf84b66601524be347ac4b45a995b044.tar.gz
dtls: 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/2038>
Diffstat (limited to 'ext/dtls')
-rw-r--r--ext/dtls/gstdtlsdec.c3
-rw-r--r--ext/dtls/gstdtlselement.c44
-rw-r--r--ext/dtls/gstdtlselements.h38
-rw-r--r--ext/dtls/gstdtlsenc.c3
-rw-r--r--ext/dtls/gstdtlssrtpdec.c3
-rw-r--r--ext/dtls/gstdtlssrtpdemux.c4
-rw-r--r--ext/dtls/gstdtlssrtpenc.c3
-rw-r--r--ext/dtls/meson.build1
8 files changed, 99 insertions, 0 deletions
diff --git a/ext/dtls/gstdtlsdec.c b/ext/dtls/gstdtlsdec.c
index 7b370e26b..f96dd753e 100644
--- a/ext/dtls/gstdtlsdec.c
+++ b/ext/dtls/gstdtlsdec.c
@@ -27,6 +27,7 @@
#include "config.h"
#endif
+#include "gstdtlselements.h"
#include "gstdtlsdec.h"
#include "gstdtlscertificate.h"
@@ -48,6 +49,8 @@ GST_DEBUG_CATEGORY_STATIC (gst_dtls_dec_debug);
#define gst_dtls_dec_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstDtlsDec, gst_dtls_dec, GST_TYPE_ELEMENT,
GST_DEBUG_CATEGORY_INIT (gst_dtls_dec_debug, "dtlsdec", 0, "DTLS Decoder"));
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (dtlsdec, "dtlsdec", GST_RANK_NONE,
+ GST_TYPE_DTLS_DEC, dtls_element_init (plugin));
enum
{
diff --git a/ext/dtls/gstdtlselement.c b/ext/dtls/gstdtlselement.c
new file mode 100644
index 000000000..6945339f9
--- /dev/null
+++ b/ext/dtls/gstdtlselement.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2014, Ericsson AB. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this
+ * list of conditions and the following disclaimer in the documentation and/or other
+ * materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+ * OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "gstdtlselements.h"
+#include "gstdtlsconnection.h"
+
+
+#include <gst/gst.h>
+
+void
+dtls_element_init (GstPlugin * plugin)
+{
+ static gsize res = FALSE;
+ if (g_once_init_enter (&res)) {
+ gst_type_mark_as_plugin_api (GST_DTLS_TYPE_CONNECTION_STATE, 0);
+ g_once_init_leave (&res, TRUE);
+ }
+}
diff --git a/ext/dtls/gstdtlselements.h b/ext/dtls/gstdtlselements.h
new file mode 100644
index 000000000..50d03284d
--- /dev/null
+++ b/ext/dtls/gstdtlselements.h
@@ -0,0 +1,38 @@
+/* GStreamer
+ * Copyright (C) <2020> The Gstreamer Contributors.
+ *
+ * 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_DTLS_ELEMENTS_H__
+#define __GST_DTLS_ELEMENTS_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gst/gst.h>
+
+void dtls_element_init (GstPlugin * plugin);
+
+GST_ELEMENT_REGISTER_DECLARE (dtlsdec);
+GST_ELEMENT_REGISTER_DECLARE (dtlsenc);
+GST_ELEMENT_REGISTER_DECLARE (dtlssrtpdec);
+GST_ELEMENT_REGISTER_DECLARE (dtlssrtpdemux);
+GST_ELEMENT_REGISTER_DECLARE (dtlssrtpenc);
+
+#endif /* __GST_DTLS_ELEMENT_H__ */
diff --git a/ext/dtls/gstdtlsenc.c b/ext/dtls/gstdtlsenc.c
index e64ee4d6c..09015f1b7 100644
--- a/ext/dtls/gstdtlsenc.c
+++ b/ext/dtls/gstdtlsenc.c
@@ -27,6 +27,7 @@
#include "config.h"
#endif
+#include "gstdtlselements.h"
#include "gstdtlsenc.h"
#include "gstdtlsdec.h"
@@ -48,6 +49,8 @@ GST_DEBUG_CATEGORY_STATIC (gst_dtls_enc_debug);
#define gst_dtls_enc_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstDtlsEnc, gst_dtls_enc, GST_TYPE_ELEMENT,
GST_DEBUG_CATEGORY_INIT (gst_dtls_enc_debug, "dtlsenc", 0, "DTLS Encoder"));
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (dtlsenc, "dtlsenc", GST_RANK_NONE,
+ GST_TYPE_DTLS_ENC, dtls_element_init (plugin));
enum
{
diff --git a/ext/dtls/gstdtlssrtpdec.c b/ext/dtls/gstdtlssrtpdec.c
index 8db69ba08..37121cd2b 100644
--- a/ext/dtls/gstdtlssrtpdec.c
+++ b/ext/dtls/gstdtlssrtpdec.c
@@ -27,6 +27,7 @@
#include "config.h"
#endif
+#include "gstdtlselements.h"
#include "gstdtlssrtpdec.h"
#include "gstdtlsconnection.h"
@@ -62,6 +63,8 @@ GST_DEBUG_CATEGORY_STATIC (gst_dtls_srtp_dec_debug);
G_DEFINE_TYPE_WITH_CODE (GstDtlsSrtpDec, gst_dtls_srtp_dec,
GST_TYPE_DTLS_SRTP_BIN, GST_DEBUG_CATEGORY_INIT (gst_dtls_srtp_dec_debug,
"dtlssrtpdec", 0, "DTLS Decoder"));
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (dtlssrtpdec, "dtlssrtpdec",
+ GST_RANK_NONE, GST_TYPE_DTLS_SRTP_DEC, dtls_element_init (plugin));
enum
{
diff --git a/ext/dtls/gstdtlssrtpdemux.c b/ext/dtls/gstdtlssrtpdemux.c
index ab1ef7082..ca7985be1 100644
--- a/ext/dtls/gstdtlssrtpdemux.c
+++ b/ext/dtls/gstdtlssrtpdemux.c
@@ -27,6 +27,7 @@
#include "config.h"
#endif
+#include "gstdtlselements.h"
#include "gstdtlssrtpdemux.h"
#define PACKET_IS_DTLS(b) (b > 0x13 && b < 0x40)
@@ -59,6 +60,9 @@ GST_DEBUG_CATEGORY_STATIC (gst_gst_dtls_srtp_demux_debug);
G_DEFINE_TYPE_WITH_CODE (GstDtlsSrtpDemux, gst_dtls_srtp_demux,
GST_TYPE_ELEMENT, GST_DEBUG_CATEGORY_INIT (gst_gst_dtls_srtp_demux_debug,
"dtlssrtpdemux", 0, "DTLS SRTP Demultiplexer"));
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (dtlssrtpdemux, "dtlssrtpdemux",
+ GST_RANK_NONE, GST_TYPE_DTLS_SRTP_DEMUX, dtls_element_init (plugin));
+
static GstFlowReturn sink_chain (GstPad *, GstObject * self, GstBuffer *);
diff --git a/ext/dtls/gstdtlssrtpenc.c b/ext/dtls/gstdtlssrtpenc.c
index 11f5198cb..603d37454 100644
--- a/ext/dtls/gstdtlssrtpenc.c
+++ b/ext/dtls/gstdtlssrtpenc.c
@@ -27,6 +27,7 @@
#include "config.h"
#endif
+#include "gstdtlselements.h"
#include "gstdtlssrtpenc.h"
#include "gstdtlsconnection.h"
@@ -64,6 +65,8 @@ GST_DEBUG_CATEGORY_STATIC (gst_dtls_srtp_enc_debug);
G_DEFINE_TYPE_WITH_CODE (GstDtlsSrtpEnc, gst_dtls_srtp_enc,
GST_TYPE_DTLS_SRTP_BIN, GST_DEBUG_CATEGORY_INIT (gst_dtls_srtp_enc_debug,
"dtlssrtpenc", 0, "DTLS Decoder"));
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (dtlssrtpenc, "dtlssrtpenc",
+ GST_RANK_NONE, GST_TYPE_DTLS_SRTP_ENC, dtls_element_init (plugin));
enum
{
diff --git a/ext/dtls/meson.build b/ext/dtls/meson.build
index 74babae17..99c2ffe13 100644
--- a/ext/dtls/meson.build
+++ b/ext/dtls/meson.build
@@ -9,6 +9,7 @@ dtls_sources = [
'gstdtlssrtpdemux.c',
'gstdtlssrtpenc.c',
'plugin.c',
+ 'gstdtlselement.c',
]
openssl_dep = dependency('openssl', version : '>= 1.0.1', required : get_option('dtls'))