return size;
}
-
-static gboolean
-plugin_init (GstPlugin * plugin)
-{
- srtp_init ();
-
- if (!gst_srtp_enc_plugin_init (plugin))
- return FALSE;
-
- if (!gst_srtp_dec_plugin_init (plugin))
- return FALSE;
-
- gst_type_mark_as_plugin_api (GST_TYPE_SRTP_AUTH_TYPE, 0);
- gst_type_mark_as_plugin_api (GST_TYPE_SRTP_CIPHER_TYPE, 0);
-
- return TRUE;
-}
-
-GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- srtp,
- "GStreamer SRTP",
- plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
*
*/
+#include "gstsrtpelements.h"
#include "gstsrtpdec.h"
-
#include <gst/rtp/gstrtpbuffer.h>
#include <string.h>
static guint gst_srtp_dec_signals[LAST_SIGNAL] = { 0 };
-G_DEFINE_TYPE (GstSrtpDec, gst_srtp_dec, GST_TYPE_ELEMENT);
+G_DEFINE_TYPE_WITH_CODE (GstSrtpDec, gst_srtp_dec, GST_TYPE_ELEMENT,
+ GST_DEBUG_CATEGORY_INIT (gst_srtp_dec_debug, "srtpdec", 0, "SRTP dec");
+ );
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (srtpdec, "srtpdec", GST_RANK_NONE,
+ GST_TYPE_SRTP_DEC, srtp_element_init (plugin));
static void gst_srtp_dec_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
}
return res;
}
-
-
-/* entry point to initialize the plug-in
- * initialize the plug-in itself
- * register the element factories and other features
- */
-gboolean
-gst_srtp_dec_plugin_init (GstPlugin * srtpdec)
-{
- GST_DEBUG_CATEGORY_INIT (gst_srtp_dec_debug, "srtpdec", 0, "SRTP dec");
-
- return gst_element_register (srtpdec, "srtpdec", GST_RANK_NONE,
- GST_TYPE_SRTP_DEC);
-}
GType gst_srtp_dec_get_type (void);
-gboolean gst_srtp_dec_plugin_init (GstPlugin * plugin);
G_END_DECLS
--- /dev/null
+/*
+ * GStreamer - GStreamer SRTP encoder and decoder
+ *
+ * Copyright 2009-2013 Collabora Ltd.
+ * @author: Gabriel Millaire <gabriel.millaire@collabora.co.uk>
+ * @author: Olivier Crete <olivier.crete@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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+
+#define GLIB_DISABLE_DEPRECATION_WARNINGS
+
+#include "gstsrtpelements.h"
+
+
+void
+srtp_element_init (GstPlugin * plugin)
+{
+ static gsize res = FALSE;
+
+ if (g_once_init_enter (&res)) {
+ srtp_init ();
+ gst_type_mark_as_plugin_api (GST_TYPE_SRTP_AUTH_TYPE, 0);
+ gst_type_mark_as_plugin_api (GST_TYPE_SRTP_CIPHER_TYPE, 0);
+ g_once_init_leave (&res, TRUE);
+ }
+}
--- /dev/null
+/*
+ * GStreamer - GStreamer SRTP encoder
+ *
+ * Copyright 2011-2013 Collabora Ltd.
+ * @author: Olivier Crete <olivier.crete@collabora.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Alternatively, the contents of this file may be used under the
+ * GNU Lesser General Public License Version 2.1 (the "LGPL"), in
+ * which case the following provisions apply instead of the ones
+ * mentioned above:
+ *
+ * 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#ifndef __GST_SRTP_ELEMENTS_H__
+#define __GST_SRTP_ELEMENTS_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "gstsrtp.h"
+#include "gstsrtpenums.h"
+#include "gstsrtp-enumtypes.h"
+
+#include <gst/gst.h>
+
+void srtp_element_init (GstPlugin * plugin);
+
+GST_ELEMENT_REGISTER_DECLARE (srtpdec);
+GST_ELEMENT_REGISTER_DECLARE (srtpenc);
+
+#endif /* __GST_SRTP_ELEMENTS_H__ */
* will be added to every buffer.
*/
+#include "gstsrtpelements.h"
#include "gstsrtpenc.h"
#include <gst/rtp/gstrtpbuffer.h>
GST_STATIC_CAPS ("application/x-srtcp")
);
-G_DEFINE_TYPE (GstSrtpEnc, gst_srtp_enc, GST_TYPE_ELEMENT);
+G_DEFINE_TYPE_WITH_CODE (GstSrtpEnc, gst_srtp_enc, GST_TYPE_ELEMENT,
+ GST_DEBUG_CATEGORY_INIT (gst_srtp_enc_debug, "srtpenc", 0, "SRTP Enc"););
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (srtpenc, "srtpenc", GST_RANK_NONE,
+ GST_TYPE_SRTP_ENC, srtp_element_init (plugin));
static guint gst_srtp_enc_signals[LAST_SIGNAL] = { 0 };
{
return gst_srtp_enc_sink_event (pad, parent, event, TRUE);
}
-
-/* entry point to initialize the plug-in
- * initialize the plug-in itself
- * register the element factories and other features
- */
-gboolean
-gst_srtp_enc_plugin_init (GstPlugin * srtpenc)
-{
- GST_DEBUG_CATEGORY_INIT (gst_srtp_enc_debug, "srtpenc", 0, "SRTP Enc");
-
- return gst_element_register (srtpenc, "srtpenc", GST_RANK_NONE,
- GST_TYPE_SRTP_ENC);
-}
GType gst_srtp_enc_get_type (void);
-gboolean gst_srtp_enc_plugin_init (GstPlugin * plugin);
-
G_END_DECLS
#endif /* __GST_SRTPENC_H__ */
--- /dev/null
+/*
+ * GStreamer - GStreamer SRTP encoder and decoder
+ *
+ * Copyright 2009-2013 Collabora Ltd.
+ * @author: Gabriel Millaire <gabriel.millaire@collabora.co.uk>
+ * @author: Olivier Crete <olivier.crete@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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+
+#define GLIB_DISABLE_DEPRECATION_WARNINGS
+
+#include "gstsrtpelements.h"
+
+
+static gboolean
+plugin_init (GstPlugin * plugin)
+{
+ gboolean ret = FALSE;
+
+ ret |= GST_ELEMENT_REGISTER (srtpenc, plugin);
+ ret |= GST_ELEMENT_REGISTER (srtpdec, plugin);
+
+ return ret;
+}
+
+GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
+ GST_VERSION_MINOR,
+ srtp,
+ "GStreamer SRTP",
+ plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
srtp_sources = [
'gstsrtp.c',
+ 'gstsrtpelement.c',
+ 'gstsrtpplugin.c',
'gstsrtpdec.c',
'gstsrtpenc.c',
]