#include <config.h>
#endif
+#include "gstbluezelements.h"
#include "gsta2dpsink.h"
#include "gstavdtpsink.h"
#include "gstavdtpsrc.h"
#include <string.h>
-GST_DEBUG_CATEGORY (avdtp_debug);
static gboolean
plugin_init (GstPlugin * plugin)
{
- GST_DEBUG_CATEGORY_INIT (avdtp_debug, "avdtp", 0, "avdtp utils");
+ gboolean ret = FALSE;
- gst_element_register (plugin, "a2dpsink", GST_RANK_NONE, GST_TYPE_A2DP_SINK);
+ ret |= GST_ELEMENT_REGISTER (a2dpsink, plugin);
+ ret |= GST_ELEMENT_REGISTER (avdtpsink, plugin);
+ ret |= GST_ELEMENT_REGISTER (avdtpsrc, plugin);
- gst_element_register (plugin, "avdtpsink",
- GST_RANK_NONE, GST_TYPE_AVDTP_SINK);
-
- gst_element_register (plugin, "avdtpsrc", GST_RANK_NONE, GST_TYPE_AVDTP_SRC);
-
- return TRUE;
+ return ret;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
#include <unistd.h>
+#include "gstbluezelements.h"
#include "gsta2dpsink.h"
#include <gst/rtp/gstrtpbasepayload.h>
#define parent_class gst_a2dp_sink_parent_class
G_DEFINE_TYPE (GstA2dpSink, gst_a2dp_sink, GST_TYPE_BIN);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (a2dpsink, "a2dpsink", GST_RANK_NONE,
+ GST_TYPE_A2DP_SINK, bluez_element_init (plugin));
static GstStaticPadTemplate gst_a2dp_sink_factory =
GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
GType gst_a2dp_sink_get_type (void);
-gboolean gst_a2dp_sink_plugin_init (GstPlugin * plugin);
-
GstCaps *gst_a2dp_sink_get_device_caps (GstA2dpSink * self);
G_END_DECLS
#include "a2dp-codecs.h"
+#include "gstbluezelements.h"
#include "gstavdtpsink.h"
#include <gst/rtp/rtp.h>
#define parent_class gst_avdtp_sink_parent_class
G_DEFINE_TYPE (GstAvdtpSink, gst_avdtp_sink, GST_TYPE_BASE_SINK);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (avdtpsink, "avdtpsink", GST_RANK_NONE,
+ GST_TYPE_AVDTP_SINK, bluez_element_init (plugin));
static GstStaticPadTemplate avdtp_sink_factory =
GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
*/
}
-gboolean
-gst_avdtp_sink_plugin_init (GstPlugin * plugin)
-{
- return gst_element_register (plugin, "avdtpsink", GST_RANK_NONE,
- GST_TYPE_AVDTP_SINK);
-}
-
-
/* public functions */
GstCaps *
gst_avdtp_sink_get_device_caps (GstAvdtpSink * sink)
gchar *gst_avdtp_sink_get_transport (GstAvdtpSink * sink);
-gboolean gst_avdtp_sink_plugin_init (GstPlugin * plugin);
-
void gst_avdtp_sink_set_crc (GstAvdtpSink * self, gboolean crc);
void gst_avdtp_sink_set_channel_mode (GstAvdtpSink * self, const gchar * mode);
#include <poll.h>
#include <gst/rtp/gstrtppayloads.h>
+#include "gstbluezelements.h"
#include "gstavdtpsrc.h"
GST_DEBUG_CATEGORY_STATIC (avdtpsrc_debug);
#define parent_class gst_avdtp_src_parent_class
G_DEFINE_TYPE (GstAvdtpSrc, gst_avdtp_src, GST_TYPE_BASE_SRC);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (avdtpsrc, "avdtpsrc", GST_RANK_NONE,
+ GST_TYPE_AVDTP_SRC, bluez_element_init (plugin));
static GstStaticPadTemplate gst_avdtp_src_template =
GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
return TRUE;
}
-
-gboolean
-gst_avdtp_src_plugin_init (GstPlugin * plugin)
-{
- return gst_element_register (plugin, "avdtpsrc", GST_RANK_NONE,
- GST_TYPE_AVDTP_SRC);
-}
GType gst_avdtp_src_get_type (void);
-gboolean gst_avdtp_src_plugin_init (GstPlugin * plugin);
-
G_END_DECLS
#endif
--- /dev/null
+/* GStreamer bluez plugin
+ *
+ * Copyright (C) 2013 Collabora Ltd. <tim.muller@collabora.co.uk>
+ *
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "gstbluezelements.h"
+
+
+GST_DEBUG_CATEGORY (avdtp_debug);
+
+void
+bluez_element_init (GstPlugin * plugin)
+{
+ static gsize res = FALSE;
+ if (g_once_init_enter (&res)) {
+ GST_DEBUG_CATEGORY_INIT (avdtp_debug, "avdtp", 0, "avdtp utils");
+ g_once_init_leave (&res, TRUE);
+ }
+}
--- /dev/null
+/* GStreamer
+ * Copyright (C) <2020> Julian Bouzas <julian.bouzas@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_BLUEZ_ELEMENTS_H__
+#define __GST_BLUEZ_ELEMENTS_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gst/gst.h>
+
+void bluez_element_init (GstPlugin * plugin);
+
+GST_ELEMENT_REGISTER_DECLARE (a2dpsink);
+GST_ELEMENT_REGISTER_DECLARE (avdtpsink);
+GST_ELEMENT_REGISTER_DECLARE (avdtpsrc);
+
+#endif /* __GST_BLUEZ_ELEMENTS_H__ */
bluez_sources = [
'bluez-plugin.c',
+ 'gstbluezelement.c',
'gsta2dpsink.c',
'gstavdtpsink.c',
'gstavdtpsrc.c',
return result;
}
-static gboolean
-plugin_init (GstPlugin * plugin)
+void
+decklink_element_init (GstPlugin * plugin)
{
- GST_DEBUG_CATEGORY_INIT (gst_decklink_debug, "decklink", 0,
- "debug category for decklink plugin");
-
- gst_element_register (plugin, "decklinkaudiosink", GST_RANK_NONE,
- GST_TYPE_DECKLINK_AUDIO_SINK);
- gst_element_register (plugin, "decklinkvideosink", GST_RANK_NONE,
- GST_TYPE_DECKLINK_VIDEO_SINK);
- gst_element_register (plugin, "decklinkaudiosrc", GST_RANK_NONE,
- GST_TYPE_DECKLINK_AUDIO_SRC);
- gst_element_register (plugin, "decklinkvideosrc", GST_RANK_NONE,
- GST_TYPE_DECKLINK_VIDEO_SRC);
-
- gst_device_provider_register (plugin, "decklinkdeviceprovider",
- GST_RANK_PRIMARY, GST_TYPE_DECKLINK_DEVICE_PROVIDER);
-
- gst_type_mark_as_plugin_api (GST_TYPE_DECKLINK_AUDIO_CHANNELS,
- (GstPluginAPIFlags) 0);
- gst_type_mark_as_plugin_api (GST_TYPE_DECKLINK_AUDIO_CONNECTION,
- (GstPluginAPIFlags) 0);
- gst_type_mark_as_plugin_api (GST_TYPE_DECKLINK_PROFILE_ID,
- (GstPluginAPIFlags) 0);
- gst_type_mark_as_plugin_api (GST_TYPE_DECKLINK_KEYER_MODE,
- (GstPluginAPIFlags) 0);
- gst_type_mark_as_plugin_api (GST_TYPE_DECKLINK_MODE, (GstPluginAPIFlags) 0);
- gst_type_mark_as_plugin_api (GST_TYPE_DECKLINK_TIMECODE_FORMAT,
- (GstPluginAPIFlags) 0);
- gst_type_mark_as_plugin_api (GST_TYPE_DECKLINK_VIDEO_FORMAT,
- (GstPluginAPIFlags) 0);
- gst_type_mark_as_plugin_api (GST_TYPE_DECKLINK_CONNECTION,
- (GstPluginAPIFlags) 0);
-
- return TRUE;
+ static gsize res = FALSE;
+ if (g_once_init_enter (&res)) {
+ GST_DEBUG_CATEGORY_INIT (gst_decklink_debug, "decklink", 0,
+ "debug category for decklink plugin");
+ gst_type_mark_as_plugin_api (GST_TYPE_DECKLINK_AUDIO_CHANNELS, (GstPluginAPIFlags) 0);
+ gst_type_mark_as_plugin_api (GST_TYPE_DECKLINK_AUDIO_CONNECTION, (GstPluginAPIFlags) 0);
+ gst_type_mark_as_plugin_api (GST_TYPE_DECKLINK_PROFILE_ID, (GstPluginAPIFlags) 0);
+ gst_type_mark_as_plugin_api (GST_TYPE_DECKLINK_KEYER_MODE, (GstPluginAPIFlags) 0);
+ gst_type_mark_as_plugin_api (GST_TYPE_DECKLINK_MODE, (GstPluginAPIFlags) 0);
+ gst_type_mark_as_plugin_api (GST_TYPE_DECKLINK_TIMECODE_FORMAT, (GstPluginAPIFlags) 0);
+ gst_type_mark_as_plugin_api (GST_TYPE_DECKLINK_VIDEO_FORMAT, (GstPluginAPIFlags) 0);
+ gst_type_mark_as_plugin_api (GST_TYPE_DECKLINK_CONNECTION, (GstPluginAPIFlags) 0);
+
+ g_once_init_leave (&res, TRUE);
+ }
}
-
-GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- decklink,
- "Blackmagic Decklink plugin",
- plugin_init, VERSION, "LGPL", PACKAGE_NAME, GST_PACKAGE_ORIGIN)
#define WINAPI
#endif /* G_OS_WIN32 */
+void decklink_element_init (GstPlugin * plugin);
+
typedef enum {
GST_DECKLINK_MODE_AUTO,
#define parent_class gst_decklink_audio_sink_parent_class
G_DEFINE_TYPE (GstDecklinkAudioSink, gst_decklink_audio_sink,
GST_TYPE_BASE_SINK);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (decklinkaudiosink, "decklinkaudiosink", GST_RANK_NONE,
+ GST_TYPE_DECKLINK_AUDIO_SINK, decklink_element_init (plugin));
static void
gst_decklink_audio_sink_class_init (GstDecklinkAudioSinkClass * klass)
GType gst_decklink_audio_sink_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (decklinkaudiosink);
+
G_END_DECLS
#endif /* __GST_DECKLINK_AUDIO_SINK_H__ */
#define parent_class gst_decklink_audio_src_parent_class
G_DEFINE_TYPE (GstDecklinkAudioSrc, gst_decklink_audio_src, GST_TYPE_PUSH_SRC);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (decklinkaudiosrc, "decklinkaudiosrc", GST_RANK_NONE,
+ GST_TYPE_DECKLINK_AUDIO_SRC, decklink_element_init (plugin));
static void
gst_decklink_audio_src_class_init (GstDecklinkAudioSrcClass * klass)
GType gst_decklink_audio_src_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (decklinkaudiosrc);
+
G_END_DECLS
#endif /* __GST_DECKLINK_AUDIO_SRC_H__ */
G_DEFINE_TYPE (GstDecklinkDeviceProvider, gst_decklink_device_provider,
GST_TYPE_DEVICE_PROVIDER);
+GST_DEVICE_PROVIDER_REGISTER_DEFINE (decklinkdeviceprovider, "decklinkdeviceprovider",
+ GST_RANK_PRIMARY, GST_TYPE_DECKLINK_DEVICE_PROVIDER);
static void
gst_decklink_device_provider_init (GstDecklinkDeviceProvider * self)
};
GType gst_decklink_device_provider_get_type (void);
+GST_DEVICE_PROVIDER_REGISTER_DECLARE (decklinkdeviceprovider);
G_END_DECLS
--- /dev/null
+/* GStreamer
+ * Copyright (C) 2011 David Schleef <ds@schleef.org>
+ * Copyright (C) 2014 Sebastian Dröge <sebastian@centricular.com>
+ * Copyright (C) 2015 Florian Langlois <florian.langlois@fr.thalesgroup.com>
+ * Copyright (C) 2020 Sohonet <dev@sohonet.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 <gst/gst.h>
+
+#include "gstdecklinkaudiosink.h"
+#include "gstdecklinkvideosink.h"
+#include "gstdecklinkaudiosrc.h"
+#include "gstdecklinkvideosrc.h"
+#include "gstdecklinkdeviceprovider.h"
+
+static gboolean
+plugin_init (GstPlugin * plugin)
+{
+ GST_ELEMENT_REGISTER (decklinkaudiosink, plugin);
+ GST_ELEMENT_REGISTER (decklinkvideosink, plugin);
+ GST_ELEMENT_REGISTER (decklinkaudiosrc, plugin);
+ GST_ELEMENT_REGISTER (decklinkvideosrc, plugin);
+
+ GST_DEVICE_PROVIDER_REGISTER (decklinkdeviceprovider, plugin);
+
+ return TRUE;
+}
+
+GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
+ GST_VERSION_MINOR,
+ decklink,
+ "Blackmagic Decklink plugin",
+ plugin_init, VERSION, "LGPL", PACKAGE_NAME, GST_PACKAGE_ORIGIN)
#define parent_class gst_decklink_video_sink_parent_class
G_DEFINE_TYPE (GstDecklinkVideoSink, gst_decklink_video_sink,
GST_TYPE_BASE_SINK);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (decklinkvideosink, "decklinkvideosink", GST_RANK_NONE,
+ GST_TYPE_DECKLINK_VIDEO_SINK, decklink_element_init (plugin));
static gboolean
reset_framerate (GstCapsFeatures * features, GstStructure * structure,
GType gst_decklink_video_sink_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (decklinkvideosink);
+
void gst_decklink_video_sink_convert_to_internal_clock (GstDecklinkVideoSink * self,
GstClockTime * timestamp, GstClockTime * duration);
#define parent_class gst_decklink_video_src_parent_class
G_DEFINE_TYPE (GstDecklinkVideoSrc, gst_decklink_video_src, GST_TYPE_PUSH_SRC);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (decklinkvideosrc, "decklinkvideosrc", GST_RANK_NONE,
+ GST_TYPE_DECKLINK_VIDEO_SRC, decklink_element_init (plugin));
static void
gst_decklink_video_src_class_init (GstDecklinkVideoSrcClass * klass)
GType gst_decklink_video_src_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (decklinkvideosrc);
+
G_END_DECLS
#endif /* __GST_DECKLINK_VIDEO_SRC_H__ */
decklink_sources = [
+ 'gstdecklinkplugin.cpp',
'gstdecklink.cpp',
'gstdecklinkaudiosink.cpp',
'gstdecklinkvideosink.cpp',
#include <stdlib.h>
#include <string.h>
#include <gst/mpegts/mpegts.h>
+#include "gstdvbelements.h"
#include "dvbbasebin.h"
#include "parsechannels.h"
0,
G_IMPLEMENT_INTERFACE (GST_TYPE_URI_HANDLER,
dvb_base_bin_uri_handler_init));
-
+#define _do_init \
+ GST_DEBUG_CATEGORY_INIT (dvb_base_bin_debug, "dvbbasebin", 0, "DVB bin"); \
+ cam_init (); \
+ dvb_element_init (plugin);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (dvbbasebin, "dvbbasebin", GST_RANK_NONE,
+ GST_TYPE_DVB_BASE_BIN, _do_init);
static void
dvb_base_bin_ref_stream (DvbBaseBinStream * stream)
iface->set_uri = dvb_base_bin_uri_set_uri;
}
-gboolean
-gst_dvb_base_bin_plugin_init (GstPlugin * plugin)
-{
- GST_DEBUG_CATEGORY_INIT (dvb_base_bin_debug, "dvbbasebin", 0, "DVB bin");
-
- cam_init ();
-
- return gst_element_register (plugin, "dvbbasebin",
- GST_RANK_NONE, GST_TYPE_DVB_BASE_BIN);
-}
static void
dvb_base_bin_program_destroy (gpointer data)
};
GType dvb_base_bin_get_type(void);
-gboolean gst_dvb_base_bin_plugin_init (GstPlugin *plugin);
G_END_DECLS
+
/*
* gstdvb.c -
* Copyright (C) 2007 Alessandro Decina
#include <gst/gst-i18n-plugin.h>
-#include "gstdvbsrc.h"
-#include "dvbbasebin.h"
+#include "gstdvbelements.h"
static gboolean
plugin_init (GstPlugin * plugin)
{
-#ifdef ENABLE_NLS
- GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
- LOCALEDIR);
- bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
-#endif /* ENABLE_NLS */
-
- if (!gst_dvbsrc_plugin_init (plugin))
- return FALSE;
+ gboolean ret = FALSE;
- if (!gst_dvb_base_bin_plugin_init (plugin))
- return FALSE;
+ ret |= GST_ELEMENT_REGISTER (dvbsrc, plugin);
+ ret |= GST_ELEMENT_REGISTER (dvbbasebin, plugin);
- return TRUE;
+ return ret;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
--- /dev/null
+/*
+ * gstdvb.c -
+ * Copyright (C) 2007 Alessandro Decina
+ *
+ * Authors:
+ * Alessandro Decina <alessandro.d@gmail.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.
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gst/gst-i18n-plugin.h>
+
+#include "gstdvbelements.h"
+
+void
+dvb_element_init (GstPlugin * plugin)
+{
+ static gsize res = FALSE;
+ if (g_once_init_enter (&res)) {
+#ifdef ENABLE_NLS
+ GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
+ LOCALEDIR);
+ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+#endif /* ENABLE_NLS */
+ g_once_init_leave (&res, TRUE);
+ }
+}
--- /dev/null
+/* GStreamer
+ * Copyright (C) <2020> Julian Bouzas <julian.bouzas@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_DVB_ELEMENTS_H__
+#define __GST_DVB_ELEMENTS_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gst/gst.h>
+
+void dvb_element_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (dvbbasebin);
+GST_ELEMENT_REGISTER_DECLARE (dvbsrc);
+
+#endif /* __GST_DVB_ELEMENTS_H__ */
#include "config.h"
#endif
+#include "gstdvbelements.h"
#include "gstdvbsrc.h"
#include <gst/gst.h>
#include <gst/glib-compat-private.h>
#define gst_dvbsrc_parent_class parent_class
G_DEFINE_TYPE (GstDvbSrc, gst_dvbsrc, GST_TYPE_PUSH_SRC);
+#define _do_init \
+ GST_DEBUG_CATEGORY_INIT (gstdvbsrc_debug, "dvbsrc", 0, "DVB Source Element");\
+ dvb_element_init (plugin);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (dvbsrc, "dvbsrc", GST_RANK_NONE,
+ GST_TYPE_DVBSRC, _do_init);
static guint gst_dvbsrc_signals[LAST_SIGNAL] = { 0 };
* register the element factories and pad templates
* register the features
*/
-gboolean
-gst_dvbsrc_plugin_init (GstPlugin * plugin)
-{
- GST_DEBUG_CATEGORY_INIT (gstdvbsrc_debug, "dvbsrc", 0, "DVB Source Element");
-
- return gst_element_register (plugin, "dvbsrc", GST_RANK_NONE,
- GST_TYPE_DVBSRC);
-}
static GstFlowReturn
gst_dvbsrc_read_device (GstDvbSrc * object, int size, GstBuffer ** buffer)
GType gst_dvbsrc_get_type (void);
-gboolean gst_dvbsrc_plugin_init (GstPlugin * plugin);
G_END_DECLS
#endif /* __GST_DVBSRC_H__ */
'camutils.c',
'dvbbasebin.c',
'gstdvb.c',
+ 'gstdvbelement.c',
'gstdvbsrc.c',
'parsechannels.c',
]
#define parent_class gst_fbdevsink_parent_class
G_DEFINE_TYPE (GstFBDEVSink, gst_fbdevsink, GST_TYPE_VIDEO_SINK);
+GST_ELEMENT_REGISTER_DEFINE (fbdevsink, "fbdevsink", GST_RANK_NONE,
+ GST_TYPE_FBDEVSINK);
static void
gst_fbdevsink_init (GstFBDEVSink * fbdevsink)
static gboolean
plugin_init (GstPlugin * plugin)
{
- if (!gst_element_register (plugin, "fbdevsink", GST_RANK_NONE,
- GST_TYPE_FBDEVSINK))
- return FALSE;
-
- return TRUE;
+ return GST_ELEMENT_REGISTER (fbdevsink, plugin);
}
static void
};
GType gst_fbdevsink_get_type(void);
+GST_ELEMENT_REGISTER_DECLARE (fbdevsink);
G_END_DECLS
#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;
}
--- /dev/null
+/* 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);
+ }
+}
--- /dev/null
+/* 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__ */
# include "config.h"
#endif
+#include "gstipcpipelineelements.h"
#include "gstipcpipelinesink.h"
static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink",
#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);
# include "config.h"
#endif
+#include "gstipcpipelineelements.h"
#include "gstipcpipelinesrc.h"
static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
#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);
#include <string.h>
+#include "gstipcpipelineelements.h"
#include "gstipcpipelinesrc.h"
#include "gstipcslavepipeline.h"
#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);
ipcpipeline_sources = [
'gstipcpipeline.c',
+ 'gstipcpipelineelement.c',
'gstipcpipelinecomm.c',
'gstipcpipelinesink.c',
'gstipcpipelinesrc.c',
GST_DEBUG_CATEGORY_GET (CAT_PERFORMANCE, "GST_PERFORMANCE");
G_IMPLEMENT_INTERFACE (GST_TYPE_VIDEO_OVERLAY,
gst_kms_sink_video_overlay_init));
+GST_ELEMENT_REGISTER_DEFINE (kmssink, GST_PLUGIN_NAME, GST_RANK_SECONDARY,
+ GST_TYPE_KMS_SINK);
enum
{
static gboolean
plugin_init (GstPlugin * plugin)
{
- if (!gst_element_register (plugin, GST_PLUGIN_NAME, GST_RANK_SECONDARY,
- GST_TYPE_KMS_SINK))
- return FALSE;
-
- return TRUE;
+ return GST_ELEMENT_REGISTER (kmssink, plugin);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, kms,
};
GType gst_kms_sink_get_type (void) G_GNUC_CONST;
-
+GST_ELEMENT_REGISTER_DECLARE (kmssink);
G_END_DECLS
#endif /* __GST_KMS_SINK_H__ */
};
G_DEFINE_TYPE (GstMLAudioSink, gst_ml_audio_sink, GST_TYPE_AUDIO_SINK);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (mlaudiosink, "mlaudiosink",
+ GST_RANK_PRIMARY + 10, GST_TYPE_ML_AUDIO_SINK,
+ GST_DEBUG_CATEGORY_INIT (mgl_debug, "magicleap", 0, "Magic Leap elements"));
enum
{
#define GST_TYPE_ML_AUDIO_SINK gst_ml_audio_sink_get_type ()
G_DECLARE_FINAL_TYPE (GstMLAudioSink, gst_ml_audio_sink, GST, ML_AUDIO_SINK, GstAudioSink)
-
+GST_ELEMENT_REGISTER_DECLARE (mlaudiosink);
G_END_DECLS
static gboolean
plugin_init (GstPlugin * plugin)
{
- if (!gst_element_register (plugin, "mlaudiosink", GST_RANK_PRIMARY + 10,
- GST_TYPE_ML_AUDIO_SINK))
- return FALSE;
-
- GST_DEBUG_CATEGORY_INIT (mgl_debug, "magicleap", 0, "Magic Leap elements");
- return TRUE;
+ return GST_ELEMENT_REGISTER (mlaudiosink, plugin);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
'openslessink.c',
'openslessrc.c',
'opensles.c',
+ 'openslesplugin.c',
]
opensles_option = get_option('opensles')
g_mutex_unlock (&engine_mutex);
}
-static gboolean
-plugin_init (GstPlugin * plugin)
+void
+opensles_element_init (GstPlugin * plugin)
{
- g_mutex_init (&engine_mutex);
-
- if (!gst_element_register (plugin, "openslessink", GST_RANK_PRIMARY,
- GST_TYPE_OPENSLES_SINK)) {
- return FALSE;
- }
- if (!gst_element_register (plugin, "openslessrc", GST_RANK_PRIMARY,
- GST_TYPE_OPENSLES_SRC)) {
- return FALSE;
+ static gsize res = FALSE;
+ if (g_once_init_enter (&res)) {
+ g_mutex_init (&engine_mutex);
+ g_once_init_leave (&res, TRUE);
}
-
- return TRUE;
}
-
-GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- opensles,
- "OpenSL ES support for GStreamer",
- plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
#include <gst/gst.h>
#include <SLES/OpenSLES.h>
+void opensles_element_init (GstPlugin * plugin);
+
SLObjectItf gst_opensles_get_engine (void);
void gst_opensles_release_engine (SLObjectItf engine_object);
--- /dev/null
+/* GStreamer
+ * Copyright (C) 2012 Fluendo S.A. <support@fluendo.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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "opensles.h"
+#include "openslessink.h"
+#include "openslessrc.h"
+
+static gboolean
+plugin_init (GstPlugin * plugin)
+{
+ gboolean ret = FALSE;
+
+ ret |= GST_ELEMENT_REGISTER (openslessink, plugin);
+ ret |= GST_ELEMENT_REGISTER (openslessrc, plugin);
+
+ return ret;
+}
+
+GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
+ GST_VERSION_MINOR,
+ opensles,
+ "OpenSL ES support for GStreamer",
+ plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
#define parent_class gst_opensles_sink_parent_class
G_DEFINE_TYPE_WITH_CODE (GstOpenSLESSink, gst_opensles_sink,
GST_TYPE_AUDIO_BASE_SINK, _do_init);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (openslessink, "openslessink",
+ GST_RANK_PRIMARY, GST_TYPE_OPENSLES_SINK, opensles_element_init (plugin));
static GstAudioRingBuffer *
gst_opensles_sink_create_ringbuffer (GstAudioBaseSink * base)
};
GType gst_opensles_sink_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (openslessink);
G_END_DECLS
#endif /* __OPENSLESSINK_H__ */
# include <config.h>
#endif
+#include "opensles.h"
#include "openslessrc.h"
GST_DEBUG_CATEGORY_STATIC (opensles_src_debug);
#define parent_class gst_opensles_src_parent_class
G_DEFINE_TYPE_WITH_CODE (GstOpenSLESSrc, gst_opensles_src,
GST_TYPE_AUDIO_BASE_SRC, _do_init);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (openslessrc, "openslessrc",
+ GST_RANK_PRIMARY, GST_TYPE_OPENSLES_SRC, opensles_element_init (plugin));
enum
{
};
GType gst_opensles_src_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (openslessrc);
G_END_DECLS
#endif /* __OPENSLESSRC_H__ */
static gboolean
plugin_init (GstPlugin * plugin)
{
- return gst_element_register (plugin, "shmsrc",
- GST_RANK_NONE, GST_TYPE_SHM_SRC) &&
- gst_element_register (plugin, "shmsink",
- GST_RANK_NONE, GST_TYPE_SHM_SINK);
+ gboolean ret = FALSE;
+
+ ret |= GST_ELEMENT_REGISTER (shmsrc, plugin);
+ ret |= GST_ELEMENT_REGISTER (shmsink, plugin);
+
+ return ret;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
#define gst_shm_sink_parent_class parent_class
G_DEFINE_TYPE (GstShmSink, gst_shm_sink, GST_TYPE_BASE_SINK);
+GST_ELEMENT_REGISTER_DEFINE (shmsink, "shmsink", GST_RANK_NONE,
+ GST_TYPE_SHM_SINK);
static void gst_shm_sink_finalize (GObject * object);
static void gst_shm_sink_set_property (GObject * object, guint prop_id,
GType gst_shm_sink_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (shmsink);
+
G_END_DECLS
#endif /* __GST_SHM_SINK_H__ */
#define gst_shm_src_parent_class parent_class
G_DEFINE_TYPE (GstShmSrc, gst_shm_src, GST_TYPE_PUSH_SRC);
+GST_ELEMENT_REGISTER_DEFINE (shmsrc, "shmsrc", GST_RANK_NONE, GST_TYPE_SHM_SRC);
static void gst_shm_src_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
GType gst_shm_src_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (shmsrc);
+
struct _GstShmPipe {
int use_count;
#include <gst/gst.h>
#include "gstuvch264_mjpgdemux.h"
#include "gstuvch264_src.h"
-
-extern GType gst_uvc_h264_device_provider_get_type ();
+#include "gstuvch264deviceprovider.h"
static gboolean
plugin_init (GstPlugin * plugin)
{
- if (!gst_element_register (plugin, "uvch264mjpgdemux", GST_RANK_NONE,
- GST_TYPE_UVC_H264_MJPG_DEMUX))
- return FALSE;
-
- if (!gst_element_register (plugin, "uvch264src", GST_RANK_NONE,
- GST_TYPE_UVC_H264_SRC))
- return FALSE;
+ gboolean ret = FALSE;
- if (!gst_device_provider_register (plugin, "uvch264deviceprovider",
- GST_RANK_PRIMARY, gst_uvc_h264_device_provider_get_type ()))
- return FALSE;
+ ret |= GST_ELEMENT_REGISTER (uvch264mjpgdemux, plugin);
+ ret |= GST_ELEMENT_REGISTER (uvch264src, plugin);
+ ret |= GST_DEVICE_PROVIDER_REGISTER (uvch264deviceprovider, plugin);
- return TRUE;
+ return ret;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
#define gst_uvc_h264_mjpg_demux_parent_class parent_class
G_DEFINE_TYPE (GstUvcH264MjpgDemux, gst_uvc_h264_mjpg_demux, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE (uvch264mjpgdemux, "uvch264mjpgdemux",
+ GST_RANK_NONE, GST_TYPE_UVC_H264_MJPG_DEMUX);
static void
gst_uvc_h264_mjpg_demux_class_init (GstUvcH264MjpgDemuxClass * klass)
GType gst_uvc_h264_mjpg_demux_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (uvch264mjpgdemux);
+
G_END_DECLS
#endif /* __GST_UVC_H264_MJPG_DEMUX_H__ */
#define gst_uvc_h264_src_parent_class parent_class
G_DEFINE_TYPE (GstUvcH264Src, gst_uvc_h264_src, GST_TYPE_BASE_CAMERA_SRC);
+GST_ELEMENT_REGISTER_DEFINE (uvch264src, "uvch264src", GST_RANK_NONE,
+ GST_TYPE_UVC_H264_SRC);
#define GST_UVC_H264_SRC_VF_CAPS_STR \
GST_VIDEO_CAPS_MAKE (GST_VIDEO_FORMATS_ALL) ";" \
GstBaseCameraSrcClass parent;
};
+GST_ELEMENT_REGISTER_DECLARE (uvch264src);
+
G_END_DECLS
#endif /* __GST_UVC_H264_SRC_H__ */
G_DEFINE_TYPE (GstUvcH264Device, gst_uvc_h264_device, GST_TYPE_DEVICE);
/* *INDENT-ON* */
+GST_DEVICE_PROVIDER_REGISTER_DEFINE (uvch264deviceprovider,
+ "uvch264deviceprovider", GST_RANK_PRIMARY,
+ gst_uvc_h264_device_provider_get_type ());
static void
gst_uvc_h264_device_get_property (GObject * object, guint prop_id,
G_DECLARE_FINAL_TYPE (GstUvcH264Device, gst_uvc_h264_device, GST, UVC_H264_DEVICE, GstDevice)
G_DECLARE_FINAL_TYPE (GstUvcH264DeviceProvider, gst_uvc_h264_device_provider, GST, UVC_H264_DEVICE_PROVIDER, GstDeviceProvider)
-
+GST_DEVICE_PROVIDER_REGISTER_DECLARE (uvch264deviceprovider);
G_END_DECLS