gst-plugins: allow per feature registration
authorStéphane Cerveau <scerveau@collabora.com>
Thu, 25 Feb 2021 14:22:15 +0000 (15:22 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Sun, 11 Apr 2021 16:16:55 +0000 (16:16 +0000)
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>

322 files changed:
gst/accurip/gstaccurip.c
gst/accurip/gstaccurip.h
gst/adpcmdec/adpcmdec.c
gst/adpcmenc/adpcmenc.c
gst/aiff/aiff.c
gst/aiff/aiffelements.h [new file with mode: 0644]
gst/aiff/aiffmux.c
gst/aiff/aiffparse.c
gst/aiff/gstaiffelement.c [new file with mode: 0644]
gst/aiff/meson.build
gst/asfmux/gstasf.c
gst/asfmux/gstasfmux.c
gst/asfmux/gstasfmux.h
gst/asfmux/gstasfparse.c
gst/asfmux/gstasfparse.h
gst/asfmux/gstrtpasfpay.c
gst/asfmux/gstrtpasfpay.h
gst/audiobuffersplit/gstaudiobuffersplit.c
gst/audiobuffersplit/gstaudiobuffersplit.h
gst/audiofxbad/gstaudiochannelmix.c
gst/audiofxbad/gstaudiochannelmix.h
gst/audiofxbad/gstaudiofxbad.c
gst/audiolatency/gstaudiolatency.c
gst/audiolatency/gstaudiolatency.h
gst/audiomixmatrix/gstaudiomixmatrix.c
gst/audiomixmatrix/gstaudiomixmatrix.h
gst/audiovisualizers/gstspacescope.c
gst/audiovisualizers/gstspacescope.h
gst/audiovisualizers/gstspectrascope.c
gst/audiovisualizers/gstspectrascope.h
gst/audiovisualizers/gstsynaescope.c
gst/audiovisualizers/gstsynaescope.h
gst/audiovisualizers/gstwavescope.c
gst/audiovisualizers/gstwavescope.h
gst/audiovisualizers/plugin.c
gst/autoconvert/gstautoconvert.c
gst/autoconvert/gstautoconvert.h
gst/autoconvert/gstautovideoconvert.c
gst/autoconvert/gstautovideoconvert.h
gst/autoconvert/plugin.c
gst/bayer/gstbayer.c
gst/bayer/gstbayer2rgb.c
gst/bayer/gstbayerelements.h [new file with mode: 0644]
gst/bayer/gstrgb2bayer.c
gst/camerabin2/gstcamerabin2.c
gst/camerabin2/gstcamerabin2.h
gst/camerabin2/gstplugin.c
gst/camerabin2/gstviewfinderbin.c
gst/camerabin2/gstviewfinderbin.h
gst/camerabin2/gstwrappercamerabinsrc.c
gst/camerabin2/gstwrappercamerabinsrc.h
gst/coloreffects/gstchromahold.c
gst/coloreffects/gstchromahold.h
gst/coloreffects/gstcoloreffects.c
gst/coloreffects/gstcoloreffects.h
gst/coloreffects/gstplugin.c
gst/debugutils/debugutilsbad.c
gst/debugutils/fpsdisplaysink.c
gst/debugutils/gstchecksumsink.c
gst/debugutils/gstchopmydata.c
gst/debugutils/gstclockselect.c
gst/debugutils/gstcompare.c
gst/debugutils/gstdebugspy.c
gst/debugutils/gstdebugutilsbadelements.h [new file with mode: 0644]
gst/debugutils/gsterrorignore.c
gst/debugutils/gstfakeaudiosink.c
gst/debugutils/gstfakevideosink.c
gst/debugutils/gsttestsrcbin.c
gst/debugutils/gstwatchdog.c
gst/dvbsubenc/gstdvbsubenc.c
gst/dvbsubenc/gstdvbsubenc.h
gst/dvbsuboverlay/gstdvbsuboverlay.c
gst/dvbsuboverlay/gstdvbsuboverlay.h
gst/dvdspu/gstdvdspu.c
gst/dvdspu/gstdvdspu.h
gst/faceoverlay/gstfaceoverlay.c
gst/faceoverlay/gstfaceoverlay.h
gst/festival/gstfestival.c
gst/festival/gstfestival.h
gst/fieldanalysis/gstfieldanalysis.c
gst/fieldanalysis/gstfieldanalysis.h
gst/freeverb/gstfreeverb.c
gst/freeverb/gstfreeverb.h
gst/gaudieffects/gstburn.c
gst/gaudieffects/gstburn.h
gst/gaudieffects/gstchromium.c
gst/gaudieffects/gstchromium.h
gst/gaudieffects/gstdilate.c
gst/gaudieffects/gstdilate.h
gst/gaudieffects/gstdodge.c
gst/gaudieffects/gstdodge.h
gst/gaudieffects/gstexclusion.c
gst/gaudieffects/gstexclusion.h
gst/gaudieffects/gstgaussblur.c
gst/gaudieffects/gstgaussblur.h
gst/gaudieffects/gstplugin.c
gst/gaudieffects/gstplugin.h [deleted file]
gst/gaudieffects/gstsolarize.c
gst/gaudieffects/gstsolarize.h
gst/gdp/gstgdp.c
gst/gdp/gstgdpdepay.c
gst/gdp/gstgdpdepay.h
gst/gdp/gstgdpelement.c [new file with mode: 0644]
gst/gdp/gstgdpelements.h [new file with mode: 0644]
gst/gdp/gstgdppay.c
gst/gdp/gstgdppay.h
gst/gdp/meson.build
gst/geometrictransform/gstbulge.c
gst/geometrictransform/gstbulge.h
gst/geometrictransform/gstcircle.c
gst/geometrictransform/gstcircle.h
gst/geometrictransform/gstdiffuse.c
gst/geometrictransform/gstdiffuse.h
gst/geometrictransform/gstfisheye.c
gst/geometrictransform/gstfisheye.h
gst/geometrictransform/gstkaleidoscope.c
gst/geometrictransform/gstkaleidoscope.h
gst/geometrictransform/gstmarble.c
gst/geometrictransform/gstmarble.h
gst/geometrictransform/gstmirror.c
gst/geometrictransform/gstmirror.h
gst/geometrictransform/gstperspective.c
gst/geometrictransform/gstperspective.h
gst/geometrictransform/gstpinch.c
gst/geometrictransform/gstpinch.h
gst/geometrictransform/gstrotate.c
gst/geometrictransform/gstrotate.h
gst/geometrictransform/gstsphere.c
gst/geometrictransform/gstsphere.h
gst/geometrictransform/gstsquare.c
gst/geometrictransform/gstsquare.h
gst/geometrictransform/gststretch.c
gst/geometrictransform/gststretch.h
gst/geometrictransform/gsttunnel.c
gst/geometrictransform/gsttunnel.h
gst/geometrictransform/gsttwirl.c
gst/geometrictransform/gsttwirl.h
gst/geometrictransform/gstwaterripple.c
gst/geometrictransform/gstwaterripple.h
gst/geometrictransform/plugin.c
gst/id3tag/gstid3mux.c
gst/id3tag/gstid3mux.h
gst/inter/gstinter.c
gst/inter/gstinteraudiosink.c
gst/inter/gstinteraudiosink.h
gst/inter/gstinteraudiosrc.c
gst/inter/gstinteraudiosrc.h
gst/inter/gstintersubsink.c
gst/inter/gstintersubsink.h
gst/inter/gstintersubsrc.c
gst/inter/gstintersubsrc.h
gst/inter/gstintervideosink.c
gst/inter/gstintervideosink.h
gst/inter/gstintervideosrc.c
gst/inter/gstintervideosrc.h
gst/interlace/gstinterlace.c
gst/ivfparse/gstivfparse.c
gst/ivfparse/gstivfparse.h
gst/ivtc/gstcombdetect.c
gst/ivtc/gstcombdetect.h
gst/ivtc/gstivtc.c
gst/ivtc/gstivtc.h
gst/jp2kdecimator/gstjp2kdecimator.c
gst/jp2kdecimator/gstjp2kdecimator.h
gst/jpegformat/gstjifmux.c
gst/jpegformat/gstjifmux.h
gst/jpegformat/gstjpegformat.c
gst/jpegformat/gstjpegparse.c
gst/jpegformat/gstjpegparse.h
gst/librfb/gstrfbsrc.c
gst/librfb/gstrfbsrc.h
gst/midi/midi.c
gst/midi/midiparse.c
gst/midi/midiparse.h
gst/mpegdemux/gstmpegdemux.c
gst/mpegdemux/gstmpegdemux.h
gst/mpegdemux/plugin.c
gst/mpegpsmux/mpegpsmux.c
gst/mpegpsmux/mpegpsmux.h
gst/mpegtsdemux/gsttsdemux.c
gst/mpegtsdemux/mpegtsbase.c
gst/mpegtsdemux/mpegtsparse.c
gst/mpegtsdemux/mpegtsparse.h
gst/mpegtsdemux/tsdemux.c
gst/mpegtsdemux/tsdemux.h
gst/mpegtsmux/gstatscmux.c
gst/mpegtsmux/gstatscmux.h
gst/mpegtsmux/gstbasetsmux.c
gst/mpegtsmux/gstmpegtsmux.c
gst/mpegtsmux/gstmpegtsmux.h
gst/mpegtsmux/gstmpegtsmuxplugin.c
gst/mxf/gstmxfelement.c [new file with mode: 0644]
gst/mxf/gstmxfelements.h [new file with mode: 0644]
gst/mxf/meson.build
gst/mxf/mxf.c
gst/mxf/mxfdemux.c
gst/mxf/mxfmux.c
gst/netsim/gstnetsim.c
gst/netsim/gstnetsim.h
gst/onvif/gstrtponvif.c
gst/onvif/gstrtponvifparse.c
gst/onvif/gstrtponvifparse.h
gst/onvif/gstrtponviftimestamp.c
gst/onvif/gstrtponviftimestamp.h
gst/pcapparse/gstirtspparse.c
gst/pcapparse/gstirtspparse.h
gst/pcapparse/gstpcapparse.c
gst/pcapparse/gstpcapparse.h
gst/pcapparse/plugin.c
gst/pnm/gstpnm.c
gst/pnm/gstpnmdec.c
gst/pnm/gstpnmdec.h
gst/pnm/gstpnmenc.c
gst/pnm/gstpnmenc.h
gst/proxy/gstproxy.c
gst/proxy/gstproxysink.c
gst/proxy/gstproxysink.h
gst/proxy/gstproxysrc.c
gst/proxy/gstproxysrc.h
gst/rawparse/gstaudioparse.c
gst/rawparse/gstaudioparse.h
gst/rawparse/gstvideoparse.c
gst/rawparse/gstvideoparse.h
gst/rawparse/plugin.c
gst/removesilence/gstremovesilence.c
gst/removesilence/gstremovesilence.h
gst/rist/gstrist.c [new file with mode: 0644]
gst/rist/gstrist.h
gst/rist/gstristplugin.c
gst/rist/gstristrtpdeext.c
gst/rist/gstristrtpext.c
gst/rist/gstristrtxreceive.c
gst/rist/gstristrtxsend.c
gst/rist/gstristsink.c
gst/rist/gstristsrc.c
gst/rist/gstroundrobin.c
gst/rist/gstroundrobin.h
gst/rist/meson.build
gst/rtmp2/gstrtmp2.c
gst/rtmp2/gstrtmp2element.c [new file with mode: 0644]
gst/rtmp2/gstrtmp2elements.h [new file with mode: 0644]
gst/rtmp2/gstrtmp2sink.c
gst/rtmp2/gstrtmp2src.c
gst/rtmp2/meson.build
gst/rtp/gstrtpsink.c
gst/rtp/gstrtpsink.h
gst/rtp/gstrtpsrc.c
gst/rtp/gstrtpsrc.h
gst/rtp/plugin.c
gst/sdp/gstsdpdemux.c
gst/sdp/gstsdpdemux.h
gst/sdp/gstsdpelem.c
gst/sdp/gstsdpsrc.c
gst/sdp/gstsdpsrc.h
gst/segmentclip/gstaudiosegmentclip.c
gst/segmentclip/gstaudiosegmentclip.h
gst/segmentclip/gstvideosegmentclip.c
gst/segmentclip/gstvideosegmentclip.h
gst/segmentclip/plugin.c
gst/siren/gstsiren.c
gst/siren/gstsirendec.c
gst/siren/gstsirendec.h
gst/siren/gstsirenenc.c
gst/siren/gstsirenenc.h
gst/smooth/gstsmooth.c
gst/smooth/gstsmooth.h
gst/speed/gstspeed.c
gst/speed/gstspeed.h
gst/subenc/gstsrtenc.c
gst/subenc/gstsrtenc.h
gst/subenc/gstsubenc.c
gst/subenc/gstwebvttenc.c
gst/subenc/gstwebvttenc.h
gst/switchbin/gstswitchbin.c
gst/switchbin/gstswitchbin.h
gst/switchbin/plugin.c
gst/timecode/gstavwait.c
gst/timecode/gstavwait.h
gst/timecode/gsttimecodestamper.c
gst/timecode/gsttimecodestamper.h
gst/timecode/plugin.c
gst/transcode/gsttranscodebin.c
gst/transcode/gsttranscodeelement.c [new file with mode: 0644]
gst/transcode/gsttranscodeelements.h [new file with mode: 0644]
gst/transcode/gsttranscodeplugin.c [new file with mode: 0644]
gst/transcode/gsturitranscodebin.c
gst/transcode/meson.build
gst/videofilters/gstscenechange.c
gst/videofilters/gstscenechange.h
gst/videofilters/gstvideodiff.c
gst/videofilters/gstvideodiff.h
gst/videofilters/gstvideofiltersbad.c
gst/videofilters/gstzebrastripe.c
gst/videofilters/gstzebrastripe.h
gst/videoframe_audiolevel/gstvideoframe-audiolevel.c
gst/videoframe_audiolevel/gstvideoframe-audiolevel.h
gst/videoparsers/gstav1parse.c
gst/videoparsers/gstdiracparse.c
gst/videoparsers/gsth263parse.c
gst/videoparsers/gsth264parse.c
gst/videoparsers/gsth265parse.c
gst/videoparsers/gstjpeg2000parse.c
gst/videoparsers/gstmpeg4videoparse.c
gst/videoparsers/gstmpegvideoparse.c
gst/videoparsers/gstpngparse.c
gst/videoparsers/gstvc1parse.c
gst/videoparsers/gstvideoparserselement.c [new file with mode: 0644]
gst/videoparsers/gstvideoparserselements.h [new file with mode: 0644]
gst/videoparsers/gstvp9parse.c
gst/videoparsers/meson.build
gst/videoparsers/plugin.c
gst/videosignal/gstsimplevideomark.c
gst/videosignal/gstsimplevideomark.h
gst/videosignal/gstsimplevideomarkdetect.c
gst/videosignal/gstsimplevideomarkdetect.h
gst/videosignal/gstvideoanalyse.c
gst/videosignal/gstvideoanalyse.h
gst/videosignal/gstvideosignal.c
gst/vmnc/vmncdec.c
gst/vmnc/vmncdec.h
gst/y4m/gsty4mdec.c
gst/y4m/gsty4mdec.h

index e69c3f4..efc2995 100644 (file)
@@ -72,8 +72,6 @@ enum
   PROP_LAST_TRACK
 };
 
-#define parent_class gst_accurip_parent_class
-G_DEFINE_TYPE (GstAccurip, gst_accurip, GST_TYPE_AUDIO_FILTER);
 
 
 
@@ -86,6 +84,11 @@ static GstFlowReturn gst_accurip_transform_ip (GstBaseTransform * trans,
     GstBuffer * buf);
 static gboolean gst_accurip_sink_event (GstBaseTransform * trans,
     GstEvent * event);
+static gboolean accurip_element_init (GstPlugin * plugin);
+
+#define parent_class gst_accurip_parent_class
+G_DEFINE_TYPE (GstAccurip, gst_accurip, GST_TYPE_AUDIO_FILTER);
+GST_ELEMENT_REGISTER_DEFINE_CUSTOM (accurip, accurip_element_init);
 
 static void
 gst_accurip_class_init (GstAccuripClass * klass)
@@ -342,7 +345,7 @@ gst_accurip_get_property (GObject * object, guint prop_id,
 }
 
 static gboolean
-plugin_init (GstPlugin * plugin)
+accurip_element_init (GstPlugin * plugin)
 {
   gboolean ret;
 
@@ -362,6 +365,12 @@ plugin_init (GstPlugin * plugin)
   return ret;
 }
 
+static gboolean
+plugin_init (GstPlugin * plugin)
+{
+  return GST_ELEMENT_REGISTER (accurip, plugin);
+}
+
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
     GST_VERSION_MINOR,
     accurip,
index e9ecba5..88cc101 100644 (file)
@@ -80,6 +80,8 @@ struct _GstAccuripClass
 
 GType gst_accurip_get_type (void);
 
+GST_ELEMENT_REGISTER_DECLARE (accurip);
+
 G_END_DECLS
 
 #endif /* __GST_ACCURIP_H__ */
index 3cfa820..fb25ca5 100644 (file)
@@ -81,7 +81,12 @@ typedef struct _ADPCMDec
 } ADPCMDec;
 
 GType adpcmdec_get_type (void);
-G_DEFINE_TYPE (ADPCMDec, adpcmdec, GST_TYPE_AUDIO_DECODER);
+GST_ELEMENT_REGISTER_DECLARE (adpcmdec);
+G_DEFINE_TYPE_WITH_CODE (ADPCMDec, adpcmdec, GST_TYPE_AUDIO_DECODER,
+    GST_DEBUG_CATEGORY_INIT (adpcmdec_debug, "adpcmdec", 0, "ADPCM Decoders");
+    );
+GST_ELEMENT_REGISTER_DEFINE (adpcmdec, "adpcmdec", GST_RANK_PRIMARY,
+    GST_TYPE_ADPCM_DEC);
 
 static gboolean
 adpcmdec_set_format (GstAudioDecoder * bdec, GstCaps * in_caps)
@@ -485,12 +490,7 @@ adpcmdec_class_init (ADPCMDecClass * klass)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  GST_DEBUG_CATEGORY_INIT (adpcmdec_debug, "adpcmdec", 0, "ADPCM Decoders");
-  if (!gst_element_register (plugin, "adpcmdec", GST_RANK_PRIMARY,
-          GST_TYPE_ADPCM_DEC)) {
-    return FALSE;
-  }
-  return TRUE;
+  return GST_ELEMENT_REGISTER (adpcmdec, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, adpcmdec,
index 52962e4..027029c 100644 (file)
@@ -132,7 +132,12 @@ typedef struct _ADPCMEnc
 } ADPCMEnc;
 
 GType adpcmenc_get_type (void);
-G_DEFINE_TYPE (ADPCMEnc, adpcmenc, GST_TYPE_AUDIO_ENCODER);
+GST_ELEMENT_REGISTER_DECLARE (adpcmenc);
+G_DEFINE_TYPE_WITH_CODE (ADPCMEnc, adpcmenc, GST_TYPE_AUDIO_ENCODER,
+    GST_DEBUG_CATEGORY_INIT (adpcmenc_debug, "adpcmenc", 0, "ADPCM Encoders");
+    );
+GST_ELEMENT_REGISTER_DEFINE (adpcmenc, "adpcmenc", GST_RANK_PRIMARY,
+    GST_TYPE_ADPCM_ENC);
 
 static gboolean
 adpcmenc_setup (ADPCMEnc * enc)
@@ -470,12 +475,7 @@ adpcmenc_class_init (ADPCMEncClass * klass)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  GST_DEBUG_CATEGORY_INIT (adpcmenc_debug, "adpcmenc", 0, "ADPCM Encoders");
-  if (!gst_element_register (plugin, "adpcmenc", GST_RANK_PRIMARY,
-          GST_TYPE_ADPCM_ENC)) {
-    return FALSE;
-  }
-  return TRUE;
+  return GST_ELEMENT_REGISTER (adpcmenc, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, adpcmenc,
index 8c41203..5fabbd4 100644 (file)
 #include "config.h"
 #endif
 
-#include <gst/tag/tag.h>
+#include "aiffelements.h"
 
-#include <gst/gst-i18n-plugin.h>
-
-#include "aiffparse.h"
-#include "aiffmux.h"
-
-GST_DEBUG_CATEGORY_STATIC (aiff_debug);
-#define GST_CAT_DEFAULT (aiff_debug)
-
-GST_DEBUG_CATEGORY_EXTERN (aiffparse_debug);
-GST_DEBUG_CATEGORY_EXTERN (aiffmux_debug);
 
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gboolean ret;
-
-  GST_DEBUG_CATEGORY_INIT (aiff_debug, "aiff", 0, "AIFF plugin");
-  GST_DEBUG_CATEGORY_INIT (aiffparse_debug, "aiffparse", 0, "AIFF parser");
-  GST_DEBUG_CATEGORY_INIT (aiffmux_debug, "aiffmux", 0, "AIFF muxer");
-
-#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
-
-  ret = gst_element_register (plugin, "aiffparse", GST_RANK_PRIMARY,
-      GST_TYPE_AIFF_PARSE);
-  ret &= gst_element_register (plugin, "aiffmux", GST_RANK_PRIMARY,
-      GST_TYPE_AIFF_MUX);
+  gboolean ret = FALSE;
 
-  gst_tag_register_musicbrainz_tags ();
+  ret |= GST_ELEMENT_REGISTER (aiffparse, plugin);
+  ret |= GST_ELEMENT_REGISTER (aiffmux, plugin);
 
   return ret;
 }
diff --git a/gst/aiff/aiffelements.h b/gst/aiff/aiffelements.h
new file mode 100644 (file)
index 0000000..69b4b51
--- /dev/null
@@ -0,0 +1,35 @@
+/* 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_AIFF_ELEMENTS_H__
+#define __GST_AIFF_ELEMENTS_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gst/gst.h>
+
+G_GNUC_INTERNAL void aiff_element_init (GstPlugin * plugin);
+
+GST_ELEMENT_REGISTER_DECLARE (aiffmux);
+GST_ELEMENT_REGISTER_DECLARE (aiffparse);
+
+#endif /* __GST_AIFF_ELEMENTS_H__ */
index 96cac95..04cec5b 100644 (file)
@@ -57,6 +57,7 @@
 #include <gst/gst.h>
 #include <gst/base/gstbytewriter.h>
 
+#include "aiffelements.h"
 #include "aiffmux.h"
 
 GST_DEBUG_CATEGORY (aiffmux_debug);
@@ -77,7 +78,10 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
     );
 
 #define gst_aiff_mux_parent_class parent_class
-G_DEFINE_TYPE (GstAiffMux, gst_aiff_mux, GST_TYPE_ELEMENT);
+G_DEFINE_TYPE_WITH_CODE (GstAiffMux, gst_aiff_mux, GST_TYPE_ELEMENT,
+    GST_DEBUG_CATEGORY_INIT (aiffmux_debug, "aiffmux", 0, "AIFF muxer"));
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (aiffmux, "aiffmux", GST_RANK_PRIMARY,
+    GST_TYPE_AIFF_MUX, aiff_element_init (plugin));
 
 static GstStateChangeReturn
 gst_aiff_mux_change_state (GstElement * element, GstStateChange transition)
index db85a97..e155431 100644 (file)
@@ -52,6 +52,7 @@
 #include <string.h>
 #include <math.h>
 
+#include "aiffelements.h"
 #include "aiffparse.h"
 #include <gst/audio/audio.h>
 #include <gst/tag/tag.h>
@@ -104,7 +105,10 @@ GST_STATIC_PAD_TEMPLATE ("src",
 #define MAX_BUFFER_SIZE 4096
 
 #define gst_aiff_parse_parent_class parent_class
-G_DEFINE_TYPE (GstAiffParse, gst_aiff_parse, GST_TYPE_ELEMENT);
+G_DEFINE_TYPE_WITH_CODE (GstAiffParse, gst_aiff_parse, GST_TYPE_ELEMENT,
+    GST_DEBUG_CATEGORY_INIT (aiffparse_debug, "aiffparse", 0, "AIFF parser"));
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (aiffparse, "aiffparse", GST_RANK_PRIMARY,
+    GST_TYPE_AIFF_PARSE, aiff_element_init (plugin));
 
 static void
 gst_aiff_parse_class_init (GstAiffParseClass * klass)
diff --git a/gst/aiff/gstaiffelement.c b/gst/aiff/gstaiffelement.c
new file mode 100644 (file)
index 0000000..3d2f91b
--- /dev/null
@@ -0,0 +1,50 @@
+/* -*- Mode: C; tab-width: 2; indent-tabs-mode: t; c-basic-offset: 2 -*- */
+/* GStreamer AIFF plugin initialisation
+ * Copyright (C) <2008> Pioneers of the Inevitable <songbird@songbirdnest.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/tag/tag.h>
+
+#include <gst/gst-i18n-plugin.h>
+
+#include "aiffelements.h"
+
+
+GST_DEBUG_CATEGORY_STATIC (aiff_debug);
+#define GST_CAT_DEFAULT (aiff_debug)
+
+void
+aiff_element_init (GstPlugin * plugin)
+{
+  static gsize res = FALSE;
+  if (g_once_init_enter (&res)) {
+    GST_DEBUG_CATEGORY_INIT (aiff_debug, "aiff", 0, "AIFF 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
+    gst_tag_register_musicbrainz_tags ();
+    g_once_init_leave (&res, TRUE);
+  }
+}
index a2221b4..cc5ebd3 100644 (file)
@@ -1,5 +1,5 @@
 aiff_sources = [
-  'aiff.c', 'aiffmux.c', 'aiffparse.c',
+  'aiff.c', 'aiffmux.c', 'aiffparse.c', 'gstaiffelement.c'
 ]
 
 gstaiff = library('gstaiff',
index 1a00fb4..eb81165 100644 (file)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  if (!gst_asf_mux_plugin_init (plugin)) {
-    return FALSE;
-  }
-  if (!gst_rtp_asf_pay_plugin_init (plugin)) {
-    return FALSE;
-  }
-  if (!gst_asf_parse_plugin_init (plugin)) {
-    return FALSE;
-  }
-  return TRUE;
+  gboolean ret = FALSE;
+
+  ret |= GST_ELEMENT_REGISTER (asfmux, plugin);
+  ret |= GST_ELEMENT_REGISTER (rtpasfpay, plugin);
+  ret |= GST_ELEMENT_REGISTER (asfparse, plugin);
+
+  return ret;
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 1e79c39..0ab4660 100644 (file)
@@ -173,6 +173,8 @@ static GstElementClass *parent_class = NULL;
 
 G_DEFINE_TYPE_WITH_CODE (GstAsfMux, gst_asf_mux, GST_TYPE_ELEMENT,
     G_IMPLEMENT_INTERFACE (GST_TYPE_TAG_SETTER, NULL));
+GST_ELEMENT_REGISTER_DEFINE (asfmux, "asfmux",
+    GST_RANK_PRIMARY, GST_TYPE_ASF_MUX);
 
 static void
 gst_asf_mux_reset (GstAsfMux * asfmux)
@@ -2455,10 +2457,3 @@ gst_asf_mux_change_state (GstElement * element, GstStateChange transition)
 done:
   return ret;
 }
-
-gboolean
-gst_asf_mux_plugin_init (GstPlugin * plugin)
-{
-  return gst_element_register (plugin, "asfmux",
-      GST_RANK_PRIMARY, GST_TYPE_ASF_MUX);
-}
index f5ebb07..7418284 100644 (file)
@@ -152,7 +152,7 @@ struct _GstAsfMuxClass
 };
 
 GType gst_asf_mux_get_type (void);
-gboolean gst_asf_mux_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (asfmux);
 
 G_END_DECLS
 #endif /* __GST_ASF_MUX_H__ */
index 6cc75b6..5859c7f 100644 (file)
@@ -44,6 +44,8 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
 
 #define gst_asf_parse_parent_class parent_class
 G_DEFINE_TYPE (GstAsfParse, gst_asf_parse, GST_TYPE_BASE_PARSE);
+GST_ELEMENT_REGISTER_DEFINE (asfparse, "asfparse",
+    GST_RANK_NONE, GST_TYPE_ASF_PARSE);
 
 static gboolean
 gst_asf_parse_start (GstBaseParse * parse)
@@ -416,10 +418,3 @@ gst_asf_parse_init (GstAsfParse * asfparse)
   asfparse->asfinfo = gst_asf_file_info_new ();
   asfparse->packetinfo = g_new0 (GstAsfPacketInfo, 1);
 }
-
-gboolean
-gst_asf_parse_plugin_init (GstPlugin * plugin)
-{
-  return gst_element_register (plugin, "asfparse",
-      GST_RANK_NONE, GST_TYPE_ASF_PARSE);
-}
index f01dd26..3bd91e8 100644 (file)
@@ -71,7 +71,7 @@ struct _GstAsfParseClass {
 };
 
 GType gst_asf_parse_get_type(void);
-gboolean gst_asf_parse_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (asfparse);
 
 G_END_DECLS
 
index 9b1e032..ad0b206 100644 (file)
@@ -57,6 +57,8 @@ gst_rtp_asf_pay_set_caps (GstRTPBasePayload * rtppay, GstCaps * caps);
 
 #define gst_rtp_asf_pay_parent_class parent_class
 G_DEFINE_TYPE (GstRtpAsfPay, gst_rtp_asf_pay, GST_TYPE_RTP_BASE_PAYLOAD);
+GST_ELEMENT_REGISTER_DEFINE (rtpasfpay, "rtpasfpay",
+    GST_RANK_NONE, GST_TYPE_RTP_ASF_PAY);
 
 static void
 gst_rtp_asf_pay_init (GstRtpAsfPay * rtpasfpay)
@@ -460,10 +462,3 @@ gst_rtp_asf_pay_handle_buffer (GstRTPBasePayload * rtppay, GstBuffer * buffer)
   gst_buffer_unref (buffer);
   return GST_FLOW_OK;
 }
-
-gboolean
-gst_rtp_asf_pay_plugin_init (GstPlugin * plugin)
-{
-  return gst_element_register (plugin, "rtpasfpay",
-      GST_RANK_NONE, GST_TYPE_RTP_ASF_PAY);
-}
index da990c2..bd2e9e9 100644 (file)
@@ -81,7 +81,8 @@ struct _GstRtpAsfPayClass
 };
 
 GType gst_rtp_asf_pay_get_type (void);
-gboolean gst_rtp_asf_pay_plugin_init (GstPlugin * plugin);
+
+GST_ELEMENT_REGISTER_DECLARE (rtpasfpay);
 
 G_END_DECLS
 #endif /* __GST_RTP_ASF_PAY_H__ */
index 911c598..e1ea507 100644 (file)
@@ -63,7 +63,11 @@ enum
 #define DEFAULT_MAX_SILENCE_TIME (0)
 
 #define parent_class gst_audio_buffer_split_parent_class
-G_DEFINE_TYPE (GstAudioBufferSplit, gst_audio_buffer_split, GST_TYPE_ELEMENT);
+G_DEFINE_TYPE_WITH_CODE (GstAudioBufferSplit, gst_audio_buffer_split,
+    GST_TYPE_ELEMENT, GST_DEBUG_CATEGORY_INIT (gst_audio_buffer_split_debug,
+        "audiobuffersplit", 0, "Audio buffer splitter"););
+GST_ELEMENT_REGISTER_DEFINE (audiobuffersplit, "audiobuffersplit",
+    GST_RANK_NONE, GST_TYPE_AUDIO_BUFFER_SPLIT);
 
 static GstFlowReturn gst_audio_buffer_split_sink_chain (GstPad * pad,
     GstObject * parent, GstBuffer * buffer);
@@ -923,13 +927,7 @@ gst_audio_buffer_split_src_query (GstPad * pad,
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  GST_DEBUG_CATEGORY_INIT (gst_audio_buffer_split_debug, "audiobuffersplit",
-      0, "Audio buffer splitter");
-
-  gst_element_register (plugin, "audiobuffersplit", GST_RANK_NONE,
-      GST_TYPE_AUDIO_BUFFER_SPLIT);
-
-  return TRUE;
+  return GST_ELEMENT_REGISTER (audiobuffersplit, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 31fda86..021f6b2 100644 (file)
@@ -74,6 +74,7 @@ struct _GstAudioBufferSplitClass {
 };
 
 GType gst_audio_buffer_split_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (audiobuffersplit);
 
 G_END_DECLS
 
index c65a5c4..49190d4 100644 (file)
@@ -91,6 +91,8 @@ G_DEFINE_TYPE_WITH_CODE (GstAudioChannelMix, gst_audio_channel_mix,
     GST_TYPE_AUDIO_FILTER,
     GST_DEBUG_CATEGORY_INIT (gst_audio_channel_mix_debug_category,
         "audiochannelmix", 0, "debug category for audiochannelmix element"));
+GST_ELEMENT_REGISTER_DEFINE (audiochannelmix, "audiochannelmix", GST_RANK_NONE,
+    GST_TYPE_AUDIO_CHANNEL_MIX);
 
 static void
 gst_audio_channel_mix_class_init (GstAudioChannelMixClass * klass)
index cc2faba..dc8b08c 100644 (file)
@@ -50,6 +50,8 @@ struct _GstAudioChannelMixClass
 
 GType gst_audio_channel_mix_get_type (void);
 
+GST_ELEMENT_REGISTER_DECLARE (audiochannelmix);
+
 G_END_DECLS
 
 #endif
index c0d900f..29141e0 100644 (file)
@@ -26,8 +26,7 @@
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  return gst_element_register (plugin, "audiochannelmix", GST_RANK_NONE,
-      GST_TYPE_AUDIO_CHANNEL_MIX);
+  return GST_ELEMENT_REGISTER (audiochannelmix, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 7e6ec42..4ae5bfa 100644 (file)
@@ -79,7 +79,11 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
     );
 
 #define gst_audiolatency_parent_class parent_class
-G_DEFINE_TYPE (GstAudioLatency, gst_audiolatency, GST_TYPE_BIN);
+G_DEFINE_TYPE_WITH_CODE (GstAudioLatency, gst_audiolatency, GST_TYPE_BIN,
+    GST_DEBUG_CATEGORY_INIT (gst_audiolatency_debug, "audiolatency", 0,
+        "audiolatency"););
+GST_ELEMENT_REGISTER_DEFINE (audiolatency, "audiolatency", GST_RANK_PRIMARY,
+    GST_TYPE_AUDIOLATENCY);
 
 #define DEFAULT_PRINT_LATENCY   FALSE
 enum
@@ -422,11 +426,7 @@ out:
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  GST_DEBUG_CATEGORY_INIT (gst_audiolatency_debug, "audiolatency", 0,
-      "audiolatency");
-
-  return gst_element_register (plugin, "audiolatency", GST_RANK_PRIMARY,
-      GST_TYPE_AUDIOLATENCY);
+  return GST_ELEMENT_REGISTER (audiolatency, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 22cc427..414b833 100644 (file)
@@ -65,5 +65,7 @@ struct _GstAudioLatencyClass
 
 GType gst_audiolatency_get_type (void);
 
+GST_ELEMENT_REGISTER_DECLARE (audiolatency);
+
 G_END_DECLS
 #endif /* __GST_AUDIOLATENCY_H__ */
index 77b5c92..0d1c9b3 100644 (file)
@@ -150,6 +150,8 @@ static GstStateChangeReturn gst_audio_mix_matrix_change_state (GstElement *
 
 G_DEFINE_TYPE (GstAudioMixMatrix, gst_audio_mix_matrix,
     GST_TYPE_BASE_TRANSFORM);
+GST_ELEMENT_REGISTER_DEFINE (audiomixmatrix, "audiomixmatrix", GST_RANK_NONE,
+    GST_TYPE_AUDIO_MIX_MATRIX);
 
 static void
 gst_audio_mix_matrix_class_init (GstAudioMixMatrixClass * klass)
@@ -743,8 +745,7 @@ beach:
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  return gst_element_register (plugin, "audiomixmatrix", GST_RANK_NONE,
-      GST_TYPE_AUDIO_MIX_MATRIX);
+  return GST_ELEMENT_REGISTER (audiomixmatrix, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 5321954..dcd3456 100644 (file)
@@ -72,6 +72,8 @@ struct _GstAudioMixMatrixClass
 
 GType gst_audio_mix_matrix_get_type (void);
 
+GST_ELEMENT_REGISTER_DECLARE (audiomixmatrix);
+
 GType gst_audio_mix_matrix_mode_get_type (void);
 
 G_END_DECLS
index b14f7fc..1cc4b22 100644 (file)
@@ -120,7 +120,11 @@ static gboolean gst_space_scope_render (GstAudioVisualizer * scope,
     GstBuffer * audio, GstVideoFrame * video);
 
 
-G_DEFINE_TYPE (GstSpaceScope, gst_space_scope, GST_TYPE_AUDIO_VISUALIZER);
+G_DEFINE_TYPE_WITH_CODE (GstSpaceScope, gst_space_scope,
+    GST_TYPE_AUDIO_VISUALIZER, GST_DEBUG_CATEGORY_INIT (space_scope_debug,
+        "spacescope", 0, "spacescope"););
+GST_ELEMENT_REGISTER_DEFINE (spacescope, "spacescope", GST_RANK_NONE,
+    GST_TYPE_SPACE_SCOPE);
 
 static void
 gst_space_scope_class_init (GstSpaceScopeClass * g_class)
@@ -445,12 +449,3 @@ gst_space_scope_render (GstAudioVisualizer * base, GstBuffer * audio,
   gst_buffer_unmap (audio, &amap);
   return TRUE;
 }
-
-gboolean
-gst_space_scope_plugin_init (GstPlugin * plugin)
-{
-  GST_DEBUG_CATEGORY_INIT (space_scope_debug, "spacescope", 0, "spacescope");
-
-  return gst_element_register (plugin, "spacescope", GST_RANK_NONE,
-      GST_TYPE_SPACE_SCOPE);
-}
index 10659fe..76e59ad 100644 (file)
@@ -56,7 +56,8 @@ struct _GstSpaceScopeClass
 };
 
 GType gst_space_scope_get_type (void);
-gboolean gst_space_scope_plugin_init (GstPlugin * plugin);
+
+GST_ELEMENT_REGISTER_DECLARE (spacescope);
 
 G_END_DECLS
 #endif /* __GST_SPACE_SCOPE_H__ */
index 5ba73ba..06077f1 100644 (file)
@@ -75,7 +75,11 @@ static gboolean gst_spectra_scope_render (GstAudioVisualizer * scope,
     GstBuffer * audio, GstVideoFrame * video);
 
 
-G_DEFINE_TYPE (GstSpectraScope, gst_spectra_scope, GST_TYPE_AUDIO_VISUALIZER);
+G_DEFINE_TYPE_WITH_CODE (GstSpectraScope, gst_spectra_scope,
+    GST_TYPE_AUDIO_VISUALIZER, GST_DEBUG_CATEGORY_INIT (spectra_scope_debug,
+        "spectrascope", 0, "spectrascope"););
+GST_ELEMENT_REGISTER_DEFINE (spectrascope, "spectrascope", GST_RANK_NONE,
+    GST_TYPE_SPECTRA_SCOPE);
 
 static void
 gst_spectra_scope_class_init (GstSpectraScopeClass * g_class)
@@ -228,13 +232,3 @@ gst_spectra_scope_render (GstAudioVisualizer * bscope, GstBuffer * audio,
   gst_buffer_unmap (audio, &amap);
   return TRUE;
 }
-
-gboolean
-gst_spectra_scope_plugin_init (GstPlugin * plugin)
-{
-  GST_DEBUG_CATEGORY_INIT (spectra_scope_debug, "spectrascope", 0,
-      "spectrascope");
-
-  return gst_element_register (plugin, "spectrascope", GST_RANK_NONE,
-      GST_TYPE_SPECTRA_SCOPE);
-}
index d063734..d316652 100644 (file)
@@ -48,7 +48,8 @@ struct _GstSpectraScopeClass
 };
 
 GType gst_spectra_scope_get_type (void);
-gboolean gst_spectra_scope_plugin_init (GstPlugin * plugin);
+
+GST_ELEMENT_REGISTER_DECLARE (spectrascope);
 
 G_END_DECLS
 #endif /* __GST_SPECTRA_SCOPE_H__ */
index 1e2be05..bd92d58 100644 (file)
@@ -73,7 +73,11 @@ static gboolean gst_synae_scope_render (GstAudioVisualizer * scope,
     GstBuffer * audio, GstVideoFrame * video);
 
 
-G_DEFINE_TYPE (GstSynaeScope, gst_synae_scope, GST_TYPE_AUDIO_VISUALIZER);
+G_DEFINE_TYPE_WITH_CODE (GstSynaeScope, gst_synae_scope,
+    GST_TYPE_AUDIO_VISUALIZER, GST_DEBUG_CATEGORY_INIT (synae_scope_debug,
+        "synaescope", 0, "synaescope"););
+GST_ELEMENT_REGISTER_DEFINE (synaescope, "synaescope", GST_RANK_NONE,
+    GST_TYPE_SYNAE_SCOPE);
 
 static void
 gst_synae_scope_class_init (GstSynaeScopeClass * g_class)
@@ -309,12 +313,3 @@ gst_synae_scope_render (GstAudioVisualizer * bscope, GstBuffer * audio,
 
   return TRUE;
 }
-
-gboolean
-gst_synae_scope_plugin_init (GstPlugin * plugin)
-{
-  GST_DEBUG_CATEGORY_INIT (synae_scope_debug, "synaescope", 0, "synaescope");
-
-  return gst_element_register (plugin, "synaescope", GST_RANK_NONE,
-      GST_TYPE_SYNAE_SCOPE);
-}
index f6ec264..fa3ba06 100644 (file)
@@ -52,7 +52,8 @@ struct _GstSynaeScopeClass
 };
 
 GType gst_synae_scope_get_type (void);
-gboolean gst_synae_scope_plugin_init (GstPlugin * plugin);
+
+GST_ELEMENT_REGISTER_DECLARE (synaescope);
 
 G_END_DECLS
 #endif /* __GST_SYNAE_SCOPE_H__ */
index f584b69..91a935b 100644 (file)
@@ -122,7 +122,11 @@ static gboolean gst_wave_scope_render (GstAudioVisualizer * base,
     GstBuffer * audio, GstVideoFrame * video);
 
 #define gst_wave_scope_parent_class parent_class
-G_DEFINE_TYPE (GstWaveScope, gst_wave_scope, GST_TYPE_AUDIO_VISUALIZER);
+G_DEFINE_TYPE_WITH_CODE (GstWaveScope, gst_wave_scope,
+    GST_TYPE_AUDIO_VISUALIZER, GST_DEBUG_CATEGORY_INIT (wave_scope_debug,
+        "wavescope", 0, "wavescope"););
+GST_ELEMENT_REGISTER_DEFINE (wavescope, "wavescope", GST_RANK_NONE,
+    GST_TYPE_WAVE_SCOPE);
 
 static void
 gst_wave_scope_class_init (GstWaveScopeClass * g_class)
@@ -422,12 +426,3 @@ gst_wave_scope_render (GstAudioVisualizer * base, GstBuffer * audio,
 
   return TRUE;
 }
-
-gboolean
-gst_wave_scope_plugin_init (GstPlugin * plugin)
-{
-  GST_DEBUG_CATEGORY_INIT (wave_scope_debug, "wavescope", 0, "wavescope");
-
-  return gst_element_register (plugin, "wavescope", GST_RANK_NONE,
-      GST_TYPE_WAVE_SCOPE);
-}
index f367f88..d3b112f 100644 (file)
@@ -53,7 +53,8 @@ struct _GstWaveScopeClass
 };
 
 GType gst_wave_scope_get_type (void);
-gboolean gst_wave_scope_plugin_init (GstPlugin * plugin);
+
+GST_ELEMENT_REGISTER_DECLARE (wavescope);
 
 G_END_DECLS
 #endif /* __GST_WAVE_SCOPE_H__ */
index b93f491..1bee912 100644 (file)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gboolean res = TRUE;
+  gboolean ret = FALSE;
 
-  res &= gst_space_scope_plugin_init (plugin);
-  res &= gst_spectra_scope_plugin_init (plugin);
-  res &= gst_synae_scope_plugin_init (plugin);
-  res &= gst_wave_scope_plugin_init (plugin);
-  return res;
+  ret |= GST_ELEMENT_REGISTER (spacescope, plugin);
+  ret |= GST_ELEMENT_REGISTER (spectrascope, plugin);
+  ret |= GST_ELEMENT_REGISTER (synaescope, plugin);
+  ret |= GST_ELEMENT_REGISTER (wavescope, plugin);
+
+  return ret;
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 2c2433e..08ad54a 100644 (file)
@@ -145,6 +145,8 @@ static GQuark internal_sinkpad_quark = 0;
 static GQuark parent_quark = 0;
 
 G_DEFINE_TYPE (GstAutoConvert, gst_auto_convert, GST_TYPE_BIN);
+GST_ELEMENT_REGISTER_DEFINE (autoconvert, "autoconvert",
+    GST_RANK_NONE, GST_TYPE_AUTO_CONVERT);
 
 static void
 gst_auto_convert_class_init (GstAutoConvertClass * klass)
index eaa4f02..310dfb0 100644 (file)
@@ -61,6 +61,7 @@ struct _GstAutoConvertClass
 };
 
 GType gst_auto_convert_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (autoconvert);
 
 G_END_DECLS
 #endif /* __GST_AUTO_CONVERT_H__ */
index 5992c78..7481e7d 100644 (file)
@@ -131,6 +131,8 @@ gst_auto_video_convert_update_factory_list (GstAutoVideoConvert *
 }
 
 G_DEFINE_TYPE (GstAutoVideoConvert, gst_auto_video_convert, GST_TYPE_BIN);
+GST_ELEMENT_REGISTER_DEFINE (autovideoconvert, "autovideoconvert",
+    GST_RANK_NONE, GST_TYPE_AUTO_VIDEO_CONVERT);
 
 static void
 gst_auto_video_convert_class_init (GstAutoVideoConvertClass * klass)
index b3fe894..8138993 100644 (file)
@@ -50,6 +50,7 @@ struct _GstAutoVideoConvertClass
 };
 
 GType gst_auto_video_convert_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (autovideoconvert);
 
 G_END_DECLS
 #endif /* __GST_AUTO_VIDEO_CONVERT_H__ */
index 03c05ab..fd6d39c 100644 (file)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gboolean ret;
+  gboolean ret = FALSE;
 
-  ret = gst_element_register (plugin, "autoconvert",
-      GST_RANK_NONE, GST_TYPE_AUTO_CONVERT);
-
-  ret &= gst_element_register (plugin, "autovideoconvert",
-      GST_RANK_NONE, GST_TYPE_AUTO_VIDEO_CONVERT);
+  ret |= GST_ELEMENT_REGISTER (autoconvert, plugin);
+  ret |= GST_ELEMENT_REGISTER (autovideoconvert, plugin);
 
   return ret;
 }
index 70f54d1..c8042a9 100644 (file)
 
 #include <gst/gst.h>
 
-
-GType gst_bayer2rgb_get_type (void);
-GType gst_rgb2bayer_get_type (void);
+#include "gstbayerelements.h"
 
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gst_element_register (plugin, "bayer2rgb", GST_RANK_NONE,
-      gst_bayer2rgb_get_type ());
-  gst_element_register (plugin, "rgb2bayer", GST_RANK_NONE,
-      gst_rgb2bayer_get_type ());
+  gboolean ret = FALSE;
+
+  ret |= GST_ELEMENT_REGISTER (bayer2rgb, plugin);
+  ret |= GST_ELEMENT_REGISTER (rgb2bayer, plugin);
 
-  return TRUE;
+  return ret;
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index e13a5cc..109bab2 100644 (file)
@@ -86,6 +86,7 @@
 #include <stdint.h>
 #endif
 
+#include "gstbayerelements.h"
 #include "gstbayerorc.h"
 
 #define GST_CAT_DEFAULT gst_bayer2rgb_debug
@@ -145,6 +146,8 @@ GType gst_bayer2rgb_get_type (void);
 
 #define gst_bayer2rgb_parent_class parent_class
 G_DEFINE_TYPE (GstBayer2RGB, gst_bayer2rgb, GST_TYPE_BASE_TRANSFORM);
+GST_ELEMENT_REGISTER_DEFINE (bayer2rgb, "bayer2rgb", GST_RANK_NONE,
+    gst_bayer2rgb_get_type ());
 
 static void gst_bayer2rgb_set_property (GObject * object, guint prop_id,
     const GValue * value, GParamSpec * pspec);
diff --git a/gst/bayer/gstbayerelements.h b/gst/bayer/gstbayerelements.h
new file mode 100644 (file)
index 0000000..cba9568
--- /dev/null
@@ -0,0 +1,33 @@
+/* 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_BAYER_ELEMENT_H__
+#define __GST_BAYER_ELEMENT_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gst/gst.h>
+
+GST_ELEMENT_REGISTER_DECLARE (bayer2rgb);
+GST_ELEMENT_REGISTER_DECLARE (rgb2bayer);
+
+#endif /* __GST_BAYER_ELEMENT_H__ */
index 787fe99..8adeb77 100644 (file)
@@ -25,6 +25,7 @@
 #include <gst/gst.h>
 #include <gst/base/gstbasetransform.h>
 #include <gst/video/video.h>
+#include "gstbayerelements.h"
 #include "gstrgb2bayer.h"
 
 #define GST_CAT_DEFAULT gst_rgb2bayer_debug
@@ -76,6 +77,8 @@ GST_STATIC_PAD_TEMPLATE ("src",
 
 #define gst_rgb2bayer_parent_class parent_class
 G_DEFINE_TYPE (GstRGB2Bayer, gst_rgb2bayer, GST_TYPE_BASE_TRANSFORM);
+GST_ELEMENT_REGISTER_DEFINE (rgb2bayer, "rgb2bayer", GST_RANK_NONE,
+    gst_rgb2bayer_get_type ());
 
 static void
 gst_rgb2bayer_class_init (GstRGB2BayerClass * klass)
index 502ed73..6ac5ce4 100644 (file)
@@ -311,6 +311,11 @@ gst_camera_bin2_get_type (void)
   return gst_camera_bin_type;
 }
 
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (camerabin, "camerabin", GST_RANK_NONE,
+    gst_camera_bin2_get_type (), GST_DEBUG_CATEGORY_INIT (gst_camera_bin_debug,
+        "camerabin", 0, "CameraBin");
+    );
+
 /* GObject class functions */
 static void gst_camera_bin_set_property (GObject * object, guint prop_id,
     const GValue * value, GParamSpec * pspec);
@@ -2390,12 +2395,3 @@ gst_camera_bin_get_property (GObject * object, guint prop_id,
       break;
   }
 }
-
-gboolean
-gst_camera_bin2_plugin_init (GstPlugin * plugin)
-{
-  GST_DEBUG_CATEGORY_INIT (gst_camera_bin_debug, "camerabin", 0, "CameraBin");
-
-  return gst_element_register (plugin, "camerabin", GST_RANK_NONE,
-      gst_camera_bin2_get_type ());
-}
index ba55a7e..f478daa 100644 (file)
@@ -161,7 +161,7 @@ struct _GstCameraBin2Class
 };
 
 GType gst_camera_bin2_get_type (void);
-gboolean gst_camera_bin2_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (camerabin);
 
 G_END_DECLS
 
index 320bb2c..bc0c816 100644 (file)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  if (!gst_viewfinder_bin_plugin_init (plugin))
-    return FALSE;
-  if (!gst_wrapper_camera_bin_src_plugin_init (plugin))
-    return FALSE;
-  if (!gst_camera_bin2_plugin_init (plugin))
-    return FALSE;
+  gboolean ret = FALSE;
 
-  return TRUE;
+  ret |= GST_ELEMENT_REGISTER (viewfinderbin, plugin);
+  ret |= GST_ELEMENT_REGISTER (wrappercamerabinsrc, plugin);
+  ret |= GST_ELEMENT_REGISTER (camerabin, plugin);
+
+  return ret;
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 3a96e89..1c37cef 100644 (file)
@@ -63,6 +63,11 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
 /* class initialization */
 #define gst_viewfinder_bin_parent_class parent_class
 G_DEFINE_TYPE (GstViewfinderBin, gst_viewfinder_bin, GST_TYPE_BIN);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (viewfinderbin, "viewfinderbin",
+    GST_RANK_NONE, gst_viewfinder_bin_get_type (),
+    GST_DEBUG_CATEGORY_INIT (gst_viewfinder_bin_debug, "viewfinderbin", 0,
+        "ViewFinderBin");
+    );
 
 static void gst_viewfinder_bin_set_property (GObject * object, guint prop_id,
     const GValue * value, GParamSpec * spec);
@@ -358,12 +363,3 @@ gst_viewfinder_bin_get_property (GObject * object, guint prop_id,
       break;
   }
 }
-
-gboolean
-gst_viewfinder_bin_plugin_init (GstPlugin * plugin)
-{
-  GST_DEBUG_CATEGORY_INIT (gst_viewfinder_bin_debug, "viewfinderbin", 0,
-      "ViewFinderBin");
-  return gst_element_register (plugin, "viewfinderbin", GST_RANK_NONE,
-      gst_viewfinder_bin_get_type ());
-}
index 3479120..28845db 100644 (file)
@@ -53,7 +53,7 @@ struct _GstViewfinderBinClass
 };
 
 GType gst_viewfinder_bin_get_type (void);
-gboolean gst_viewfinder_bin_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (viewfinderbin);
 
 G_END_DECLS
 
index 6fd1129..491007e 100644 (file)
@@ -52,6 +52,8 @@ GST_DEBUG_CATEGORY (wrapper_camera_bin_src_debug);
 #define gst_wrapper_camera_bin_src_parent_class parent_class
 G_DEFINE_TYPE (GstWrapperCameraBinSrc, gst_wrapper_camera_bin_src,
     GST_TYPE_BASE_CAMERA_SRC);
+GST_ELEMENT_REGISTER_DEFINE (wrappercamerabinsrc, "wrappercamerabinsrc",
+    GST_RANK_NONE, gst_wrapper_camera_bin_src_get_type ());
 
 static GstStaticPadTemplate vfsrc_template =
 GST_STATIC_PAD_TEMPLATE (GST_BASE_CAMERA_SRC_VIEWFINDER_PAD_NAME,
@@ -1169,10 +1171,3 @@ gst_wrapper_camera_bin_src_init (GstWrapperCameraBinSrc * self)
   self->mode = GST_BASE_CAMERA_SRC_CAST (self)->mode;
   self->app_vid_filter = NULL;
 }
-
-gboolean
-gst_wrapper_camera_bin_src_plugin_init (GstPlugin * plugin)
-{
-  return gst_element_register (plugin, "wrappercamerabinsrc", GST_RANK_NONE,
-      gst_wrapper_camera_bin_src_get_type ());
-}
index 90ab0cc..66a6723 100644 (file)
@@ -124,7 +124,7 @@ struct _GstWrapperCameraBinSrcClass
   GstBaseCameraSrcClass parent;
 };
 
-gboolean gst_wrapper_camera_bin_src_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (wrappercamerabinsrc);
 
 G_END_DECLS
 
index 1ddb4c0..06b0001 100644 (file)
@@ -111,6 +111,8 @@ static void gst_chroma_hold_finalize (GObject * object);
 
 #define gst_chroma_hold_parent_class parent_class
 G_DEFINE_TYPE (GstChromaHold, gst_chroma_hold, GST_TYPE_VIDEO_FILTER);
+GST_ELEMENT_REGISTER_DEFINE (chromahold, "chromahold",
+    GST_RANK_NONE, gst_chroma_hold_get_type ());
 
 static void
 gst_chroma_hold_class_init (GstChromaHoldClass * klass)
index ebe74a2..4cfea3d 100644 (file)
@@ -74,6 +74,7 @@ struct _GstChromaHoldClass
 };
 
 GType gst_chroma_hold_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (chromahold);
 
 G_END_DECLS
 #endif /* __GST_CHROMA_HOLD_H__ */
index ecbc3fc..68bbb5c 100644 (file)
@@ -51,6 +51,8 @@ enum
 
 #define gst_color_effects_parent_class parent_class
 G_DEFINE_TYPE (GstColorEffects, gst_color_effects, GST_TYPE_VIDEO_FILTER);
+GST_ELEMENT_REGISTER_DEFINE (coloreffects, "coloreffects",
+    GST_RANK_NONE, gst_color_effects_get_type ());
 
 #define CAPS_STR GST_VIDEO_CAPS_MAKE ("{ " \
     "ARGB, BGRA, ABGR, RGBA, xRGB, BGRx, xBGR, RGBx, RGB, BGR, AYUV }")
index 50c9aa0..c35f786 100644 (file)
@@ -87,6 +87,7 @@ struct _GstColorEffectsClass
 };
 
 GType gst_color_effects_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (coloreffects);
 
 G_END_DECLS
 #endif /* __GST_COLOR_EFFECTS_H__ */
index fdd4b55..071d0c5 100644 (file)
 #include "gstcoloreffects.h"
 #include "gstchromahold.h"
 
-struct _elements_entry
-{
-  const gchar *name;
-    GType (*type) (void);
-};
-
-static const struct _elements_entry _elements[] = {
-  {"coloreffects", gst_color_effects_get_type},
-  {"chromahold", gst_chroma_hold_get_type},
-  {NULL, 0},
-};
 
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gint i = 0;
+  gboolean ret = FALSE;
 
-  while (_elements[i].name) {
-    if (!gst_element_register (plugin, _elements[i].name,
-            GST_RANK_NONE, (_elements[i].type) ()))
-      return FALSE;
-    i++;
-  }
+  ret |= GST_ELEMENT_REGISTER (coloreffects, plugin);
+  ret |= GST_ELEMENT_REGISTER (chromahold, plugin);
 
-  return TRUE;
+  return ret;
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 51682e9..29376a3 100644 (file)
 
 #include <gst/gst.h>
 
-GType gst_checksum_sink_get_type (void);
-GType fps_display_sink_get_type (void);
-GType gst_chop_my_data_get_type (void);
-GType gst_compare_get_type (void);
-GType gst_debug_spy_get_type (void);
-GType gst_error_ignore_get_type (void);
-GType gst_watchdog_get_type (void);
-GType gst_fake_audio_sink_get_type (void);
-GType gst_fake_video_sink_get_type (void);
-GType gst_test_src_bin_get_type (void);
-GType gst_clock_select_get_type (void);
+
+#include "gstdebugutilsbadelements.h"
 
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gst_element_register (plugin, "checksumsink", GST_RANK_NONE,
-      gst_checksum_sink_get_type ());
-  gst_element_register (plugin, "fpsdisplaysink", GST_RANK_NONE,
-      fps_display_sink_get_type ());
-  gst_element_register (plugin, "chopmydata", GST_RANK_NONE,
-      gst_chop_my_data_get_type ());
-  gst_element_register (plugin, "compare", GST_RANK_NONE,
-      gst_compare_get_type ());
-  gst_element_register (plugin, "debugspy", GST_RANK_NONE,
-      gst_debug_spy_get_type ());
-  gst_element_register (plugin, "watchdog", GST_RANK_NONE,
-      gst_watchdog_get_type ());
-  gst_element_register (plugin, "errorignore", GST_RANK_NONE,
-      gst_error_ignore_get_type ());
-  gst_element_register (plugin, "fakeaudiosink", GST_RANK_NONE,
-      gst_fake_audio_sink_get_type ());
-  gst_element_register (plugin, "fakevideosink", GST_RANK_NONE,
-      gst_fake_video_sink_get_type ());
-  gst_element_register (plugin, "testsrcbin", GST_RANK_NONE,
-      gst_test_src_bin_get_type ());
-  gst_element_register (plugin, "clockselect", GST_RANK_NONE,
-      gst_clock_select_get_type ());
+  gboolean ret = FALSE;
+
+  ret |= GST_ELEMENT_REGISTER (checksumsink, plugin);
+  ret |= GST_ELEMENT_REGISTER (fpsdisplaysink, plugin);
+  ret |= GST_ELEMENT_REGISTER (chopmydata, plugin);
+  ret |= GST_ELEMENT_REGISTER (compare, plugin);
+  ret |= GST_ELEMENT_REGISTER (debugspy, plugin);
+  ret |= GST_ELEMENT_REGISTER (watchdog, plugin);
+  ret |= GST_ELEMENT_REGISTER (errorignore, plugin);
+  ret |= GST_ELEMENT_REGISTER (fakevideosink, plugin);
+  ret |= GST_ELEMENT_REGISTER (fakeaudiosink, plugin);
+  ret |= GST_ELEMENT_REGISTER (testsrcbin, plugin);
+  ret |= GST_ELEMENT_REGISTER (clockselect, plugin);
 
-  return TRUE;
+  return ret;
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 90c429e..fd2b974 100644 (file)
@@ -47,6 +47,7 @@
 #include "config.h"
 #endif
 
+#include "gstdebugutilsbadelements.h"
 #include "fpsdisplaysink.h"
 
 #define DEFAULT_SIGNAL_FPS_MEASUREMENTS FALSE
@@ -723,3 +724,6 @@ fps_display_sink_get_type (void)
 
   return fps_display_sink_type;
 }
+
+GST_ELEMENT_REGISTER_DEFINE (fpsdisplaysink, "fpsdisplaysink",
+    GST_RANK_NONE, fps_display_sink_get_type ());
index 337fba0..37a5d77 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <gst/gst.h>
 #include <gst/base/gstbasesink.h>
+#include "gstdebugutilsbadelements.h"
 #include "gstchecksumsink.h"
 
 static void gst_checksum_sink_set_property (GObject * object, guint prop_id,
@@ -73,6 +74,8 @@ gst_checksum_sink_hash_get_type (void)
 
 #define gst_checksum_sink_parent_class parent_class
 G_DEFINE_TYPE (GstChecksumSink, gst_checksum_sink, GST_TYPE_BASE_SINK);
+GST_ELEMENT_REGISTER_DEFINE (checksumsink, "checksumsink",
+    GST_RANK_NONE, gst_checksum_sink_get_type ());
 
 static void
 gst_checksum_sink_class_init (GstChecksumSinkClass * klass)
index 2d4c4b4..7689b42 100644 (file)
@@ -45,6 +45,7 @@
 
 #include <gst/gst.h>
 #include <gst/gst.h>
+#include "gstdebugutilsbadelements.h"
 #include "gstchopmydata.h"
 
 /* prototypes */
@@ -95,6 +96,8 @@ GST_STATIC_PAD_TEMPLATE ("src",
 
 #define gst_chop_my_data_parent_class parent_class
 G_DEFINE_TYPE (GstChopMyData, gst_chop_my_data, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE (chopmydata, "chopmydata",
+    GST_RANK_NONE, gst_chop_my_data_get_type ());
 
 static void
 gst_chop_my_data_class_init (GstChopMyDataClass * klass)
index a8f574b..663228a 100644 (file)
@@ -39,6 +39,7 @@
 
 #include <gst/gst.h>
 #include <gst/net/net.h>
+#include "gstdebugutilsbadelements.h"
 #include "gstclockselect.h"
 
 GST_DEBUG_CATEGORY_STATIC (gst_clock_select_debug_category);
@@ -94,6 +95,8 @@ enum
 G_DEFINE_TYPE_WITH_CODE (GstClockSelect, gst_clock_select, GST_TYPE_PIPELINE,
     GST_DEBUG_CATEGORY_INIT (gst_clock_select_debug_category, "clockselect", 0,
         "debug category for clockselect element"));
+GST_ELEMENT_REGISTER_DEFINE (clockselect, "clockselect",
+    GST_RANK_NONE, gst_clock_select_get_type ());
 
 static void
 gst_clock_select_class_init (GstClockSelectClass * klass)
index 196d79b..31f9ee6 100644 (file)
@@ -29,6 +29,7 @@
 #include <gst/base/gstcollectpads.h>
 #include <gst/video/video.h>
 
+#include "gstdebugutilsbadelements.h"
 #include "gstcompare.h"
 
 GST_DEBUG_CATEGORY_STATIC (compare_debug);
@@ -117,6 +118,8 @@ static GstStateChangeReturn gst_compare_change_state (GstElement * element,
 
 #define gst_compare_parent_class parent_class
 G_DEFINE_TYPE (GstCompare, gst_compare, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE (compare, "compare",
+    GST_RANK_NONE, gst_compare_get_type ());
 
 static void
 gst_compare_finalize (GObject * object)
index baacc4b..58f30b9 100644 (file)
@@ -40,6 +40,7 @@
 
 #include <gst/gst.h>
 
+#include "gstdebugutilsbadelements.h"
 #include "gstdebugspy.h"
 
 GST_DEBUG_CATEGORY_STATIC (gst_debug_spy_debug);
@@ -96,6 +97,8 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
     );
 
 G_DEFINE_TYPE (GstDebugSpy, gst_debug_spy, GST_TYPE_BASE_TRANSFORM);
+GST_ELEMENT_REGISTER_DEFINE (debugspy, "debugspy",
+    GST_RANK_NONE, gst_debug_spy_get_type ());
 
 static void gst_debug_spy_set_property (GObject * object, guint prop_id,
     const GValue * value, GParamSpec * pspec);
diff --git a/gst/debugutils/gstdebugutilsbadelements.h b/gst/debugutils/gstdebugutilsbadelements.h
new file mode 100644 (file)
index 0000000..71a42cb
--- /dev/null
@@ -0,0 +1,43 @@
+/* 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_DEBUGUTILSBAD_ELEMENT_H__
+#define __GST_DEBUGUTILSBAD_ELEMENT_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gst/gst.h>
+
+GST_ELEMENT_REGISTER_DECLARE (fpsdisplaysink);
+GST_ELEMENT_REGISTER_DECLARE (checksumsink);
+GST_ELEMENT_REGISTER_DECLARE (chopmydata);
+GST_ELEMENT_REGISTER_DECLARE (clockselect);
+GST_ELEMENT_REGISTER_DECLARE (compare);
+GST_ELEMENT_REGISTER_DECLARE (debugspy);
+GST_ELEMENT_REGISTER_DECLARE (testsrcbin);
+GST_ELEMENT_REGISTER_DECLARE (errorignore);
+GST_ELEMENT_REGISTER_DECLARE (fakevideosink);
+GST_ELEMENT_REGISTER_DECLARE (fakeaudiosink);
+GST_ELEMENT_REGISTER_DECLARE (watchdog);
+
+
+#endif /* __GST_DEBUGUTILSBAD_PLUGIN_H__ */
index 768d8f7..f65ca92 100644 (file)
@@ -38,6 +38,7 @@
 #include "config.h"
 #endif
 
+#include "gstdebugutilsbadelements.h"
 #include "gsterrorignore.h"
 
 #define GST_CAT_DEFAULT gst_error_ignore_debug
@@ -69,6 +70,8 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
 
 #define parent_class gst_error_ignore_parent_class
 G_DEFINE_TYPE (GstErrorIgnore, gst_error_ignore, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE (errorignore, "errorignore",
+    GST_RANK_NONE, gst_error_ignore_get_type ());
 
 static GstFlowReturn gst_error_ignore_sink_chain (GstPad * pad,
     GstObject * parent, GstBuffer * inbuf);
index 8f8c56b..8955345 100644 (file)
@@ -37,6 +37,7 @@
  * Since: 1.20
  */
 
+#include "gstdebugutilsbadelements.h"
 #include "gstfakeaudiosink.h"
 
 #include <gst/audio/audio.h>
@@ -57,6 +58,8 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
 
 G_DEFINE_TYPE_WITH_CODE (GstFakeAudioSink, gst_fake_audio_sink, GST_TYPE_BIN,
     G_IMPLEMENT_INTERFACE (GST_TYPE_STREAM_VOLUME, NULL););
+GST_ELEMENT_REGISTER_DEFINE (fakeaudiosink, "fakeaudiosink",
+    GST_RANK_NONE, gst_fake_audio_sink_get_type ());
 
 /* TODO complete the types and make this an utility */
 static void
index ddb2ae1..c524ccf 100644 (file)
@@ -37,6 +37,7 @@
  * Since 1.14
  */
 
+#include "gstdebugutilsbadelements.h"
 #include "gstfakevideosink.h"
 
 #include <gst/video/video.h>
@@ -84,6 +85,8 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
             GST_VIDEO_FORMATS_ALL)));
 
 G_DEFINE_TYPE (GstFakeVideoSink, gst_fake_video_sink, GST_TYPE_BIN);
+GST_ELEMENT_REGISTER_DEFINE (fakevideosink, "fakevideosink",
+    GST_RANK_NONE, gst_fake_video_sink_get_type ());
 
 static gboolean
 gst_fake_video_sink_query (GstPad * pad, GstObject * parent, GstQuery * query)
index 89e18e8..e97556f 100644 (file)
@@ -39,6 +39,7 @@
 #include <gst/gst.h>
 #include <gst/base/gstflowcombiner.h>
 #include <gst/app/gstappsink.h>
+#include "gstdebugutilsbadelements.h"
 
 static GstStaticPadTemplate video_src_template =
 GST_STATIC_PAD_TEMPLATE ("video_src_%u",
@@ -377,6 +378,9 @@ G_DEFINE_TYPE_WITH_CODE (GstTestSrcBin, gst_test_src_bin, GST_TYPE_BIN,
     G_IMPLEMENT_INTERFACE (GST_TYPE_URI_HANDLER, gst_test_src_bin_uri_handler_init))
 /* *INDENT-ON* */
 
+GST_ELEMENT_REGISTER_DEFINE (testsrcbin, "testsrcbin",
+    GST_RANK_NONE, gst_test_src_bin_get_type ());
+
 static void
 gst_test_src_bin_set_property (GObject * object, guint prop_id,
     const GValue * value, GParamSpec * pspec)
index a45039a..eb12841 100644 (file)
@@ -46,6 +46,7 @@
 
 #include <gst/gst.h>
 #include <gst/base/gstbasetransform.h>
+#include "gstdebugutilsbadelements.h"
 #include "gstwatchdog.h"
 
 GST_DEBUG_CATEGORY_STATIC (gst_watchdog_debug_category);
@@ -83,6 +84,8 @@ enum
 G_DEFINE_TYPE_WITH_CODE (GstWatchdog, gst_watchdog, GST_TYPE_BASE_TRANSFORM,
     GST_DEBUG_CATEGORY_INIT (gst_watchdog_debug_category, "watchdog", 0,
         "debug category for watchdog element"));
+GST_ELEMENT_REGISTER_DEFINE (watchdog, "watchdog", GST_RANK_NONE,
+    gst_watchdog_get_type ());
 
 static void
 gst_watchdog_class_init (GstWatchdogClass * klass)
index bde0954..ab25ae2 100644 (file)
@@ -51,6 +51,10 @@ enum
 
 #define gst_dvb_sub_enc_parent_class parent_class
 G_DEFINE_TYPE (GstDvbSubEnc, gst_dvb_sub_enc, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (dvbsubenc, "dvbsubenc", GST_RANK_NONE,
+    GST_TYPE_DVB_SUB_ENC, GST_DEBUG_CATEGORY_INIT (gst_dvb_sub_enc_debug,
+        "dvbsubenc", 0, "DVB subtitle encoder");
+    );
 
 static void gst_dvb_sub_enc_get_property (GObject * object, guint prop_id,
     GValue * value, GParamSpec * pspec);
@@ -591,15 +595,7 @@ gst_dvb_sub_enc_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  if (!gst_element_register (plugin, "dvbsubenc", GST_RANK_NONE,
-          GST_TYPE_DVB_SUB_ENC)) {
-    return FALSE;
-  }
-
-  GST_DEBUG_CATEGORY_INIT (gst_dvb_sub_enc_debug, "dvbsubenc", 0,
-      "DVB subtitle encoder");
-
-  return TRUE;
+  return GST_ELEMENT_REGISTER (dvbsubenc, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 76d8f5f..507e9f5 100644 (file)
@@ -64,6 +64,7 @@ struct _GstDvbSubEncClass
 };
 
 GType gst_dvb_sub_enc_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (dvbsubenc);
 
 gboolean gst_dvbsubenc_ayuv_to_ayuv8p (GstVideoFrame * src, GstVideoFrame * dest, int max_colours, guint32 *out_num_colours);
 
index f28590c..d8ac5d6 100644 (file)
@@ -107,6 +107,11 @@ static GstStateChangeReturn gst_dvbsub_overlay_change_state (GstElement *
 
 #define gst_dvbsub_overlay_parent_class parent_class
 G_DEFINE_TYPE (GstDVBSubOverlay, gst_dvbsub_overlay, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (dvbsuboverlay, "dvbsuboverlay",
+    GST_RANK_PRIMARY, GST_TYPE_DVBSUB_OVERLAY,
+    GST_DEBUG_CATEGORY_INIT (gst_dvbsub_overlay_debug, "dvbsuboverlay", 0,
+        "DVB subtitle overlay");
+    );
 
 static GstCaps *gst_dvbsub_overlay_get_videosink_caps (GstDVBSubOverlay *
     render, GstPad * pad, GstCaps * filter);
@@ -1303,11 +1308,7 @@ gst_dvbsub_overlay_event_text (GstPad * pad, GstObject * parent,
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  GST_DEBUG_CATEGORY_INIT (gst_dvbsub_overlay_debug, "dvbsuboverlay",
-      0, "DVB subtitle overlay");
-
-  return gst_element_register (plugin, "dvbsuboverlay",
-      GST_RANK_PRIMARY, GST_TYPE_DVBSUB_OVERLAY);
+  return GST_ELEMENT_REGISTER (dvbsuboverlay, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index aecfa9d..518fe66 100644 (file)
@@ -76,6 +76,7 @@ struct _GstDVBSubOverlayClass
 };
 
 GType gst_dvbsub_overlay_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (dvbsuboverlay);
 
 G_END_DECLS
 
index 41c964b..2e049b6 100644 (file)
@@ -75,8 +75,11 @@ static GstStaticPadTemplate subpic_sink_factory =
     GST_STATIC_CAPS ("subpicture/x-dvd; subpicture/x-pgs")
     );
 
+static gboolean dvd_spu_element_init (GstPlugin * plugin);
+
 #define gst_dvd_spu_parent_class parent_class
 G_DEFINE_TYPE (GstDVDSpu, gst_dvd_spu, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE_CUSTOM (dvdspu, dvd_spu_element_init);
 
 static void gst_dvd_spu_dispose (GObject * object);
 static void gst_dvd_spu_finalize (GObject * object);
@@ -1238,7 +1241,7 @@ gst_dvd_spu_change_state (GstElement * element, GstStateChange transition)
 }
 
 static gboolean
-gst_dvd_spu_plugin_init (GstPlugin * plugin)
+dvd_spu_element_init (GstPlugin * plugin)
 {
   const gchar *env;
 
@@ -1260,6 +1263,12 @@ gst_dvd_spu_plugin_init (GstPlugin * plugin)
       GST_RANK_PRIMARY, GST_TYPE_DVD_SPU);
 }
 
+static gboolean
+gst_dvd_spu_plugin_init (GstPlugin * plugin)
+{
+  return GST_ELEMENT_REGISTER (dvdspu, plugin);
+}
+
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
     GST_VERSION_MINOR,
     dvdspu,
index aa8ae77..5c8585d 100644 (file)
@@ -123,6 +123,7 @@ struct _GstDVDSpuClass {
 };
 
 GType gst_dvd_spu_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (dvdspu);
 
 typedef enum {
   GST_DVD_SPU_DEBUG_RENDER_RECTANGLE = (1 << 0),
index 236d483..12dc641 100644 (file)
@@ -89,6 +89,11 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
 
 #define gst_face_overlay_parent_class parent_class
 G_DEFINE_TYPE (GstFaceOverlay, gst_face_overlay, GST_TYPE_BIN);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (faceoverlay, "faceoverlay",
+    GST_RANK_NONE, GST_TYPE_FACEOVERLAY,
+    GST_DEBUG_CATEGORY_INIT (gst_face_overlay_debug, "faceoverlay", 0,
+        "SVG Face Overlay");
+    );
 
 static void gst_face_overlay_set_property (GObject * object, guint prop_id,
     const GValue * value, GParamSpec * pspec);
@@ -430,13 +435,9 @@ gst_face_overlay_get_property (GObject * object, guint prop_id,
 }
 
 static gboolean
-faceoverlay_init (GstPlugin * faceoverlay)
+faceoverlay_init (GstPlugin * plugin)
 {
-  GST_DEBUG_CATEGORY_INIT (gst_face_overlay_debug, "faceoverlay",
-      0, "SVG Face Overlay");
-
-  return gst_element_register (faceoverlay, "faceoverlay", GST_RANK_NONE,
-      GST_TYPE_FACEOVERLAY);
+  return GST_ELEMENT_REGISTER (faceoverlay, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 810e28a..315861f 100644 (file)
@@ -88,6 +88,7 @@ struct _GstFaceOverlayClass
 };
 
 GType gst_face_overlay_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (faceoverlay);
 
 G_END_DECLS
 
index d1637ab..0876776 100644 (file)
@@ -150,9 +150,14 @@ enum
 
 /*static guint gst_festival_signals[LAST_SIGNAL] = { 0 }; */
 
-G_DEFINE_TYPE (GstFestival, gst_festival, GST_TYPE_ELEMENT)
+G_DEFINE_TYPE (GstFestival, gst_festival, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (festival, "festival", GST_RANK_NONE,
+    GST_TYPE_FESTIVAL, GST_DEBUG_CATEGORY_INIT (festival_debug, "festival",
+        0, "Festival text-to-speech synthesizer");
+    );;
 
-     static void gst_festival_class_init (GstFestivalClass * klass)
+static void
+gst_festival_class_init (GstFestivalClass * klass)
 {
   GObjectClass *gobject_class;
   GstElementClass *gstelement_class;
@@ -524,14 +529,7 @@ gst_festival_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  GST_DEBUG_CATEGORY_INIT (festival_debug, "festival",
-      0, "Festival text-to-speech synthesizer");
-
-  if (!gst_element_register (plugin, "festival", GST_RANK_NONE,
-          GST_TYPE_FESTIVAL))
-    return FALSE;
-
-  return TRUE;
+  return GST_ELEMENT_REGISTER (festival, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 1e43283..24cba5c 100644 (file)
@@ -116,6 +116,7 @@ struct _GstFestivalClass {
 };
 
 GType gst_festival_get_type(void);
+GST_ELEMENT_REGISTER_DECLARE (festival);
 
 #ifdef __cplusplus
 }
index 644a91e..8e8f719 100644 (file)
@@ -108,6 +108,12 @@ GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
     GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("{YUY2,UYVY,Y42B,I420,YV12}")));
 
 G_DEFINE_TYPE (GstFieldAnalysis, gst_field_analysis, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (fieldanalysis, "fieldanalysis",
+    GST_RANK_NONE, GST_TYPE_FIELDANALYSIS,
+    GST_DEBUG_CATEGORY_INIT (gst_field_analysis_debug, "fieldanalysis", 0,
+        "Video field analysis");
+    );
+
 #define parent_class gst_field_analysis_parent_class
 
 static void gst_field_analysis_set_property (GObject * object, guint prop_id,
@@ -1840,13 +1846,9 @@ gst_field_analysis_finalize (GObject * object)
 
 
 static gboolean
-fieldanalysis_init (GstPlugin * fieldanalysis)
+fieldanalysis_init (GstPlugin * plugin)
 {
-  GST_DEBUG_CATEGORY_INIT (gst_field_analysis_debug, "fieldanalysis",
-      0, "Video field analysis");
-
-  return gst_element_register (fieldanalysis, "fieldanalysis", GST_RANK_NONE,
-      GST_TYPE_FIELDANALYSIS);
+  return GST_ELEMENT_REGISTER (fieldanalysis, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index ff68835..6269b8b 100644 (file)
@@ -143,6 +143,7 @@ struct _GstFieldAnalysisClass
 };
 
 GType gst_field_analysis_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (fieldanalysis);
 
 G_END_DECLS
 #endif /* __GST_FIELDANALYSIS_H__ */
index 2ea9ee8..59f7271 100644 (file)
@@ -347,6 +347,8 @@ struct _GstFreeverbPrivate
 G_DEFINE_TYPE_WITH_CODE (GstFreeverb, gst_freeverb, GST_TYPE_BASE_TRANSFORM,
     G_ADD_PRIVATE (GstFreeverb)
     G_IMPLEMENT_INTERFACE (GST_TYPE_PRESET, NULL));
+GST_ELEMENT_REGISTER_DEFINE (freeverb, "freeverb",
+    GST_RANK_NONE, GST_TYPE_FREEVERB);
 
 static void
 freeverb_revmodel_init (GstFreeverb * filter)
@@ -928,8 +930,7 @@ gst_freeverb_transform (GstBaseTransform * base, GstBuffer * inbuf,
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  return gst_element_register (plugin, "freeverb",
-      GST_RANK_NONE, GST_TYPE_FREEVERB);
+  return GST_ELEMENT_REGISTER (freeverb, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index ac6f134..320aefa 100644 (file)
@@ -62,6 +62,7 @@ struct _GstFreeverbClass {
 };
 
 GType gst_freeverb_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (freeverb);
 
 G_END_DECLS
 
index bc5aefb..e009fd2 100644 (file)
 #include <gst/gst.h>
 #include <math.h>
 
-#include "gstplugin.h"
 #include "gstburn.h"
 
 #include "gstgaudieffectsorc.h"
 
-#define gst_burn_parent_class parent_class
-G_DEFINE_TYPE (GstBurn, gst_burn, GST_TYPE_VIDEO_FILTER);
-
 GST_DEBUG_CATEGORY_STATIC (gst_burn_debug);
 #define GST_CAT_DEFAULT gst_burn_debug
 
+#define gst_burn_parent_class parent_class
+G_DEFINE_TYPE (GstBurn, gst_burn, GST_TYPE_VIDEO_FILTER);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (burn, "burn", GST_RANK_NONE,
+    GST_TYPE_BURN, GST_DEBUG_CATEGORY_INIT (gst_burn_debug, "burn", 0,
+        "Template burn"));
+
 #if G_BYTE_ORDER == G_LITTLE_ENDIAN
 #define CAPS_STR GST_VIDEO_CAPS_MAKE ("{  BGRx, RGBx }")
 #else
@@ -246,14 +248,3 @@ gst_burn_transform_frame (GstVideoFilter * vfilter,
 
   return GST_FLOW_OK;
 }
-
-/* Entry point to initialize the plug-in.
- * Register the element factories and other features. */
-gboolean
-gst_burn_plugin_init (GstPlugin * burn)
-{
-  /* debug category for fltering log messages */
-  GST_DEBUG_CATEGORY_INIT (gst_burn_debug, "burn", 0, "Template burn");
-
-  return gst_element_register (burn, "burn", GST_RANK_NONE, GST_TYPE_BURN);
-}
index 5f563f8..e467e8e 100644 (file)
@@ -81,6 +81,7 @@ struct _GstBurnClass
 };
 
 GType gst_burn_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (burn);
 
 G_END_DECLS
 
index 1a3f366..24c93aa 100644 (file)
 #include <math.h>
 #include <gst/gst.h>
 
-#include "gstplugin.h"
 #include "gstchromium.h"
 
-#define gst_chromium_parent_class parent_class
-G_DEFINE_TYPE (GstChromium, gst_chromium, GST_TYPE_VIDEO_FILTER);
-
 GST_DEBUG_CATEGORY_STATIC (gst_chromium_debug);
 #define GST_CAT_DEFAULT gst_chromium_debug
 
+#define gst_chromium_parent_class parent_class
+G_DEFINE_TYPE (GstChromium, gst_chromium, GST_TYPE_VIDEO_FILTER);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (chromium, "chromium", GST_RANK_NONE,
+    GST_TYPE_CHROMIUM, GST_DEBUG_CATEGORY_INIT (gst_chromium_debug, "chromium",
+        0, "Template chromium"));
+
 #if G_BYTE_ORDER == G_LITTLE_ENDIAN
 #define CAPS_STR GST_VIDEO_CAPS_MAKE ("{  BGRx, RGBx }")
 #else
@@ -275,19 +277,6 @@ gst_chromium_transform_frame (GstVideoFilter * vfilter,
   return GST_FLOW_OK;
 }
 
-/* Entry point to initialize the plug-in.
- * Register the element factories and other features. */
-gboolean
-gst_chromium_plugin_init (GstPlugin * chromium)
-{
-  /* debug category for fltering log messages */
-  GST_DEBUG_CATEGORY_INIT (gst_chromium_debug, "chromium", 0,
-      "Template chromium");
-
-  return gst_element_register (chromium, "chromium", GST_RANK_NONE,
-      GST_TYPE_CHROMIUM);
-}
-
 /*** Now the image processing work.... ***/
 /* Set up the cosine table. */
 void
index 8c3b4a0..1b8a44c 100644 (file)
@@ -79,6 +79,7 @@ struct _GstChromiumClass
 };
 
 GType gst_chromium_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (chromium);
 
 G_END_DECLS
 
index 2a1e775..aec92b1 100644 (file)
@@ -64,7 +64,6 @@
 #include <gst/gst.h>
 #include <math.h>
 
-#include "gstplugin.h"
 #include "gstdilate.h"
 
 GST_DEBUG_CATEGORY_STATIC (gst_dilate_debug);
@@ -78,6 +77,9 @@ GST_DEBUG_CATEGORY_STATIC (gst_dilate_debug);
 
 #define gst_dilate_parent_class parent_class
 G_DEFINE_TYPE (GstDilate, gst_dilate, GST_TYPE_VIDEO_FILTER);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (dilate, "dilate", GST_RANK_NONE,
+    GST_TYPE_DILATE, GST_DEBUG_CATEGORY_INIT (gst_dilate_debug, "dilate", 0,
+        "Template dilate"));
 
 /* Filter signals and args. */
 enum
@@ -250,18 +252,6 @@ gst_dilate_transform_frame (GstVideoFilter * vfilter,
   return GST_FLOW_OK;
 }
 
-/* Entry point to initialize the plug-in.
- * Register the element factories and other features. */
-gboolean
-gst_dilate_plugin_init (GstPlugin * dilate)
-{
-  /* debug category for fltering log messages */
-  GST_DEBUG_CATEGORY_INIT (gst_dilate_debug, "dilate", 0, "Template dilate");
-
-  return gst_element_register (dilate, "dilate", GST_RANK_NONE,
-      GST_TYPE_DILATE);
-}
-
 /*** Now the image processing work.... ***/
 
 /* Return luminance of the color */
index afb0901..c216a35 100644 (file)
@@ -81,6 +81,7 @@ struct _GstDilateClass
 };
 
 GType gst_dilate_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (dilate);
 
 G_END_DECLS
 
index ee2ce7d..db3c251 100644 (file)
@@ -64,7 +64,6 @@
 #include <gst/gst.h>
 #include <math.h>
 
-#include "gstplugin.h"
 #include "gstdodge.h"
 
 GST_DEBUG_CATEGORY_STATIC (gst_dodge_debug);
@@ -78,6 +77,9 @@ GST_DEBUG_CATEGORY_STATIC (gst_dodge_debug);
 
 #define gst_dodge_parent_class parent_class
 G_DEFINE_TYPE (GstDodge, gst_dodge, GST_TYPE_VIDEO_FILTER);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (dodge, "dodge", GST_RANK_NONE,
+    GST_TYPE_DODGE, GST_DEBUG_CATEGORY_INIT (gst_dodge_debug, "dodge", 0,
+        "Template dodge"));
 
 /* Filter signals and args. */
 enum
@@ -223,17 +225,6 @@ gst_dodge_transform_frame (GstVideoFilter * vfilter,
   return GST_FLOW_OK;
 }
 
-/* Entry point to initialize the plug-in.
- * Register the element factories and other features. */
-gboolean
-gst_dodge_plugin_init (GstPlugin * dodge)
-{
-  /* debug category for fltering log messages */
-  GST_DEBUG_CATEGORY_INIT (gst_dodge_debug, "dodge", 0, "Template dodge");
-
-  return gst_element_register (dodge, "dodge", GST_RANK_NONE, GST_TYPE_DODGE);
-}
-
 /*** Now the image processing work.... ***/
 
 /* Transform processes each frame. */
index 64bf4d0..53e41c5 100644 (file)
@@ -78,6 +78,7 @@ struct _GstDodgeClass
 };
 
 GType gst_dodge_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (dodge);
 
 G_END_DECLS
 
index 6c696b6..0fa4658 100644 (file)
@@ -64,7 +64,6 @@
 #include <gst/gst.h>
 #include <math.h>
 
-#include "gstplugin.h"
 #include "gstexclusion.h"
 
 #include <gst/video/video.h>
@@ -115,6 +114,9 @@ GST_STATIC_PAD_TEMPLATE ("src",
 
 #define gst_exclusion_parent_class parent_class
 G_DEFINE_TYPE (GstExclusion, gst_exclusion, GST_TYPE_VIDEO_FILTER);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (exclusion, "exclusion", GST_RANK_NONE,
+    GST_TYPE_EXCLUSION, GST_DEBUG_CATEGORY_INIT (gst_exclusion_debug,
+        "exclusion", 0, "Template exclusion"));
 
 static void gst_exclusion_set_property (GObject * object, guint prop_id,
     const GValue * value, GParamSpec * pspec);
@@ -248,19 +250,6 @@ gst_exclusion_transform_frame (GstVideoFilter * vfilter,
   return GST_FLOW_OK;
 }
 
-/* Entry point to initialize the plug-in.
- * Register the element factories and other features. */
-gboolean
-gst_exclusion_plugin_init (GstPlugin * exclusion)
-{
-  /* debug category for fltering log messages */
-  GST_DEBUG_CATEGORY_INIT (gst_exclusion_debug, "exclusion",
-      0, "Template exclusion");
-
-  return gst_element_register (exclusion, "exclusion", GST_RANK_NONE,
-      GST_TYPE_EXCLUSION);
-}
-
 /*** Now the image processing work.... ***/
 
 /* Transform processes each frame. */
index b910835..fc15e70 100644 (file)
@@ -81,6 +81,7 @@ struct _GstExclusionClass
 };
 
 GType gst_exclusion_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (exclusion);
 
 G_END_DECLS
 
index dc2d479..1c274c8 100644 (file)
@@ -66,7 +66,6 @@
 #include <math.h>
 #include <gst/gst.h>
 
-#include "gstplugin.h"
 #include "gstgaussblur.h"
 
 static void gst_gaussianblur_finalize (GObject * object);
@@ -120,7 +119,10 @@ static void gaussian_smooth (GstGaussianBlur * gb, guint8 * image,
 
 #define gst_gaussianblur_parent_class parent_class
 G_DEFINE_TYPE (GstGaussianBlur, gst_gaussianblur, GST_TYPE_VIDEO_FILTER);
-
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (gaussianblur, "gaussianblur",
+    GST_RANK_NONE, GST_TYPE_GAUSSIANBLUR,
+    GST_DEBUG_CATEGORY_INIT (gst_gauss_blur_debug, "gaussianblur", 0,
+        "Gaussian Blur video effect"));
 #define DEFAULT_SIGMA 1.2
 
 /* Initialize the gaussianblur's class. */
@@ -452,15 +454,3 @@ gst_gaussianblur_get_property (GObject * object,
       break;
   }
 }
-
-/* Register the element factories and other features. */
-gboolean
-gst_gauss_blur_plugin_init (GstPlugin * plugin)
-{
-  /* debug category for fltering log messages */
-  GST_DEBUG_CATEGORY_INIT (gst_gauss_blur_debug, "gaussianblur",
-      0, "Gaussian Blur video effect");
-
-  return gst_element_register (plugin, "gaussianblur", GST_RANK_NONE,
-      GST_TYPE_GAUSSIANBLUR);
-}
index 33cbb02..bd39ee3 100644 (file)
@@ -81,6 +81,7 @@ struct _GstGaussianBlurClass
 };
 
 GType gst_gaussianblur_get_type(void);
+GST_ELEMENT_REGISTER_DECLARE (gaussianblur);
 
 G_END_DECLS
 
index 0bcd011..1f1ceb5 100644 (file)
 
 #include <gst/gst.h>
 
-#include "gstplugin.h"
+#include "gstburn.h"
+#include "gstchromium.h"
+#include "gstdilate.h"
+#include "gstdodge.h"
+#include "gstexclusion.h"
+#include "gstgaussblur.h"
+#include "gstsolarize.h"
+
 
 /* PACKAGE: this is usually set by autotools depending on some _INIT macro
  * in configure.ac and then written into and defined in config.h, but we can
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gboolean ret = TRUE;
+  gboolean ret = FALSE;
 
-  ret &= gst_burn_plugin_init (plugin);
-  ret &= gst_chromium_plugin_init (plugin);
-  ret &= gst_dilate_plugin_init (plugin);
-  ret &= gst_dodge_plugin_init (plugin);
-  ret &= gst_exclusion_plugin_init (plugin);
-  ret &= gst_solarize_plugin_init (plugin);
-  ret &= gst_gauss_blur_plugin_init (plugin);
+  ret |= GST_ELEMENT_REGISTER (burn, plugin);
+  ret |= GST_ELEMENT_REGISTER (chromium, plugin);
+  ret |= GST_ELEMENT_REGISTER (dilate, plugin);
+  ret |= GST_ELEMENT_REGISTER (dodge, plugin);
+  ret |= GST_ELEMENT_REGISTER (exclusion, plugin);
+  ret |= GST_ELEMENT_REGISTER (solarize, plugin);
+  ret |= GST_ELEMENT_REGISTER (gaussianblur, plugin);
 
   return ret;
 }
diff --git a/gst/gaudieffects/gstplugin.h b/gst/gaudieffects/gstplugin.h
deleted file mode 100644 (file)
index 5cc4249..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * GStreamer
- * Copyright (C) 2005 Thomas Vander Stichele <thomas@apestaart.org>
- * Copyright (C) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
- * Copyright (C) 2010 Luis de Bethencourt <luis@debethencourt.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., 51 Franklin St, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef __GST_GAUDI_EFFECTS_H__
-#define __GST_GAUDI_EFFECTS_H__
-
-#include <gst/gst.h>
-
-G_BEGIN_DECLS
-
-gboolean gst_burn_plugin_init (GstPlugin *plugin);
-gboolean gst_chromium_plugin_init (GstPlugin *plugin);
-gboolean gst_dilate_plugin_init (GstPlugin *plugin);
-gboolean gst_dodge_plugin_init (GstPlugin *plugin);
-gboolean gst_exclusion_plugin_init (GstPlugin *plugin);
-gboolean gst_gauss_blur_plugin_init (GstPlugin *plugin);
-gboolean gst_solarize_plugin_init (GstPlugin *plugin);
-
-G_END_DECLS
-
-#endif /* __GST_GAUDI_EFFECTS_H__ */
index 23a69d0..00f317d 100644 (file)
@@ -64,7 +64,6 @@
 #include <gst/gst.h>
 #include <math.h>
 
-#include "gstplugin.h"
 #include "gstsolarize.h"
 
 GST_DEBUG_CATEGORY_STATIC (gst_solarize_debug);
@@ -117,6 +116,9 @@ GST_STATIC_PAD_TEMPLATE ("src",
 
 #define gst_solarize_parent_class parent_class
 G_DEFINE_TYPE (GstSolarize, gst_solarize, GST_TYPE_VIDEO_FILTER);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (solarize, "solarize", GST_RANK_NONE,
+    GST_TYPE_SOLARIZE, GST_DEBUG_CATEGORY_INIT (gst_solarize_debug, "solarize",
+        0, "Template solarize"));
 
 static void gst_solarize_set_property (GObject * object, guint prop_id,
     const GValue * value, GParamSpec * pspec);
@@ -278,19 +280,6 @@ gst_solarize_transform_frame (GstVideoFilter * vfilter,
   return GST_FLOW_OK;
 }
 
-/* Entry point to initialize the plug-in.
- * Register the element factories and other features. */
-gboolean
-gst_solarize_plugin_init (GstPlugin * solarize)
-{
-  /* debug category for fltering log messages */
-  GST_DEBUG_CATEGORY_INIT (gst_solarize_debug, "solarize",
-      0, "Template solarize");
-
-  return gst_element_register (solarize, "solarize", GST_RANK_NONE,
-      GST_TYPE_SOLARIZE);
-}
-
 /*** Now the image processing work.... ***/
 
 /* Transform processes each frame. */
index 2390563..e81615e 100644 (file)
@@ -81,6 +81,7 @@ struct _GstSolarizeClass
 };
 
 GType gst_solarize_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (solarize);
 
 G_END_DECLS
 
index 4ac3a0f..d35e778 100644 (file)
 
 #include "dataprotocol.h"
 
-#include "gstgdppay.h"
-#include "gstgdpdepay.h"
+#include "gstgdpelements.h"
 
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gst_dp_init ();
+  gboolean ret = FALSE;
 
-  if (!gst_gdp_depay_plugin_init (plugin))
-    return FALSE;
+  ret |= GST_ELEMENT_REGISTER (gdpdepay, plugin);
+  ret |= GST_ELEMENT_REGISTER (gdppay, plugin);
 
-  if (!gst_gdp_pay_plugin_init (plugin))
-    return FALSE;
-
-  return TRUE;
+  return ret;
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR,
index 750571e..f17960b 100644 (file)
@@ -40,6 +40,7 @@
 
 #include "dataprotocol.h"
 
+#include "gstgdpelements.h"
 #include "gstgdpdepay.h"
 
 enum
@@ -69,6 +70,8 @@ GST_DEBUG_CATEGORY_STATIC (gst_gdp_depay_debug);
 #define gst_gdp_depay_parent_class parent_class
 G_DEFINE_TYPE_WITH_CODE (GstGDPDepay, gst_gdp_depay,
     GST_TYPE_ELEMENT, _do_init);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (gdpdepay, "gdpdepay", GST_RANK_NONE,
+    GST_TYPE_GDP_DEPAY, gdp_element_init (plugin));
 
 static gboolean gst_gdp_depay_sink_event (GstPad * pad, GstObject * parent,
     GstEvent * event);
@@ -586,13 +589,3 @@ gst_gdp_depay_decide_allocation (GstGDPDepay * gdpdepay)
   gst_caps_unref (caps);
   gst_query_unref (query);
 }
-
-gboolean
-gst_gdp_depay_plugin_init (GstPlugin * plugin)
-{
-  if (!gst_element_register (plugin, "gdpdepay", GST_RANK_NONE,
-          GST_TYPE_GDP_DEPAY))
-    return FALSE;
-
-  return TRUE;
-}
index c21f302..698f9d9 100644 (file)
@@ -78,8 +78,6 @@ struct _GstGDPDepayClass
   GstElementClass parent_class;
 };
 
-gboolean gst_gdp_depay_plugin_init (GstPlugin * plugin);
-
 GType gst_gdp_depay_get_type (void);
 
 G_END_DECLS
diff --git a/gst/gdp/gstgdpelement.c b/gst/gdp/gstgdpelement.c
new file mode 100644 (file)
index 0000000..56aaa11
--- /dev/null
@@ -0,0 +1,37 @@
+/* GStreamer
+ * Copyright (C) 2006 Thomas Vander Stichele <thomas at apestaart dot org>
+ *
+ * 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 "dataprotocol.h"
+#include "gstgdpelements.h"
+
+
+void
+gdp_element_init (GstPlugin * plugin)
+{
+  static gsize res = FALSE;
+
+  if (g_once_init_enter (&res)) {
+    gst_dp_init ();
+    g_once_init_leave (&res, TRUE);
+  }
+}
diff --git a/gst/gdp/gstgdpelements.h b/gst/gdp/gstgdpelements.h
new file mode 100644 (file)
index 0000000..29aed34
--- /dev/null
@@ -0,0 +1,35 @@
+/* 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_GDP_ELEMENT_H__
+#define __GST_GDP_ELEMENT_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gst/gst.h>
+
+void gdp_element_init (GstPlugin * plugin);
+
+GST_ELEMENT_REGISTER_DECLARE (gdppay);
+GST_ELEMENT_REGISTER_DECLARE (gdpdepay);
+
+#endif /* __GST_GDP_ELEMENT_H__ */
index 493472f..2f132f8 100644 (file)
@@ -39,6 +39,7 @@
 
 #include "dataprotocol.h"
 
+#include "gstgdpelements.h"
 #include "gstgdppay.h"
 
 static GstStaticPadTemplate gdp_pay_sink_template =
@@ -71,6 +72,8 @@ enum
     "GDP payloader");
 #define gst_gdp_pay_parent_class parent_class
 G_DEFINE_TYPE_WITH_CODE (GstGDPPay, gst_gdp_pay, GST_TYPE_ELEMENT, _do_init);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (gdppay, "gdppay", GST_RANK_NONE,
+    GST_TYPE_GDP_PAY, gdp_element_init (plugin));
 
 static void gst_gdp_pay_reset (GstGDPPay * this);
 
@@ -708,12 +711,3 @@ gst_gdp_pay_change_state (GstElement * element, GstStateChange transition)
 
   return ret;
 }
-
-gboolean
-gst_gdp_pay_plugin_init (GstPlugin * plugin)
-{
-  if (!gst_element_register (plugin, "gdppay", GST_RANK_NONE, GST_TYPE_GDP_PAY))
-    return FALSE;
-
-  return TRUE;
-}
index 2e01eb1..0e7b3db 100644 (file)
@@ -72,8 +72,6 @@ struct _GstGDPPayClass
   GstElementClass parent_class;
 };
 
-gboolean gst_gdp_pay_plugin_init (GstPlugin * plugin);
-
 GType gst_gdp_pay_get_type (void);
 
 G_END_DECLS
index d55d65e..b76de92 100644 (file)
@@ -1,5 +1,6 @@
 gdp_sources = [
   'dataprotocol.c',
+  'gstgdpelement.c',
   'gstgdp.c',
   'gstgdppay.c',
   'gstgdpdepay.c',
index 315aa0c..dc5eeba 100644 (file)
@@ -79,6 +79,9 @@ enum
 
 #define gst_bulge_parent_class parent_class
 G_DEFINE_TYPE (GstBulge, gst_bulge, GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (bulge, "bulge", GST_RANK_NONE,
+    GST_TYPE_BULGE, GST_DEBUG_CATEGORY_INIT (gst_bulge_debug, "bulge", 0,
+        "bulge"));
 
 static void
 gst_bulge_set_property (GObject * object, guint prop_id, const GValue * value,
@@ -208,11 +211,3 @@ gst_bulge_init (GstBulge * filter)
   filter->zoom = DEFAULT_ZOOM;
   gt->off_edge_pixels = GST_GT_OFF_EDGES_PIXELS_CLAMP;
 }
-
-gboolean
-gst_bulge_plugin_init (GstPlugin * plugin)
-{
-  GST_DEBUG_CATEGORY_INIT (gst_bulge_debug, "bulge", 0, "bulge");
-
-  return gst_element_register (plugin, "bulge", GST_RANK_NONE, GST_TYPE_BULGE);
-}
index 452ae0e..dcb2e04 100644 (file)
@@ -78,7 +78,7 @@ struct _GstBulgeClass
 
 GType gst_bulge_get_type (void);
 
-gboolean gst_bulge_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (bulge);
 
 G_END_DECLS
 #endif /* __GST_BULGE_H__ */
index b326fd0..8e5f48e 100644 (file)
@@ -90,6 +90,9 @@ enum
 
 #define gst_circle_parent_class parent_class
 G_DEFINE_TYPE (GstCircle, gst_circle, GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (circle, "circle", GST_RANK_NONE,
+    GST_TYPE_CIRCLE, GST_DEBUG_CATEGORY_INIT (gst_circle_debug, "circle", 0,
+        "circle"));
 
 static void
 gst_circle_set_property (GObject * object, guint prop_id, const GValue * value,
@@ -231,12 +234,3 @@ gst_circle_init (GstCircle * filter)
   filter->spread_angle = DEFAULT_SPREAD_ANGLE;
   filter->height = DEFAULT_HEIGHT;
 }
-
-gboolean
-gst_circle_plugin_init (GstPlugin * plugin)
-{
-  GST_DEBUG_CATEGORY_INIT (gst_circle_debug, "circle", 0, "circle");
-
-  return gst_element_register (plugin, "circle", GST_RANK_NONE,
-      GST_TYPE_CIRCLE);
-}
index 7b278ca..ceeec29 100644 (file)
@@ -82,7 +82,7 @@ struct _GstCircleClass
 
 GType gst_circle_get_type (void);
 
-gboolean gst_circle_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (circle);
 
 G_END_DECLS
 
index 36e4e62..3be6241 100644 (file)
@@ -84,6 +84,9 @@ enum
 
 #define gst_diffuse_parent_class parent_class
 G_DEFINE_TYPE (GstDiffuse, gst_diffuse, GST_TYPE_GEOMETRIC_TRANSFORM);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (diffuse, "diffuse", GST_RANK_NONE,
+    GST_TYPE_DIFFUSE, GST_DEBUG_CATEGORY_INIT (gst_diffuse_debug, "diffuse", 0,
+        "diffuse"));
 
 static void
 gst_diffuse_set_property (GObject * object, guint prop_id, const GValue * value,
@@ -226,12 +229,3 @@ gst_diffuse_init (GstDiffuse * filter)
   gt->off_edge_pixels = GST_GT_OFF_EDGES_PIXELS_CLAMP;
   filter->scale = DEFAULT_SCALE;
 }
-
-gboolean
-gst_diffuse_plugin_init (GstPlugin * plugin)
-{
-  GST_DEBUG_CATEGORY_INIT (gst_diffuse_debug, "diffuse", 0, "diffuse");
-
-  return gst_element_register (plugin, "diffuse", GST_RANK_NONE,
-      GST_TYPE_DIFFUSE);
-}
index 31ee9cd..a3b6d82 100644 (file)
@@ -83,7 +83,7 @@ struct _GstDiffuseClass
 
 GType gst_diffuse_get_type (void);
 
-gboolean gst_diffuse_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (diffuse);
 
 G_END_DECLS
 
index 7150e38..8d2d0dd 100644 (file)
@@ -70,6 +70,9 @@ GST_DEBUG_CATEGORY_STATIC (gst_fisheye_debug);
 
 #define gst_fisheye_parent_class parent_class
 G_DEFINE_TYPE (GstFisheye, gst_fisheye, GST_TYPE_GEOMETRIC_TRANSFORM);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (fisheye, "fisheye", GST_RANK_NONE,
+    GST_TYPE_FISHEYE, GST_DEBUG_CATEGORY_INIT (gst_fisheye_debug, "fisheye", 0,
+        "fisheye"));
 
 static gboolean
 fisheye_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
@@ -146,12 +149,3 @@ gst_fisheye_init (GstFisheye * filter)
 
   gt->off_edge_pixels = GST_GT_OFF_EDGES_PIXELS_CLAMP;
 }
-
-gboolean
-gst_fisheye_plugin_init (GstPlugin * plugin)
-{
-  GST_DEBUG_CATEGORY_INIT (gst_fisheye_debug, "fisheye", 0, "fisheye");
-
-  return gst_element_register (plugin, "fisheye", GST_RANK_NONE,
-      GST_TYPE_FISHEYE);
-}
index d4d8cbe..41ccddb 100644 (file)
@@ -77,7 +77,7 @@ struct _GstFisheyeClass
 
 GType gst_fisheye_get_type (void);
 
-gboolean gst_fisheye_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (fisheye);
 
 G_END_DECLS
 #endif /* __GST_FISHEYE_H__ */
index 00f988f..bed2cf9 100644 (file)
@@ -90,6 +90,10 @@ enum
 #define gst_kaleidoscope_parent_class parent_class
 G_DEFINE_TYPE (GstKaleidoscope, gst_kaleidoscope,
     GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (kaleidoscope, "kaleidoscope",
+    GST_RANK_NONE, GST_TYPE_KALEIDOSCOPE,
+    GST_DEBUG_CATEGORY_INIT (gst_kaleidoscope_debug, "kaleidoscope", 0,
+        "kaleidoscope"));
 
 static void
 gst_kaleidoscope_set_property (GObject * object, guint prop_id,
@@ -238,13 +242,3 @@ gst_kaleidoscope_init (GstKaleidoscope * filter)
   filter->angle2 = DEFAULT_ANGLE2;
   filter->sides = DEFAULT_SIDES;
 }
-
-gboolean
-gst_kaleidoscope_plugin_init (GstPlugin * plugin)
-{
-  GST_DEBUG_CATEGORY_INIT (gst_kaleidoscope_debug, "kaleidoscope", 0,
-      "kaleidoscope");
-
-  return gst_element_register (plugin, "kaleidoscope", GST_RANK_NONE,
-      GST_TYPE_KALEIDOSCOPE);
-}
index bbe338c..c4fd003 100644 (file)
@@ -82,7 +82,7 @@ struct _GstKaleidoscopeClass
 
 GType gst_kaleidoscope_get_type (void);
 
-gboolean gst_kaleidoscope_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (kaleidoscope);
 
 G_END_DECLS
 
index f508d2a..2987902 100644 (file)
@@ -90,7 +90,9 @@ enum
 
 #define gst_marble_parent_class parent_class
 G_DEFINE_TYPE (GstMarble, gst_marble, GST_TYPE_GEOMETRIC_TRANSFORM);
-
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (marble, "marble", GST_RANK_NONE,
+    GST_TYPE_MARBLE, GST_DEBUG_CATEGORY_INIT (gst_marble_debug, "marble", 0,
+        "marble"));
 static void
 gst_marble_set_property (GObject * object, guint prop_id, const GValue * value,
     GParamSpec * pspec)
@@ -282,12 +284,3 @@ gst_marble_init (GstMarble * filter)
   filter->amount = DEFAULT_AMOUNT;
   filter->turbulence = DEFAULT_TURBULENCE;
 }
-
-gboolean
-gst_marble_plugin_init (GstPlugin * plugin)
-{
-  GST_DEBUG_CATEGORY_INIT (gst_marble_debug, "marble", 0, "marble");
-
-  return gst_element_register (plugin, "marble", GST_RANK_NONE,
-      GST_TYPE_MARBLE);
-}
index 2665775..61cb796 100644 (file)
@@ -88,7 +88,7 @@ struct _GstMarbleClass
 
 GType gst_marble_get_type (void);
 
-gboolean gst_marble_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (marble);
 
 G_END_DECLS
 
index e7b29c1..d59f954 100644 (file)
@@ -78,6 +78,9 @@ enum
 
 #define gst_mirror_parent_class parent_class
 G_DEFINE_TYPE (GstMirror, gst_mirror, GST_TYPE_GEOMETRIC_TRANSFORM);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (mirror, "mirror", GST_RANK_NONE,
+    GST_TYPE_MIRROR, GST_DEBUG_CATEGORY_INIT (gst_mirror_debug, "mirror", 0,
+        "mirror"));
 
 #define GST_TYPE_MIRROR_MODE (gst_mirror_mode_get_type())
 static GType
@@ -238,12 +241,3 @@ gst_mirror_init (GstMirror * filter)
   filter->mode = DEFAULT_PROP_MODE;
   gt->off_edge_pixels = GST_GT_OFF_EDGES_PIXELS_CLAMP;
 }
-
-gboolean
-gst_mirror_plugin_init (GstPlugin * plugin)
-{
-  GST_DEBUG_CATEGORY_INIT (gst_mirror_debug, "mirror", 0, "mirror");
-
-  return gst_element_register (plugin, "mirror", GST_RANK_NONE,
-      GST_TYPE_MIRROR);
-}
index 22e6aa5..f534ae5 100644 (file)
@@ -96,7 +96,7 @@ struct _GstMirrorClass
 
 GType gst_mirror_get_type (void);
 
-gboolean gst_mirror_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (mirror);
 
 G_END_DECLS
 #endif /* __GST_MIRROR_H__ */
index e4da32f..3b7da18 100644 (file)
@@ -88,6 +88,10 @@ enum
 
 #define gst_perspective_parent_class parent_class
 G_DEFINE_TYPE (GstPerspective, gst_perspective, GST_TYPE_GEOMETRIC_TRANSFORM);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (perspective, "perspective",
+    GST_RANK_NONE, GST_TYPE_PERSPECTIVE,
+    GST_DEBUG_CATEGORY_INIT (gst_perspective_debug, "perspective", 0,
+        "perspective"));
 
 static GValueArray *
 get_array_from_matrix (GstPerspective * self)
@@ -255,13 +259,3 @@ gst_perspective_init (GstPerspective * filter)
   filter->matrix[7] = 0;
   filter->matrix[8] = 1;
 }
-
-gboolean
-gst_perspective_plugin_init (GstPlugin * plugin)
-{
-  GST_DEBUG_CATEGORY_INIT (gst_perspective_debug, "perspective", 0,
-      "perspective");
-
-  return gst_element_register (plugin, "perspective", GST_RANK_NONE,
-      GST_TYPE_PERSPECTIVE);
-}
index 03393b7..db70723 100644 (file)
@@ -81,7 +81,7 @@ struct _GstPerspectiveClass
 
 GType gst_perspective_get_type (void);
 
-gboolean gst_perspective_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (perspective);
 
 G_END_DECLS
 
index 798b965..ffc9b2a 100644 (file)
@@ -83,6 +83,9 @@ enum
 
 #define gst_pinch_parent_class parent_class
 G_DEFINE_TYPE (GstPinch, gst_pinch, GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (pinch, "pinch", GST_RANK_NONE,
+    GST_TYPE_PINCH, GST_DEBUG_CATEGORY_INIT (gst_pinch_debug, "pinch", 0,
+        "pinch"));
 
 static void
 gst_pinch_set_property (GObject * object, guint prop_id, const GValue * value,
@@ -207,11 +210,3 @@ gst_pinch_init (GstPinch * filter)
   gt->off_edge_pixels = GST_GT_OFF_EDGES_PIXELS_CLAMP;
   filter->intensity = DEFAULT_INTENSITY;
 }
-
-gboolean
-gst_pinch_plugin_init (GstPlugin * plugin)
-{
-  GST_DEBUG_CATEGORY_INIT (gst_pinch_debug, "pinch", 0, "pinch");
-
-  return gst_element_register (plugin, "pinch", GST_RANK_NONE, GST_TYPE_PINCH);
-}
index 896a6d6..70d0c75 100644 (file)
@@ -80,7 +80,7 @@ struct _GstPinchClass
 
 GType gst_pinch_get_type (void);
 
-gboolean gst_pinch_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (pinch);
 
 G_END_DECLS
 
index d6f6515..0047e2c 100644 (file)
@@ -84,6 +84,9 @@ enum
 
 #define gst_rotate_parent_class parent_class
 G_DEFINE_TYPE (GstRotate, gst_rotate, GST_TYPE_GEOMETRIC_TRANSFORM);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (rotate, "rotate", GST_RANK_NONE,
+    GST_TYPE_ROTATE, GST_DEBUG_CATEGORY_INIT (gst_rotate_debug, "rotate", 0,
+        "rotate"));
 
 static void
 gst_rotate_set_property (GObject * object, guint prop_id, const GValue * value,
@@ -212,12 +215,3 @@ gst_rotate_init (GstRotate * filter)
 {
   filter->angle = DEFAULT_ANGLE;
 }
-
-gboolean
-gst_rotate_plugin_init (GstPlugin * plugin)
-{
-  GST_DEBUG_CATEGORY_INIT (gst_rotate_debug, "rotate", 0, "rotate");
-
-  return gst_element_register (plugin, "rotate", GST_RANK_NONE,
-      GST_TYPE_ROTATE);
-}
index ce19d49..d67d091 100644 (file)
@@ -80,7 +80,7 @@ struct _GstRotateClass
 
 GType gst_rotate_get_type (void);
 
-gboolean gst_rotate_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (rotate);
 
 G_END_DECLS
 
index 90947a8..37aae47 100644 (file)
@@ -83,6 +83,9 @@ enum
 
 #define gst_sphere_parent_class parent_class
 G_DEFINE_TYPE (GstSphere, gst_sphere, GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (sphere, "sphere", GST_RANK_NONE,
+    GST_TYPE_SPHERE, GST_DEBUG_CATEGORY_INIT (gst_sphere_debug, "sphere", 0,
+        "sphere"));
 
 static void
 gst_sphere_set_property (GObject * object, guint prop_id, const GValue * value,
@@ -219,12 +222,3 @@ gst_sphere_init (GstSphere * filter)
   gt->off_edge_pixels = GST_GT_OFF_EDGES_PIXELS_CLAMP;
   filter->refraction = DEFAULT_REFRACTION;
 }
-
-gboolean
-gst_sphere_plugin_init (GstPlugin * plugin)
-{
-  GST_DEBUG_CATEGORY_INIT (gst_sphere_debug, "sphere", 0, "sphere");
-
-  return gst_element_register (plugin, "sphere", GST_RANK_NONE,
-      GST_TYPE_SPHERE);
-}
index e8028de..6e09e39 100644 (file)
@@ -80,7 +80,7 @@ struct _GstSphereClass
 
 GType gst_sphere_get_type (void);
 
-gboolean gst_sphere_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (sphere);
 
 G_END_DECLS
 
index 14271bd..b276499 100644 (file)
@@ -81,6 +81,9 @@ enum
 
 #define gst_square_parent_class parent_class
 G_DEFINE_TYPE (GstSquare, gst_square, GST_TYPE_GEOMETRIC_TRANSFORM);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (square, "square", GST_RANK_NONE,
+    GST_TYPE_SQUARE, GST_DEBUG_CATEGORY_INIT (gst_square_debug, "square", 0,
+        "square"));
 
 /* GObject vmethod implementations */
 
@@ -237,12 +240,3 @@ gst_square_init (GstSquare * filter)
   filter->zoom = DEFAULT_ZOOM;
   gt->off_edge_pixels = GST_GT_OFF_EDGES_PIXELS_CLAMP;
 }
-
-gboolean
-gst_square_plugin_init (GstPlugin * plugin)
-{
-  GST_DEBUG_CATEGORY_INIT (gst_square_debug, "square", 0, "square");
-
-  return gst_element_register (plugin, "square", GST_RANK_NONE,
-      GST_TYPE_SQUARE);
-}
index 62cf173..99d5f52 100644 (file)
@@ -80,7 +80,7 @@ struct _GstSquareClass
 
 GType gst_square_get_type (void);
 
-gboolean gst_square_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (square);
 
 G_END_DECLS
 #endif /* __GST_SQUARE_H__ */
index 77086f0..5fe390f 100644 (file)
@@ -79,6 +79,9 @@ enum
 
 #define gst_stretch_parent_class parent_class
 G_DEFINE_TYPE (GstStretch, gst_stretch, GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (stretch, "stretch", GST_RANK_NONE,
+    GST_TYPE_STRETCH, GST_DEBUG_CATEGORY_INIT (gst_stretch_debug, "stretch", 0,
+        "stretch"));
 
 static void
 gst_stretch_set_property (GObject * object, guint prop_id, const GValue * value,
@@ -209,12 +212,3 @@ gst_stretch_init (GstStretch * filter)
   filter->intensity = DEFAULT_INTENSITY;
   gt->off_edge_pixels = GST_GT_OFF_EDGES_PIXELS_CLAMP;
 }
-
-gboolean
-gst_stretch_plugin_init (GstPlugin * plugin)
-{
-  GST_DEBUG_CATEGORY_INIT (gst_stretch_debug, "stretch", 0, "stretch");
-
-  return gst_element_register (plugin, "stretch", GST_RANK_NONE,
-      GST_TYPE_STRETCH);
-}
index 3f0e9b9..92e46b7 100644 (file)
@@ -78,7 +78,7 @@ struct _GstStretchClass
 
 GType gst_stretch_get_type (void);
 
-gboolean gst_stretch_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (stretch);
 
 G_END_DECLS
 #endif /* __GST_STRETCH_H__ */
index 2dd9c41..b659c5d 100644 (file)
@@ -71,6 +71,9 @@ GST_DEBUG_CATEGORY_STATIC (gst_tunnel_debug);
 
 #define gst_tunnel_parent_class parent_class
 G_DEFINE_TYPE (GstTunnel, gst_tunnel, GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (tunnel, "tunnel", GST_RANK_NONE,
+    GST_TYPE_TUNNEL, GST_DEBUG_CATEGORY_INIT (gst_tunnel_debug, "tunnel", 0,
+        "tunnel"));
 
 static gboolean
 tunnel_map (GstGeometricTransform * gt, gint x, gint y, gdouble * in_x,
@@ -135,12 +138,3 @@ gst_tunnel_init (GstTunnel * filter)
 
   gt->off_edge_pixels = GST_GT_OFF_EDGES_PIXELS_CLAMP;
 }
-
-gboolean
-gst_tunnel_plugin_init (GstPlugin * plugin)
-{
-  GST_DEBUG_CATEGORY_INIT (gst_tunnel_debug, "tunnel", 0, "tunnel");
-
-  return gst_element_register (plugin, "tunnel", GST_RANK_NONE,
-      GST_TYPE_TUNNEL);
-}
index 28db3af..a37755d 100644 (file)
@@ -76,7 +76,7 @@ struct _GstTunnelClass
 
 GType gst_tunnel_get_type (void);
 
-gboolean gst_tunnel_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (tunnel);
 
 G_END_DECLS
 #endif /* __GST_TUNNEL_H__ */
index 54ec46b..f1d94cb 100644 (file)
@@ -83,6 +83,9 @@ enum
 
 #define gst_twirl_parent_class parent_class
 G_DEFINE_TYPE (GstTwirl, gst_twirl, GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (twirl, "twirl", GST_RANK_NONE,
+    GST_TYPE_TWIRL, GST_DEBUG_CATEGORY_INIT (gst_twirl_debug, "twirl", 0,
+        "twirl"));
 
 static void
 gst_twirl_set_property (GObject * object, guint prop_id, const GValue * value,
@@ -198,11 +201,3 @@ gst_twirl_init (GstTwirl * filter)
   gt->off_edge_pixels = GST_GT_OFF_EDGES_PIXELS_CLAMP;
   filter->angle = DEFAULT_ANGLE;
 }
-
-gboolean
-gst_twirl_plugin_init (GstPlugin * plugin)
-{
-  GST_DEBUG_CATEGORY_INIT (gst_twirl_debug, "twirl", 0, "twirl");
-
-  return gst_element_register (plugin, "twirl", GST_RANK_NONE, GST_TYPE_TWIRL);
-}
index 9143894..c6abac7 100644 (file)
@@ -80,7 +80,7 @@ struct _GstTwirlClass
 
 GType gst_twirl_get_type (void);
 
-gboolean gst_twirl_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (twirl);
 
 G_END_DECLS
 
index 2d39df9..6524377 100644 (file)
@@ -88,6 +88,10 @@ enum
 #define gst_water_ripple_parent_class parent_class
 G_DEFINE_TYPE (GstWaterRipple, gst_water_ripple,
     GST_TYPE_CIRCLE_GEOMETRIC_TRANSFORM);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (waterripple, "waterripple",
+    GST_RANK_NONE, GST_TYPE_WATER_RIPPLE,
+    GST_DEBUG_CATEGORY_INIT (gst_water_ripple_debug, "waterripple", 0,
+        "waterripple"));
 
 static void
 gst_water_ripple_set_property (GObject * object, guint prop_id,
@@ -236,13 +240,3 @@ gst_water_ripple_init (GstWaterRipple * filter)
   filter->phase = DEFAULT_PHASE;
   filter->wavelength = DEFAULT_WAVELENGTH;
 }
-
-gboolean
-gst_water_ripple_plugin_init (GstPlugin * plugin)
-{
-  GST_DEBUG_CATEGORY_INIT (gst_water_ripple_debug, "waterripple", 0,
-      "waterripple");
-
-  return gst_element_register (plugin, "waterripple", GST_RANK_NONE,
-      GST_TYPE_WATER_RIPPLE);
-}
index a2680b5..2dadeb1 100644 (file)
@@ -82,7 +82,7 @@ struct _GstWaterRippleClass
 
 GType gst_water_ripple_get_type (void);
 
-gboolean gst_water_ripple_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (waterripple);
 
 G_END_DECLS
 
index 9622ebb..d353b2a 100644 (file)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  if (!gst_circle_plugin_init (plugin))
-    return FALSE;
-
-  if (!gst_diffuse_plugin_init (plugin))
-    return FALSE;
-
-  if (!gst_kaleidoscope_plugin_init (plugin))
-    return FALSE;
-
-  if (!gst_marble_plugin_init (plugin))
-    return FALSE;
-
-  if (!gst_pinch_plugin_init (plugin))
-    return FALSE;
-
-  if (!gst_rotate_plugin_init (plugin))
-    return FALSE;
-
-  if (!gst_sphere_plugin_init (plugin))
-    return FALSE;
-
-  if (!gst_twirl_plugin_init (plugin))
-    return FALSE;
-
-  if (!gst_water_ripple_plugin_init (plugin))
-    return FALSE;
-
-  if (!gst_stretch_plugin_init (plugin))
-    return FALSE;
-
-  if (!gst_bulge_plugin_init (plugin))
-    return FALSE;
-
-  if (!gst_tunnel_plugin_init (plugin))
-    return FALSE;
-
-  if (!gst_square_plugin_init (plugin))
-    return FALSE;
-
-  if (!gst_mirror_plugin_init (plugin))
-    return FALSE;
-
-  if (!gst_fisheye_plugin_init (plugin))
-    return FALSE;
-
-  if (!gst_perspective_plugin_init (plugin))
-    return FALSE;
-
-  return TRUE;
+  gboolean ret = FALSE;
+
+  ret |= GST_ELEMENT_REGISTER (circle, plugin);
+  ret |= GST_ELEMENT_REGISTER (diffuse, plugin);
+  ret |= GST_ELEMENT_REGISTER (kaleidoscope, plugin);
+  ret |= GST_ELEMENT_REGISTER (marble, plugin);
+  ret |= GST_ELEMENT_REGISTER (pinch, plugin);
+  ret |= GST_ELEMENT_REGISTER (rotate, plugin);
+  ret |= GST_ELEMENT_REGISTER (sphere, plugin);
+  ret |= GST_ELEMENT_REGISTER (twirl, plugin);
+  ret |= GST_ELEMENT_REGISTER (waterripple, plugin);
+  ret |= GST_ELEMENT_REGISTER (stretch, plugin);
+  ret |= GST_ELEMENT_REGISTER (bulge, plugin);
+  ret |= GST_ELEMENT_REGISTER (tunnel, plugin);
+  ret |= GST_ELEMENT_REGISTER (square, plugin);
+  ret |= GST_ELEMENT_REGISTER (mirror, plugin);
+  ret |= GST_ELEMENT_REGISTER (fisheye, plugin);
+  ret |= GST_ELEMENT_REGISTER (perspective, plugin);
+
+  return ret;
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index ccb23f9..c5b10c4 100644 (file)
@@ -81,7 +81,12 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
     GST_PAD_ALWAYS,
     GST_STATIC_CAPS ("application/x-id3"));
 
-G_DEFINE_TYPE (GstId3Mux, gst_id3_mux, GST_TYPE_TAG_MUX);
+G_DEFINE_TYPE_WITH_CODE (GstId3Mux, gst_id3_mux, GST_TYPE_TAG_MUX,
+    GST_DEBUG_CATEGORY_INIT (gst_id3_mux_debug, "id3mux", 0,
+        "ID3 v1 and v2 tag muxer");
+    );
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (id3mux, "id3mux", GST_RANK_PRIMARY,
+    GST_TYPE_ID3_MUX, gst_tag_register_musicbrainz_tags ());
 
 static GstBuffer *gst_id3_mux_render_v2_tag (GstTagMux * mux,
     const GstTagList * taglist);
@@ -211,16 +216,7 @@ gst_id3_mux_render_v1_tag (GstTagMux * mux, const GstTagList * taglist)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  GST_DEBUG_CATEGORY_INIT (gst_id3_mux_debug, "id3mux", 0,
-      "ID3 v1 and v2 tag muxer");
-
-  if (!gst_element_register (plugin, "id3mux", GST_RANK_PRIMARY,
-          GST_TYPE_ID3_MUX))
-    return FALSE;
-
-  gst_tag_register_musicbrainz_tags ();
-
-  return TRUE;
+  return GST_ELEMENT_REGISTER (id3mux, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 69a2e0f..5017c69 100644 (file)
@@ -56,7 +56,7 @@ struct _GstId3MuxClass {
   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ID3_MUX))
 
 GType gst_id3_mux_get_type (void);
-
+GST_ELEMENT_REGISTER_DECLARE (id3mux);
 G_END_DECLS
 
 #endif /* GST_ID3_MUX_H */
index e1f88b2..b71b5de 100644 (file)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gst_element_register (plugin, "interaudiosrc", GST_RANK_NONE,
-      GST_TYPE_INTER_AUDIO_SRC);
-  gst_element_register (plugin, "interaudiosink", GST_RANK_NONE,
-      GST_TYPE_INTER_AUDIO_SINK);
-  gst_element_register (plugin, "intersubsrc", GST_RANK_NONE,
-      GST_TYPE_INTER_SUB_SRC);
-  gst_element_register (plugin, "intersubsink", GST_RANK_NONE,
-      GST_TYPE_INTER_SUB_SINK);
-  gst_element_register (plugin, "intervideosrc", GST_RANK_NONE,
-      GST_TYPE_INTER_VIDEO_SRC);
-  gst_element_register (plugin, "intervideosink", GST_RANK_NONE,
-      GST_TYPE_INTER_VIDEO_SINK);
+  gboolean ret = FALSE;
 
-  return TRUE;
+  ret |= GST_ELEMENT_REGISTER (interaudiosrc, plugin);
+  ret |= GST_ELEMENT_REGISTER (interaudiosink, plugin);
+  ret |= GST_ELEMENT_REGISTER (intersubsrc, plugin);
+  ret |= GST_ELEMENT_REGISTER (intersubsink, plugin);
+  ret |= GST_ELEMENT_REGISTER (intervideosrc, plugin);
+  ret |= GST_ELEMENT_REGISTER (intervideosink, plugin);
+
+  return ret;
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index eaa5b2e..a33fe81 100644 (file)
@@ -89,6 +89,8 @@ GST_STATIC_PAD_TEMPLATE ("sink",
 /* class initialization */
 #define parent_class gst_inter_audio_sink_parent_class
 G_DEFINE_TYPE (GstInterAudioSink, gst_inter_audio_sink, GST_TYPE_BASE_SINK);
+GST_ELEMENT_REGISTER_DEFINE (interaudiosink, "interaudiosink",
+    GST_RANK_NONE, GST_TYPE_INTER_AUDIO_SINK);
 
 static void
 gst_inter_audio_sink_class_init (GstInterAudioSinkClass * klass)
index 8f8c9a2..c6e3482 100644 (file)
@@ -51,6 +51,7 @@ struct _GstInterAudioSinkClass
 };
 
 GType gst_inter_audio_sink_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (interaudiosink);
 
 G_END_DECLS
 
index 3190955..f516a58 100644 (file)
@@ -95,6 +95,8 @@ GST_STATIC_PAD_TEMPLATE ("src",
 /* class initialization */
 #define parent_class gst_inter_audio_src_parent_class
 G_DEFINE_TYPE (GstInterAudioSrc, gst_inter_audio_src, GST_TYPE_BASE_SRC);
+GST_ELEMENT_REGISTER_DEFINE (interaudiosrc, "interaudiosrc",
+    GST_RANK_NONE, GST_TYPE_INTER_AUDIO_SRC);
 
 static void
 gst_inter_audio_src_class_init (GstInterAudioSrcClass * klass)
index 131b2af..e00b406 100644 (file)
@@ -54,7 +54,7 @@ struct _GstInterAudioSrcClass
 };
 
 GType gst_inter_audio_src_get_type (void);
-
+GST_ELEMENT_REGISTER_DECLARE (interaudiosrc);
 G_END_DECLS
 
 #endif
index 882a166..d62f7ce 100644 (file)
@@ -80,6 +80,8 @@ GST_STATIC_PAD_TEMPLATE ("sink",
 /* class initialization */
 #define parent_class gst_inter_sub_sink_parent_class
 G_DEFINE_TYPE (GstInterSubSink, gst_inter_sub_sink, GST_TYPE_BASE_SINK);
+GST_ELEMENT_REGISTER_DEFINE (intersubsink, "intersubsink", GST_RANK_NONE,
+    GST_TYPE_INTER_SUB_SINK);
 
 static void
 gst_inter_sub_sink_class_init (GstInterSubSinkClass * klass)
index 0a53798..81b45a9 100644 (file)
@@ -52,6 +52,7 @@ struct _GstInterSubSinkClass
 };
 
 GType gst_inter_sub_sink_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (intersubsink);
 
 G_END_DECLS
 
index dc42cae..801a962 100644 (file)
@@ -82,6 +82,8 @@ GST_STATIC_PAD_TEMPLATE ("src",
 /* class initialization */
 #define parent_class gst_inter_sub_src_parent_class
 G_DEFINE_TYPE (GstInterSubSrc, gst_inter_sub_src, GST_TYPE_BASE_SRC);
+GST_ELEMENT_REGISTER_DEFINE (intersubsrc, "intersubsrc", GST_RANK_NONE,
+    GST_TYPE_INTER_SUB_SRC);
 
 static void
 gst_inter_sub_src_class_init (GstInterSubSrcClass * klass)
index a9d757e..3c62258 100644 (file)
@@ -51,6 +51,7 @@ struct _GstInterSubSrcClass
 };
 
 GType gst_inter_sub_src_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (intersubsrc);
 
 G_END_DECLS
 
index 12a971a..d3dd3bd 100644 (file)
@@ -82,6 +82,8 @@ GST_STATIC_PAD_TEMPLATE ("sink",
 
 /* class initialization */
 G_DEFINE_TYPE (GstInterVideoSink, gst_inter_video_sink, GST_TYPE_VIDEO_SINK);
+GST_ELEMENT_REGISTER_DEFINE (intervideosink, "intervideosink",
+    GST_RANK_NONE, GST_TYPE_INTER_VIDEO_SINK);
 
 static void
 gst_inter_video_sink_class_init (GstInterVideoSinkClass * klass)
index 096cee2..5b2d280 100644 (file)
@@ -50,6 +50,7 @@ struct _GstInterVideoSinkClass
 };
 
 GType gst_inter_video_sink_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (intervideosink);
 
 G_END_DECLS
 
index 9e607f3..4a4e07d 100644 (file)
@@ -89,6 +89,8 @@ GST_STATIC_PAD_TEMPLATE ("src",
 /* class initialization */
 #define parent_class gst_inter_video_src_parent_class
 G_DEFINE_TYPE (GstInterVideoSrc, gst_inter_video_src, GST_TYPE_BASE_SRC);
+GST_ELEMENT_REGISTER_DEFINE (intervideosrc, "intervideosrc",
+    GST_RANK_NONE, GST_TYPE_INTER_VIDEO_SRC);
 
 static void
 gst_inter_video_src_class_init (GstInterVideoSrcClass * klass)
index 0de36f4..89ef344 100644 (file)
@@ -56,6 +56,7 @@ struct _GstInterVideoSrcClass
 };
 
 GType gst_inter_video_src_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (intervideosrc);
 
 G_END_DECLS
 
index ac109af..5c7fc7e 100644 (file)
@@ -247,9 +247,13 @@ static GstStateChangeReturn gst_interlace_change_state (GstElement * element,
 static GstCaps *gst_interlace_caps_double_framerate (GstCaps * caps,
     gboolean half, gboolean skip_progressive);
 
+GST_ELEMENT_REGISTER_DECLARE (interlace);
+
 #define gst_interlace_parent_class parent_class
 G_DEFINE_TYPE (GstInterlace, gst_interlace, GST_TYPE_ELEMENT);
-
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (interlace, "interlace", GST_RANK_NONE,
+    GST_TYPE_INTERLACE, GST_DEBUG_CATEGORY_INIT (gst_interlace_debug,
+        "interlace", 0, "interlace element"));
 static void
 gst_interlace_class_init (GstInterlaceClass * klass)
 {
@@ -1492,11 +1496,7 @@ gst_interlace_change_state (GstElement * element, GstStateChange transition)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  GST_DEBUG_CATEGORY_INIT (gst_interlace_debug, "interlace", 0,
-      "interlace element");
-
-  return gst_element_register (plugin, "interlace", GST_RANK_NONE,
-      GST_TYPE_INTERLACE);
+  return GST_ELEMENT_REGISTER (interlace, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 34675de..35c0bd5 100644 (file)
@@ -72,6 +72,8 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
 
 #define gst_ivf_parse_parent_class parent_class
 G_DEFINE_TYPE (GstIvfParse, gst_ivf_parse, GST_TYPE_BASE_PARSE);
+GST_ELEMENT_REGISTER_DEFINE (ivfparse, "ivfparse", GST_RANK_PRIMARY,
+    GST_TYPE_IVF_PARSE);
 
 static void gst_ivf_parse_finalize (GObject * object);
 static gboolean gst_ivf_parse_start (GstBaseParse * parse);
@@ -397,14 +399,9 @@ gst_ivf_parse_handle_frame (GstBaseParse * parse,
 
 /* entry point to initialize the plug-in */
 static gboolean
-ivfparse_init (GstPlugin * ivfparse)
+ivfparse_init (GstPlugin * plugin)
 {
-  /* register parser element */
-  if (!gst_element_register (ivfparse, "ivfparse", GST_RANK_PRIMARY,
-          GST_TYPE_IVF_PARSE))
-    return FALSE;
-
-  return TRUE;
+  return GST_ELEMENT_REGISTER (ivfparse, plugin);
 }
 
 /* gstreamer looks for this structure to register plugins */
index 1a72f35..b37a0f8 100644 (file)
@@ -66,6 +66,7 @@ struct _GstIvfParseClass
 };
 
 GType gst_ivf_parse_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (ivfparse);
 
 G_END_DECLS
 
index 87b3f73..2d29fba 100644 (file)
@@ -93,6 +93,8 @@ GST_STATIC_PAD_TEMPLATE ("src",
 G_DEFINE_TYPE_WITH_CODE (GstCombDetect, gst_comb_detect, GST_TYPE_VIDEO_FILTER,
     GST_DEBUG_CATEGORY_INIT (gst_comb_detect_debug_category, "combdetect", 0,
         "debug category for combdetect element"));
+GST_ELEMENT_REGISTER_DEFINE (combdetect, "combdetect", GST_RANK_NONE,
+    GST_TYPE_COMB_DETECT);
 
 static void
 gst_comb_detect_class_init (GstCombDetectClass * klass)
index 9b10989..cd59f60 100644 (file)
@@ -48,6 +48,8 @@ struct _GstCombDetectClass
 
 GType gst_comb_detect_get_type (void);
 
+GST_ELEMENT_REGISTER_DECLARE (combdetect);
+
 G_END_DECLS
 
 #endif
index 2556eed..c35481e 100644 (file)
@@ -110,6 +110,7 @@ GST_STATIC_PAD_TEMPLATE ("src",
 G_DEFINE_TYPE_WITH_CODE (GstIvtc, gst_ivtc, GST_TYPE_BASE_TRANSFORM,
     GST_DEBUG_CATEGORY_INIT (gst_ivtc_debug_category, "ivtc", 0,
         "debug category for ivtc element"));
+GST_ELEMENT_REGISTER_DEFINE (ivtc, "ivtc", GST_RANK_NONE, GST_TYPE_IVTC);
 
 static void
 gst_ivtc_class_init (GstIvtcClass * klass)
@@ -681,9 +682,8 @@ get_comb_score (GstVideoFrame * top, GstVideoFrame * bottom)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gst_element_register (plugin, "ivtc", GST_RANK_NONE, GST_TYPE_IVTC);
-  gst_element_register (plugin, "combdetect", GST_RANK_NONE,
-      GST_TYPE_COMB_DETECT);
+  GST_ELEMENT_REGISTER (ivtc, plugin);
+  GST_ELEMENT_REGISTER (combdetect, plugin);
 
   return TRUE;
 }
index bf70760..879a259 100644 (file)
@@ -25,6 +25,8 @@
 
 G_BEGIN_DECLS
 
+GST_ELEMENT_REGISTER_DECLARE (ivtc);
+
 #define GST_TYPE_IVTC   (gst_ivtc_get_type())
 #define GST_IVTC(obj)   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_IVTC,GstIvtc))
 #define GST_IVTC_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_IVTC,GstIvtcClass))
index 3688381..532864e 100644 (file)
@@ -79,7 +79,10 @@ GST_DEBUG_CATEGORY (gst_jp2k_decimator_debug);
 #define GST_CAT_DEFAULT gst_jp2k_decimator_debug
 
 G_DEFINE_TYPE (GstJP2kDecimator, gst_jp2k_decimator, GST_TYPE_ELEMENT);
-
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (jp2kdecimator, "jp2kdecimator",
+    GST_RANK_NONE, GST_TYPE_JP2K_DECIMATOR,
+    GST_DEBUG_CATEGORY_INIT (gst_jp2k_decimator_debug, "jp2kdecimator", 0,
+        "JPEG2000 decimator"));
 static void
 gst_jp2k_decimator_class_init (GstJP2kDecimatorClass * klass)
 {
@@ -258,13 +261,7 @@ gst_jp2k_decimator_sink_chain (GstPad * pad, GstObject * parent,
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  GST_DEBUG_CATEGORY_INIT (gst_jp2k_decimator_debug, "jp2kdecimator", 0,
-      "JPEG2000 decimator");
-
-  gst_element_register (plugin, "jp2kdecimator", GST_RANK_NONE,
-      GST_TYPE_JP2K_DECIMATOR);
-
-  return TRUE;
+  return GST_ELEMENT_REGISTER (jp2kdecimator, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index f5f3458..7f5a1a9 100644 (file)
@@ -51,6 +51,7 @@ struct _GstJP2kDecimatorClass
 };
 
 GType gst_jp2k_decimator_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (jp2kdecimator);
 
 G_END_DECLS
 
index e958f54..79241bb 100644 (file)
@@ -110,6 +110,8 @@ static GstStateChangeReturn gst_jif_mux_change_state (GstElement * element,
 G_DEFINE_TYPE_WITH_CODE (GstJifMux, gst_jif_mux, GST_TYPE_ELEMENT,
     G_IMPLEMENT_INTERFACE (GST_TYPE_TAG_SETTER, NULL);
     G_IMPLEMENT_INTERFACE (GST_TYPE_TAG_XMP_WRITER, NULL));
+GST_ELEMENT_REGISTER_DEFINE (jifmux, "jifmux", GST_RANK_SECONDARY,
+    GST_TYPE_JIF_MUX);
 
 static void
 gst_jif_mux_class_init (GstJifMuxClass * klass)
index 400e64c..96830bb 100644 (file)
@@ -61,6 +61,8 @@ struct _GstJifMuxClass {
 
 GType gst_jif_mux_get_type (void);
 
+GST_ELEMENT_REGISTER_DECLARE (jifmux);
+
 G_END_DECLS
 
 #endif /* __GST_JFIF_MUX_H__ */
index b410466..bc37045 100644 (file)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  if (!gst_element_register (plugin, "jpegparse", GST_RANK_NONE,
-          GST_TYPE_JPEG_PARSE))
-    return FALSE;
-  if (!gst_element_register (plugin, "jifmux", GST_RANK_SECONDARY,
-          GST_TYPE_JIF_MUX))
-    return FALSE;
+  gboolean ret = FALSE;
 
-  return TRUE;
+  ret |= GST_ELEMENT_REGISTER (jpegparse, plugin);
+  ret |= GST_ELEMENT_REGISTER (jifmux, plugin);
+
+  return ret;
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 244b5a2..f08986f 100644 (file)
@@ -89,6 +89,8 @@ static GstFlowReturn gst_jpeg_parse_pre_push_frame (GstBaseParse * bparse,
 
 #define gst_jpeg_parse_parent_class parent_class
 G_DEFINE_TYPE (GstJpegParse, gst_jpeg_parse, GST_TYPE_BASE_PARSE);
+GST_ELEMENT_REGISTER_DEFINE (jpegparse, "jpegparse", GST_RANK_NONE,
+    GST_TYPE_JPEG_PARSE);
 
 static void
 gst_jpeg_parse_class_init (GstJpegParseClass * klass)
index f809fa3..e777421 100644 (file)
@@ -87,6 +87,8 @@ struct _GstJpegParseClass {
 
 GType gst_jpeg_parse_get_type (void);
 
+GST_ELEMENT_REGISTER_DECLARE (jpegparse);
+
 G_END_DECLS
 
 #endif /* __GST_JPEG_PARSE_H__ */
index 194ee07..cadfda3 100644 (file)
@@ -82,6 +82,7 @@ static GstFlowReturn gst_rfb_src_fill (GstPushSrc * psrc, GstBuffer * outbuf);
 
 #define gst_rfb_src_parent_class parent_class
 G_DEFINE_TYPE (GstRfbSrc, gst_rfb_src, GST_TYPE_PUSH_SRC);
+GST_ELEMENT_REGISTER_DEFINE (rfbsrc, "rfbsrc", GST_RANK_NONE, GST_TYPE_RFB_SRC);
 
 static void
 gst_rfb_src_class_init (GstRfbSrcClass * klass)
@@ -632,8 +633,7 @@ gst_rfb_src_unlock (GstBaseSrc * bsrc)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  return gst_element_register (plugin, "rfbsrc", GST_RANK_NONE,
-      GST_TYPE_RFB_SRC);
+  return GST_ELEMENT_REGISTER (rfbsrc, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 81ebd45..e106549 100644 (file)
@@ -68,6 +68,7 @@ struct _GstRfbSrc
 };
 
 GType gst_rfb_src_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (rfbsrc);
 
 G_END_DECLS
 #endif
index 6171359..01e9b6d 100644 (file)
 
 #include "midiparse.h"
 
-GST_DEBUG_CATEGORY_STATIC (midi_debug);
-#define GST_CAT_DEFAULT (midi_debug)
-
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gboolean ret;
-
-  GST_DEBUG_CATEGORY_INIT (midi_debug, "midi", 0, "MIDI plugin");
-
 #ifdef ENABLE_NLS
   GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
       LOCALEDIR);
@@ -45,10 +38,7 @@ plugin_init (GstPlugin * plugin)
   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 #endif
 
-  ret = gst_element_register (plugin, "midiparse", GST_RANK_PRIMARY,
-      GST_TYPE_MIDI_PARSE);
-
-  return ret;
+  return GST_ELEMENT_REGISTER (midiparse, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index dc3c078..1189310 100644 (file)
@@ -118,6 +118,8 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
 
 #define parent_class gst_midi_parse_parent_class
 G_DEFINE_TYPE (GstMidiParse, gst_midi_parse, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE (midiparse, "midiparse", GST_RANK_PRIMARY,
+    GST_TYPE_MIDI_PARSE);
 
 /* initialize the plugin's class */
 static void
index 5794c37..05b627a 100644 (file)
@@ -87,6 +87,7 @@ struct _GstMidiParseClass
 };
 
 GType gst_midi_parse_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (midiparse);
 
 G_END_DECLS
 
index c0de469..bfbe0d9 100644 (file)
@@ -81,6 +81,8 @@ typedef enum
 GST_DEBUG_CATEGORY_STATIC (gstflupsdemux_debug);
 #define GST_CAT_DEFAULT (gstflupsdemux_debug)
 
+GST_DEBUG_CATEGORY_EXTERN (mpegpspesfilter_debug);
+
 /* MPEG2Demux signals and args */
 enum
 {
@@ -218,6 +220,11 @@ gst_ps_demux_get_type (void)
   return ps_demux_type;
 }
 
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (mpegpsdemux, "mpegpsdemux",
+    GST_RANK_PRIMARY, GST_TYPE_PS_DEMUX,
+    GST_DEBUG_CATEGORY_INIT (mpegpspesfilter_debug, "mpegpspesfilter", 0,
+        "MPEG-PS PES filter"));
+
 static void
 gst_ps_demux_base_init (GstPsDemuxClass * klass)
 {
index d43d42a..d11f8c2 100644 (file)
@@ -173,6 +173,7 @@ struct _GstPsDemuxClass
 };
 
 GType gst_ps_demux_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (mpegpsdemux);
 
 G_END_DECLS
 #endif /* __GST_PS_DEMUX_H__ */
index 4d0bca2..0ad2548 100644 (file)
 
 #include "gstmpegdemux.h"
 
-GST_DEBUG_CATEGORY_EXTERN (mpegpspesfilter_debug);
-
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  GST_DEBUG_CATEGORY_INIT (mpegpspesfilter_debug, "mpegpspesfilter", 0,
-      "MPEG-PS PES filter");
-
-  if (!gst_element_register (plugin, "mpegpsdemux", GST_RANK_PRIMARY,
-          GST_TYPE_PS_DEMUX))
-    return FALSE;
-
-  return TRUE;
+  return GST_ELEMENT_REGISTER (mpegpsdemux, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index c7e4cc2..50c6c70 100644 (file)
@@ -108,7 +108,9 @@ static GstStateChangeReturn mpegpsmux_change_state (GstElement * element,
 
 #define parent_class mpegpsmux_parent_class
 G_DEFINE_TYPE (MpegPsMux, mpegpsmux, GST_TYPE_ELEMENT);
-
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (mpegpsmux, "mpegpsmux", GST_RANK_PRIMARY,
+    mpegpsmux_get_type (), GST_DEBUG_CATEGORY_INIT (mpegpsmux_debug,
+        "mpegpsmux", 0, "MPEG Program Stream muxer"));
 static void
 mpegpsmux_class_init (MpegPsMuxClass * klass)
 {
@@ -774,14 +776,7 @@ mpegpsmux_change_state (GstElement * element, GstStateChange transition)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  if (!gst_element_register (plugin, "mpegpsmux", GST_RANK_PRIMARY,
-          mpegpsmux_get_type ()))
-    return FALSE;
-
-  GST_DEBUG_CATEGORY_INIT (mpegpsmux_debug, "mpegpsmux", 0,
-      "MPEG Program Stream muxer");
-
-  return TRUE;
+  return GST_ELEMENT_REGISTER (mpegpsmux, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR,
index c04edf4..e469267 100644 (file)
@@ -113,6 +113,7 @@ struct MpegPsPadData {
 };
 
 GType mpegpsmux_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (mpegpsmux);
 
 #define CLOCK_BASE 9LL
 #define CLOCK_FREQ (CLOCK_BASE * 10000)
index af3da38..188bf46 100644 (file)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gst_mpegts_initialize ();
-  if (!gst_mpegtsbase_plugin_init (plugin))
-    return FALSE;
-  if (!gst_mpegtsparse_plugin_init (plugin))
-    return FALSE;
-  if (!gst_ts_demux_plugin_init (plugin))
-    return FALSE;
-  return TRUE;
+  gboolean ret = FALSE;
+
+  ret |= GST_ELEMENT_REGISTER (tsparse, plugin);
+  ret |= GST_ELEMENT_REGISTER (tsdemux, plugin);
+
+  return ret;
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index bce8e8f..cc567f0 100644 (file)
@@ -108,6 +108,9 @@ _extra_init (void)
   QUARK_PCR_PID = g_quark_from_string ("pcr-pid");
   QUARK_STREAMS = g_quark_from_string ("streams");
   QUARK_STREAM_TYPE = g_quark_from_string ("stream-type");
+  GST_DEBUG_CATEGORY_INIT (mpegts_base_debug, "mpegtsbase", 0,
+      "MPEG transport stream base class");
+  gst_mpegts_initialize ();
 }
 
 #define mpegts_base_parent_class parent_class
index 7bb928a..76ac55b 100644 (file)
@@ -125,6 +125,11 @@ static gboolean push_event (MpegTSBase * base, GstEvent * event);
 
 #define mpegts_parse_parent_class parent_class
 G_DEFINE_TYPE (MpegTSParse2, mpegts_parse, GST_TYPE_MPEGTS_BASE);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (tsparse, "tsparse",
+    GST_RANK_NONE, GST_TYPE_MPEGTS_PARSE,
+    GST_DEBUG_CATEGORY_INIT (mpegts_parse_debug, "tsparse", 0,
+        "MPEG transport stream parser"));
+
 static void mpegts_parse_reset (MpegTSBase * base);
 static GstFlowReturn mpegts_parse_input_done (MpegTSBase * base);
 static GstFlowReturn
@@ -1206,13 +1211,3 @@ mpegts_parse_src_pad_query (GstPad * pad, GstObject * parent, GstQuery * query)
   }
   return res;
 }
-
-gboolean
-gst_mpegtsparse_plugin_init (GstPlugin * plugin)
-{
-  GST_DEBUG_CATEGORY_INIT (mpegts_parse_debug, "tsparse", 0,
-      "MPEG transport stream parser");
-
-  return gst_element_register (plugin, "tsparse",
-      GST_RANK_NONE, GST_TYPE_MPEGTS_PARSE);
-}
index 6b2aa33..55f2a55 100644 (file)
@@ -95,8 +95,7 @@ struct _MpegTSParse2Class {
 };
 
 G_GNUC_INTERNAL GType mpegts_parse_get_type(void);
-
-G_GNUC_INTERNAL gboolean gst_mpegtsparse_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (tsparse);
 
 G_END_DECLS
 
index 5266576..2f932c9 100644 (file)
@@ -356,6 +356,12 @@ _extra_init (void)
 #define gst_ts_demux_parent_class parent_class
 G_DEFINE_TYPE_WITH_CODE (GstTSDemux, gst_ts_demux, GST_TYPE_MPEGTS_BASE,
     _extra_init ());
+#define _do_element_init \
+  GST_DEBUG_CATEGORY_INIT (ts_demux_debug, "tsdemux", 0, \
+      "MPEG transport stream demuxer");\
+  init_pes_parser ();
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (tsdemux, "tsdemux",
+    GST_RANK_PRIMARY, GST_TYPE_TS_DEMUX, _do_element_init);
 
 static void
 gst_ts_demux_dispose (GObject * object)
@@ -3420,14 +3426,3 @@ gst_ts_demux_push (MpegTSBase * base, MpegTSPacketizerPacket * packet,
   }
   return res;
 }
-
-gboolean
-gst_ts_demux_plugin_init (GstPlugin * plugin)
-{
-  GST_DEBUG_CATEGORY_INIT (ts_demux_debug, "tsdemux", 0,
-      "MPEG transport stream demuxer");
-  init_pes_parser ();
-
-  return gst_element_register (plugin, "tsdemux",
-      GST_RANK_PRIMARY, GST_TYPE_TS_DEMUX);
-}
index 931306a..dd0275a 100644 (file)
@@ -109,8 +109,7 @@ struct _GstTSDemuxClass
 };
 
 G_GNUC_INTERNAL GType gst_ts_demux_get_type (void);
-
-G_GNUC_INTERNAL gboolean gst_ts_demux_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (tsdemux);
 
 G_END_DECLS
 #endif /* GST_TS_DEMUX_H */
index bdd8bf1..9a54fe0 100644 (file)
@@ -25,6 +25,8 @@ GST_DEBUG_CATEGORY (gst_atsc_mux_debug);
 #define GST_CAT_DEFAULT gst_atsc_mux_debug
 
 G_DEFINE_TYPE (GstATSCMux, gst_atsc_mux, GST_TYPE_BASE_TS_MUX);
+GST_ELEMENT_REGISTER_DEFINE (atscmux, "atscmux", GST_RANK_PRIMARY,
+    gst_atsc_mux_get_type ());
 
 #define parent_class gst_atsc_mux_parent_class
 #define ATSCMUX_ST_PS_AUDIO_EAC3 0x87
index e2c6dd8..4101572 100644 (file)
@@ -40,6 +40,7 @@ struct GstATSCMuxClass {
 };
 
 GType gst_atsc_mux_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (atscmux);
 
 G_END_DECLS
 
index 3fe7da4..fd6138a 100644 (file)
@@ -236,7 +236,8 @@ typedef struct
   GstBuffer *buffer;
 } StreamData;
 
-G_DEFINE_TYPE (GstBaseTsMux, gst_base_ts_mux, GST_TYPE_AGGREGATOR);
+G_DEFINE_TYPE_WITH_CODE (GstBaseTsMux, gst_base_ts_mux, GST_TYPE_AGGREGATOR,
+    gst_mpegts_initialize ());
 
 /* Internals */
 
index 1b3638e..1c26f39 100644 (file)
@@ -152,8 +152,10 @@ GST_STATIC_PAD_TEMPLATE ("src",
 GST_DEBUG_CATEGORY (gst_mpeg_ts_mux_debug);
 #define GST_CAT_DEFAULT gst_mpeg_ts_mux_debug
 
-G_DEFINE_TYPE (GstMpegTsMux, gst_mpeg_ts_mux, GST_TYPE_BASE_TS_MUX);
 #define parent_class gst_mpeg_ts_mux_parent_class
+G_DEFINE_TYPE (GstMpegTsMux, gst_mpeg_ts_mux, GST_TYPE_BASE_TS_MUX);
+GST_ELEMENT_REGISTER_DEFINE (mpegtsmux, "mpegtsmux", GST_RANK_PRIMARY,
+    gst_mpeg_ts_mux_get_type ());
 
 /* Internals */
 
index bb796b4..fb97405 100644 (file)
@@ -118,6 +118,7 @@ struct GstMpegTsMuxClass {
 };
 
 GType gst_mpeg_ts_mux_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (mpegtsmux);
 
 G_END_DECLS
 
index aea1bae..22552a8 100644 (file)
@@ -2,23 +2,18 @@
 #include "config.h"
 #endif
 
-#include "gstmpegtsmux.h"
 #include "gstatscmux.h"
+#include "gstmpegtsmux.h"
 
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gst_mpegts_initialize ();
-
-  if (!gst_element_register (plugin, "mpegtsmux", GST_RANK_PRIMARY,
-          gst_mpeg_ts_mux_get_type ()))
-    return FALSE;
+  gboolean ret = FALSE;
 
-  if (!gst_element_register (plugin, "atscmux", GST_RANK_PRIMARY,
-          gst_atsc_mux_get_type ()))
-    return FALSE;
+  ret |= GST_ELEMENT_REGISTER (mpegtsmux, plugin);
+  ret |= GST_ELEMENT_REGISTER (atscmux, plugin);
 
-  return TRUE;
+  return ret;
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR,
diff --git a/gst/mxf/gstmxfelement.c b/gst/mxf/gstmxfelement.c
new file mode 100644 (file)
index 0000000..f2c1166
--- /dev/null
@@ -0,0 +1,82 @@
+
+/* GStreamer
+ * Copyright (C) <2008> Sebastian Dröge <sebastian.droege@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 <gst/gst.h>
+
+#include "gstmxfelements.h"
+#include "mxfquark.h"
+#include "mxfdemux.h"
+#include "mxfmux.h"
+/*#include "mxfdms1.h"*/
+#include "mxfaes-bwf.h"
+#include "mxfalaw.h"
+#include "mxfd10.h"
+#include "mxfdv-dif.h"
+#include "mxfjpeg2000.h"
+#include "mxfmpeg.h"
+#include "mxfup.h"
+#include "mxfvc3.h"
+#include "mxfprores.h"
+#include "mxfvanc.h"
+
+GST_DEBUG_CATEGORY (mxf_debug);
+#define GST_CAT_DEFAULT mxf_debug
+
+static void
+mxf_init (void)
+{
+  gst_tag_register (GST_TAG_MXF_UMID, GST_TAG_FLAG_META,
+      G_TYPE_STRING, "UMID", "Unique Material Identifier", NULL);
+  gst_tag_register (GST_TAG_MXF_STRUCTURE, GST_TAG_FLAG_META,
+      GST_TYPE_STRUCTURE, "Structure", "Structural metadata of "
+      "the MXF file", NULL);
+  gst_tag_register (GST_TAG_MXF_DESCRIPTIVE_METADATA_FRAMEWORK,
+      GST_TAG_FLAG_META, GST_TYPE_STRUCTURE, "DM Framework",
+      "Descriptive metadata framework", NULL);
+}
+
+void
+mxf_element_init (GstPlugin * plugin)
+{
+  static gsize res = FALSE;
+
+  if (g_once_init_enter (&res)) {
+    GST_DEBUG_CATEGORY_INIT (mxf_debug, "mxf", 0, "MXF");
+
+    mxf_init ();
+    mxf_quark_initialize ();
+    mxf_metadata_init_types ();
+    /*  mxf_dms1_initialize (); */
+    mxf_aes_bwf_init ();
+    mxf_alaw_init ();
+    mxf_d10_init ();
+    mxf_dv_dif_init ();
+    mxf_jpeg2000_init ();
+    mxf_mpeg_init ();
+    mxf_up_init ();
+    mxf_vc3_init ();
+    mxf_prores_init ();
+    mxf_vanc_init ();
+    g_once_init_leave (&res, TRUE);
+  }
+}
diff --git a/gst/mxf/gstmxfelements.h b/gst/mxf/gstmxfelements.h
new file mode 100644 (file)
index 0000000..bc2cc57
--- /dev/null
@@ -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_MXF_ELEMENTS_H__
+#define __GST_MXF_ELEMENTS_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gst/gst.h>
+
+void mxf_element_init (GstPlugin * plugin);
+
+GST_ELEMENT_REGISTER_DECLARE (mxfdemux);
+GST_ELEMENT_REGISTER_DECLARE (mxfmux);
+
+#endif /* __GST_MXF_ELEMENTS_H__ */
index 30980df..db9c419 100644 (file)
@@ -1,5 +1,6 @@
 mxf_sources = [
   'mxf.c',
+  'gstmxfelement.c',
   'mxful.c',
   'mxftypes.c',
   'mxfmetadata.c',
index e4f94cb..e3e9fe3 100644 (file)
@@ -1,3 +1,4 @@
+
 /* GStreamer
  * Copyright (C) <2008> Sebastian Dröge <sebastian.droege@collabora.co.uk>
  *
 #include <config.h>
 #endif
 
-#include <gst/gst.h>
-
-#include "mxfquark.h"
-#include "mxfdemux.h"
-#include "mxfmux.h"
-/*#include "mxfdms1.h"*/
-#include "mxfaes-bwf.h"
-#include "mxfalaw.h"
-#include "mxfd10.h"
-#include "mxfdv-dif.h"
-#include "mxfjpeg2000.h"
-#include "mxfmpeg.h"
-#include "mxfup.h"
-#include "mxfvc3.h"
-#include "mxfprores.h"
-#include "mxfvanc.h"
-
-GST_DEBUG_CATEGORY (mxf_debug);
-#define GST_CAT_DEFAULT mxf_debug
+#include "gstmxfelements.h"
 
-static void
-mxf_init (void)
-{
-  gst_tag_register (GST_TAG_MXF_UMID, GST_TAG_FLAG_META,
-      G_TYPE_STRING, "UMID", "Unique Material Identifier", NULL);
-  gst_tag_register (GST_TAG_MXF_STRUCTURE, GST_TAG_FLAG_META,
-      GST_TYPE_STRUCTURE, "Structure", "Structural metadata of "
-      "the MXF file", NULL);
-  gst_tag_register (GST_TAG_MXF_DESCRIPTIVE_METADATA_FRAMEWORK,
-      GST_TAG_FLAG_META, GST_TYPE_STRUCTURE, "DM Framework",
-      "Descriptive metadata framework", NULL);
-}
 
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  GST_DEBUG_CATEGORY_INIT (mxf_debug, "mxf", 0, "MXF");
-
-  mxf_init ();
-  mxf_quark_initialize ();
-  mxf_metadata_init_types ();
-/*  mxf_dms1_initialize ();*/
-  mxf_aes_bwf_init ();
-  mxf_alaw_init ();
-  mxf_d10_init ();
-  mxf_dv_dif_init ();
-  mxf_jpeg2000_init ();
-  mxf_mpeg_init ();
-  mxf_up_init ();
-  mxf_vc3_init ();
-  mxf_prores_init ();
-  mxf_vanc_init ();
+  gboolean ret = FALSE;
 
   /* mxfmux is disabled for now - it compiles but is completely untested */
-  if (!gst_element_register (plugin, "mxfdemux", GST_RANK_PRIMARY,
-          GST_TYPE_MXF_DEMUX)
-      || !gst_element_register (plugin, "mxfmux", GST_RANK_PRIMARY,
-          GST_TYPE_MXF_MUX))
-    return FALSE;
+  ret |= GST_ELEMENT_REGISTER (mxfdemux, plugin);
+  ret |= GST_ELEMENT_REGISTER (mxfmux, plugin);
 
-  return TRUE;
+  return ret;
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index f6e5ac0..d34827c 100644 (file)
@@ -51,6 +51,7 @@
 #include "config.h"
 #endif
 
+#include "gstmxfelements.h"
 #include "mxfdemux.h"
 #include "mxfessence.h"
 
@@ -128,6 +129,8 @@ static gboolean gst_mxf_demux_src_query (GstPad * pad, GstObject * parent,
 
 #define gst_mxf_demux_parent_class parent_class
 G_DEFINE_TYPE (GstMXFDemux, gst_mxf_demux, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (mxfdemux, "mxfdemux", GST_RANK_PRIMARY,
+    GST_TYPE_MXF_DEMUX, mxf_element_init (plugin));
 
 static void
 gst_mxf_demux_remove_pad (GstMXFDemuxPad * pad, GstMXFDemux * demux)
index 1fb9c6f..2eade47 100644 (file)
@@ -37,6 +37,7 @@
 #include <math.h>
 #include <string.h>
 
+#include "gstmxfelements.h"
 #include "mxfmux.h"
 
 #ifdef HAVE_SYS_UTSNAME_H
@@ -120,6 +121,8 @@ enum
 
 #define gst_mxf_mux_parent_class parent_class
 G_DEFINE_TYPE (GstMXFMux, gst_mxf_mux, GST_TYPE_AGGREGATOR);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (mxfmux, "mxfmux", GST_RANK_PRIMARY,
+    GST_TYPE_MXF_MUX, mxf_element_init (plugin));
 
 static void gst_mxf_mux_finalize (GObject * object);
 
index 692b389..c917de3 100644 (file)
@@ -93,6 +93,8 @@ GST_STATIC_PAD_TEMPLATE ("src",
     GST_STATIC_CAPS_ANY);
 
 G_DEFINE_TYPE (GstNetSim, gst_net_sim, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE (netsim, "netsim",
+    GST_RANK_MARGINAL, GST_TYPE_NET_SIM);
 
 static gboolean
 gst_net_sim_source_dispatch (GSource * source,
@@ -763,8 +765,7 @@ gst_net_sim_class_init (GstNetSimClass * klass)
 static gboolean
 gst_net_sim_plugin_init (GstPlugin * plugin)
 {
-  return gst_element_register (plugin, "netsim",
-      GST_RANK_MARGINAL, GST_TYPE_NET_SIM);
+  return GST_ELEMENT_REGISTER (netsim, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index bfbfa3f..cbd6270 100644 (file)
@@ -96,6 +96,7 @@ struct _GstNetSimClass
 };
 
 GType gst_net_sim_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (netsim);
 
 G_END_DECLS
 
index c674232..3ae7ea8 100644 (file)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  if (!gst_element_register (plugin, "rtponviftimestamp", GST_RANK_NONE,
-          GST_TYPE_RTP_ONVIF_TIMESTAMP))
-    return FALSE;
-  if (!gst_element_register (plugin, "rtponvifparse", GST_RANK_NONE,
-          GST_TYPE_RTP_ONVIF_PARSE))
-    return FALSE;
+  gboolean ret = FALSE;
 
-  return TRUE;
+  ret |= GST_ELEMENT_REGISTER (rtponviftimestamp, plugin);
+  ret |= GST_ELEMENT_REGISTER (rtponvifparse, plugin);
+
+  return ret;
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 8fa0d85..aaae94a 100644 (file)
@@ -48,6 +48,8 @@ GST_STATIC_PAD_TEMPLATE ("src",
     );
 
 G_DEFINE_TYPE (GstRtpOnvifParse, gst_rtp_onvif_parse, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE (rtponvifparse, "rtponvifparse",
+    GST_RANK_NONE, GST_TYPE_RTP_ONVIF_PARSE);
 
 static void
 gst_rtp_onvif_parse_class_init (GstRtpOnvifParseClass * klass)
index 437b1ab..a5b8d15 100644 (file)
@@ -54,6 +54,7 @@ struct _GstRtpOnvifParseClass {
 };
 
 GType gst_rtp_onvif_parse_get_type(void);
+GST_ELEMENT_REGISTER_DECLARE (rtponvifparse);
 
 #ifdef __cplusplus
 }
index 1ed5465..c5fb1d4 100644 (file)
@@ -78,6 +78,8 @@ enum
 /*static guint gst_rtp_onvif_timestamp_signals[LAST_SIGNAL] = { 0 }; */
 
 G_DEFINE_TYPE (GstRtpOnvifTimestamp, gst_rtp_onvif_timestamp, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE (rtponviftimestamp, "rtponviftimestamp",
+    GST_RANK_NONE, GST_TYPE_RTP_ONVIF_TIMESTAMP);
 
 static void
 gst_rtp_onvif_timestamp_get_property (GObject * object,
index f093f0e..15a47f8 100644 (file)
@@ -75,6 +75,7 @@ struct _GstRtpOnvifTimestampClass {
 };
 
 GType gst_rtp_onvif_timestamp_get_type(void);
+GST_ELEMENT_REGISTER_DECLARE (rtponviftimestamp);
 
 #ifdef __cplusplus
 }
index e9ab037..c049845 100644 (file)
@@ -80,6 +80,8 @@ static void gst_irtsp_parse_get_property (GObject * object,
 
 #define parent_class gst_irtsp_parse_parent_class
 G_DEFINE_TYPE (GstIRTSPParse, gst_irtsp_parse, GST_TYPE_BASE_PARSE);
+GST_ELEMENT_REGISTER_DEFINE (irtspparse, "irtspparse", GST_RANK_NONE,
+    GST_TYPE_IRTSP_PARSE);
 
 static void
 gst_irtsp_parse_class_init (GstIRTSPParseClass * klass)
index e3d3b74..1ebbf3e 100644 (file)
@@ -76,6 +76,7 @@ struct _GstIRTSPParseClass
 };
 
 GType gst_irtsp_parse_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (irtspparse);
 
 G_END_DECLS
 #endif /* __GST_IRTSP_PARSE_H__ */
index aab2b8a..967e4ca 100644 (file)
@@ -107,6 +107,8 @@ static gboolean gst_pcap_sink_event (GstPad * pad,
 
 #define parent_class gst_pcap_parse_parent_class
 G_DEFINE_TYPE (GstPcapParse, gst_pcap_parse, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE (pcapparse, "pcapparse", GST_RANK_NONE,
+    GST_TYPE_PCAP_PARSE);
 
 static void
 gst_pcap_parse_class_init (GstPcapParseClass * klass)
index 5feb4c6..29e2188 100644 (file)
@@ -94,6 +94,7 @@ struct _GstPcapParseClass
 };
 
 GType gst_pcap_parse_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (pcapparse);
 
 G_END_DECLS
 
index 3e6eb38..10f2cb1 100644 (file)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gboolean ret;
+  gboolean ret = FALSE;
 
-  ret = gst_element_register (plugin, "pcapparse",
-      GST_RANK_NONE, GST_TYPE_PCAP_PARSE);
-  ret &= gst_element_register (plugin, "irtspparse",
-      GST_RANK_NONE, GST_TYPE_IRTSP_PARSE);
+  ret |= GST_ELEMENT_REGISTER (pcapparse, plugin);
+  ret |= GST_ELEMENT_REGISTER (irtspparse, plugin);
 
   return ret;
 }
index 2b08609..8f3efac 100644 (file)
 #include "gstpnmdec.h"
 #include "gstpnmenc.h"
 
-#include <gst/gst.h>
-
-#include <string.h>
 
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  if (!gst_element_register (plugin, "pnmdec", GST_RANK_PRIMARY,
-          GST_TYPE_PNMDEC))
-    return FALSE;
-  if (!gst_element_register (plugin, "pnmenc", GST_RANK_PRIMARY,
-          GST_TYPE_PNMENC))
-    return FALSE;
+  gboolean ret = FALSE;
+
+  ret |= GST_ELEMENT_REGISTER (pnmdec, plugin);
+  ret |= GST_ELEMENT_REGISTER (pnmenc, plugin);
 
-  return TRUE;
+  return ret;
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, pnm,
index b11a731..d67cba3 100644 (file)
@@ -56,6 +56,8 @@ static GstFlowReturn
 gst_pnmdec_parse_ascii (GstPnmdec * s, const guint8 * b, guint bs);
 
 G_DEFINE_TYPE (GstPnmdec, gst_pnmdec, GST_TYPE_VIDEO_DECODER);
+GST_ELEMENT_REGISTER_DEFINE (pnmdec, "pnmdec", GST_RANK_PRIMARY,
+    GST_TYPE_PNMDEC);
 
 static GstStaticPadTemplate gst_pnmdec_src_pad_template =
 GST_STATIC_PAD_TEMPLATE ("src",
index b5aac35..7909680 100644 (file)
@@ -54,7 +54,7 @@ struct _GstPnmdecClass
 };
 
 GType gst_pnmdec_get_type (void) G_GNUC_CONST;
-
+GST_ELEMENT_REGISTER_DECLARE (pnmdec);
 G_END_DECLS
 
 #endif /* __GST_PNMDEC_H__ */
index 7919f5d..c637b74 100644 (file)
@@ -65,8 +65,11 @@ static GstStaticPadTemplate src_pad_template =
 GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
     GST_STATIC_CAPS (MIME_ALL));
 
-G_DEFINE_TYPE (GstPnmenc, gst_pnmenc, GST_TYPE_VIDEO_ENCODER);
 #define parent_class gst_pnmenc_parent_class
+G_DEFINE_TYPE (GstPnmenc, gst_pnmenc, GST_TYPE_VIDEO_ENCODER);
+GST_ELEMENT_REGISTER_DEFINE (pnmenc, "pnmenc", GST_RANK_PRIMARY,
+    GST_TYPE_PNMENC);
+
 
 static GstFlowReturn
 gst_pnmenc_handle_frame (GstVideoEncoder * encoder, GstVideoCodecFrame * frame);
index cb7f45b..3dc57b0 100644 (file)
@@ -51,6 +51,7 @@ struct _GstPnmencClass
 };
 
 GType gst_pnmenc_get_type (void) G_GNUC_CONST;
+GST_ELEMENT_REGISTER_DECLARE (pnmenc);
 
 G_END_DECLS
 
index fbe4e5e..74bc86e 100644 (file)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gst_element_register (plugin, "proxysrc", GST_RANK_NONE, GST_TYPE_PROXY_SRC);
-  gst_element_register (plugin, "proxysink", GST_RANK_NONE,
-      GST_TYPE_PROXY_SINK);
+  gboolean ret = FALSE;
 
-  return TRUE;
+  ret |= GST_ELEMENT_REGISTER (proxysrc, plugin);
+  ret |= GST_ELEMENT_REGISTER (proxysink, plugin);
+
+  return ret;
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index f44f8ec..9425dcc 100644 (file)
@@ -54,6 +54,8 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
 /* Unlink proxysrc, we don't contain any elements so our parent is GstElement */
 #define parent_class gst_proxy_sink_parent_class
 G_DEFINE_TYPE (GstProxySink, gst_proxy_sink, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE (proxysink, "proxysink", GST_RANK_NONE,
+    GST_TYPE_PROXY_SINK);
 
 static gboolean gst_proxy_sink_sink_query (GstPad * pad, GstObject * parent,
     GstQuery * query);
index 9da4b39..9bd382c 100644 (file)
@@ -55,6 +55,7 @@ struct _GstProxySinkClass {
 };
 
 GType gst_proxy_sink_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (proxysink);
 
 G_END_DECLS
 
index c7fb4b6..97fbc12 100644 (file)
@@ -100,6 +100,8 @@ enum
  * element */
 #define parent_class gst_proxy_src_parent_class
 G_DEFINE_TYPE (GstProxySrc, gst_proxy_src, GST_TYPE_BIN);
+GST_ELEMENT_REGISTER_DEFINE (proxysrc, "proxysrc", GST_RANK_NONE,
+    GST_TYPE_PROXY_SRC);
 
 static gboolean gst_proxy_src_internal_src_query (GstPad * pad,
     GstObject * parent, GstQuery * query);
index 4f5c302..4e7648c 100644 (file)
@@ -63,6 +63,7 @@ struct _GstProxySrcClass {
 };
 
 GType gst_proxy_src_get_type(void);
+GST_ELEMENT_REGISTER_DECLARE (proxysrc);
 
 G_END_DECLS
 
index 6e4c647..3e73762 100644 (file)
@@ -122,6 +122,8 @@ gst_audio_parse_format_get_type (void)
 
 #define gst_audio_parse_parent_class parent_class
 G_DEFINE_TYPE (GstAudioParse, gst_audio_parse, GST_TYPE_BIN);
+GST_ELEMENT_REGISTER_DEFINE (audioparse, "audioparse", GST_RANK_NONE,
+    gst_audio_parse_get_type ());
 
 static void
 gst_audio_parse_class_init (GstAudioParseClass * klass)
index 41b23d4..22039e7 100644 (file)
@@ -50,5 +50,6 @@ struct _GstAudioParseClass
 };
 
 GType gst_audio_parse_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (audioparse);
 
 #endif /*  __GST_AUDIO_PARSE_H__ */
index ee931a9..3594282 100644 (file)
@@ -82,6 +82,8 @@ enum
 
 #define gst_video_parse_parent_class parent_class
 G_DEFINE_TYPE (GstVideoParse, gst_video_parse, GST_TYPE_BIN);
+GST_ELEMENT_REGISTER_DEFINE (videoparse, "videoparse", GST_RANK_NONE,
+    gst_video_parse_get_type ());
 
 static void
 gst_video_parse_class_init (GstVideoParseClass * klass)
index 57b9b68..59391e0 100644 (file)
@@ -51,5 +51,6 @@ struct _GstVideoParseClass
 };
 
 GType gst_video_parse_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (videoparse);
 
 #endif /*  __GST_VIDEO_PARSE_H__ */
index d7de876..0487b50 100644 (file)
@@ -9,12 +9,10 @@
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gboolean ret;
+  gboolean ret = FALSE;
 
-  ret = gst_element_register (plugin, "videoparse", GST_RANK_NONE,
-      gst_video_parse_get_type ());
-  ret &= gst_element_register (plugin, "audioparse", GST_RANK_NONE,
-      gst_audio_parse_get_type ());
+  ret |= GST_ELEMENT_REGISTER (videoparse, plugin);
+  ret |= GST_ELEMENT_REGISTER (audioparse, plugin);
 
   return ret;
 }
index 5529f6a..6822e57 100644 (file)
@@ -104,6 +104,8 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
 #define gst_remove_silence_parent_class parent_class
 G_DEFINE_TYPE_WITH_CODE (GstRemoveSilence, gst_remove_silence,
     GST_TYPE_BASE_TRANSFORM, DEBUG_INIT (0));
+GST_ELEMENT_REGISTER_DEFINE (removesilence, "removesilence", GST_RANK_NONE,
+    gst_remove_silence_get_type ());
 
 static void gst_remove_silence_set_property (GObject * object, guint prop_id,
     const GValue * value, GParamSpec * pspec);
@@ -427,8 +429,7 @@ gst_remove_silence_transform_ip (GstBaseTransform * trans, GstBuffer * inbuf)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  return gst_element_register (plugin, "removesilence", GST_RANK_NONE,
-      gst_remove_silence_get_type ());
+  return GST_ELEMENT_REGISTER (removesilence, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index f7faf10..2cecb07 100644 (file)
@@ -60,6 +60,7 @@ typedef struct _GstRemoveSilenceClass {
 } GstRemoveSilenceClass;
 
 GType gst_remove_silence_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (removesilence);
 
 G_END_DECLS
 
diff --git a/gst/rist/gstrist.c b/gst/rist/gstrist.c
new file mode 100644 (file)
index 0000000..b393925
--- /dev/null
@@ -0,0 +1,93 @@
+/* GStreamer RIST plugin
+ * Copyright (C) 2019 Net Insight AB
+ *     Author: Nicolas Dufresne <nicolas.dufresne@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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "gstrist.h"
+#include "gstroundrobin.h"
+
+/*
+ * rtp_ext_seq:
+ * @extseq: (inout): a previous extended seqs
+ * @seq: a new seq
+ *
+ * Update the @extseq field with the extended seq of @seq
+ * For the first call of the method, @extseq should point to a location
+ * with a value of -1.
+ *
+ * This function is able to handle both forward and backward seqs taking
+ * into account:
+ *   - seq wraparound making sure that the returned value is properly increased.
+ *   - seq unwraparound making sure that the returned value is properly decreased.
+ *
+ * Returns: The extended seq of @seq or 0 if the result can't go anywhere backwards.
+ *
+ * NOTE: This is a calque of gst_rtp_buffer_ext_timestamp() but with
+ * s/32/16/ and s/64/32/ and s/0xffffffff/0xffff/ and s/timestamp/seqnum/.
+ */
+guint32
+gst_rist_rtp_ext_seq (guint32 * extseqnum, guint16 seqnum)
+{
+  guint32 result, ext;
+
+  g_return_val_if_fail (extseqnum != NULL, -1);
+
+  ext = *extseqnum;
+
+  if (ext == -1) {
+    result = seqnum;
+  } else {
+    /* pick wraparound counter from previous seqnum and add to new seqnum */
+    result = seqnum + (ext & ~(0xffff));
+
+    /* check for seqnum wraparound */
+    if (result < ext) {
+      guint32 diff = ext - result;
+
+      if (diff > G_MAXINT16) {
+        /* seqnum went backwards more than allowed, we wrap around and get
+         * updated extended seqnum. */
+        result += (1 << 16);
+      }
+    } else {
+      guint32 diff = result - ext;
+
+      if (diff > G_MAXINT16) {
+        if (result < (1 << 16)) {
+          GST_WARNING
+              ("Cannot unwrap, any wrapping took place yet. Returning 0 without updating extended seqnum.");
+          return 0;
+        } else {
+          /* seqnum went forwards more than allowed, we unwrap around and get
+           * updated extended seqnum. */
+          result -= (1 << 16);
+          /* We don't want the extended seqnum storage to go back, ever */
+          return result;
+        }
+      }
+    }
+  }
+
+  *extseqnum = result;
+
+  return result;
+}
index 1f74044..b6d3c83 100644 (file)
@@ -30,6 +30,7 @@ typedef struct {
   GstElementClass parent_class;
 } GstRistRtxReceiveClass;
 GType gst_rist_rtx_receive_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (ristrtxreceive);
 
 #define GST_TYPE_RIST_RTX_SEND (gst_rist_rtx_send_get_type())
 #define GST_RIST_RTX_SEND(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RIST_RTX_SEND, GstRistRtxSend))
@@ -38,6 +39,7 @@ typedef struct {
   GstElementClass parent_class;
 } GstRistRtxSendClass;
 GType gst_rist_rtx_send_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (ristrtxsend);
 
 #define GST_TYPE_RIST_SRC          (gst_rist_src_get_type())
 #define GST_RIST_SRC(obj)          (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RIST_SRC,GstRistSrc))
@@ -46,7 +48,7 @@ typedef struct {
   GstBinClass parent;
 } GstRistSrcClass;
 GType gst_rist_src_get_type (void);
-
+GST_ELEMENT_REGISTER_DECLARE (ristsrc);
 
 #define GST_TYPE_RIST_SINK          (gst_rist_sink_get_type())
 #define GST_RIST_SINK(obj)          (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RIST_SINK,GstRistSink))
@@ -55,6 +57,7 @@ typedef struct {
   GstBinClass parent;
 } GstRistSinkClass;
 GType gst_rist_sink_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (ristsink);
 
 #define GST_TYPE_RIST_RTP_EXT      (gst_rist_rtp_ext_get_type())
 #define GST_RIST_RTP_EXT(obj)      (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RIST_RTP_EXT,GstRistRtpExt))
@@ -63,6 +66,7 @@ typedef struct {
   GstElementClass parent;
 } GstRistRtpExtClass;
 GType gst_rist_rtp_ext_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (ristrtpext);
 
 #define GST_TYPE_RIST_RTP_DEEXT      (gst_rist_rtp_deext_get_type())
 #define GST_RIST_RTP_DEEXT(obj)      (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_RIST_RTP_DEEXT,GstRistRtpDeext))
@@ -71,6 +75,7 @@ typedef struct {
   GstElementClass parent;
 } GstRistRtpDeextClass;
 GType gst_rist_rtp_deext_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (ristrtpdeext);
 
 guint32 gst_rist_rtp_ext_seq (guint32 * extseqnum, guint16 seqnum);
 
index e068655..ff6fda2 100644 (file)
 #include "gstrist.h"
 #include "gstroundrobin.h"
 
-/*
- * rtp_ext_seq:
- * @extseq: (inout): a previous extended seqs
- * @seq: a new seq
- *
- * Update the @extseq field with the extended seq of @seq
- * For the first call of the method, @extseq should point to a location
- * with a value of -1.
- *
- * This function is able to handle both forward and backward seqs taking
- * into account:
- *   - seq wraparound making sure that the returned value is properly increased.
- *   - seq unwraparound making sure that the returned value is properly decreased.
- *
- * Returns: The extended seq of @seq or 0 if the result can't go anywhere backwards.
- *
- * NOTE: This is a calque of gst_rtp_buffer_ext_timestamp() but with
- * s/32/16/ and s/64/32/ and s/0xffffffff/0xffff/ and s/timestamp/seqnum/.
- */
-guint32
-gst_rist_rtp_ext_seq (guint32 * extseqnum, guint16 seqnum)
-{
-  guint32 result, ext;
-
-  g_return_val_if_fail (extseqnum != NULL, -1);
-
-  ext = *extseqnum;
-
-  if (ext == -1) {
-    result = seqnum;
-  } else {
-    /* pick wraparound counter from previous seqnum and add to new seqnum */
-    result = seqnum + (ext & ~(0xffff));
-
-    /* check for seqnum wraparound */
-    if (result < ext) {
-      guint32 diff = ext - result;
-
-      if (diff > G_MAXINT16) {
-        /* seqnum went backwards more than allowed, we wrap around and get
-         * updated extended seqnum. */
-        result += (1 << 16);
-      }
-    } else {
-      guint32 diff = result - ext;
-
-      if (diff > G_MAXINT16) {
-        if (result < (1 << 16)) {
-          GST_WARNING
-              ("Cannot unwrap, any wrapping took place yet. Returning 0 without updating extended seqnum.");
-          return 0;
-        } else {
-          /* seqnum went forwards more than allowed, we unwrap around and get
-           * updated extended seqnum. */
-          result -= (1 << 16);
-          /* We don't want the extended seqnum storage to go back, ever */
-          return result;
-        }
-      }
-    }
-  }
-
-  *extseqnum = result;
-
-  return result;
-}
-
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  if (!gst_element_register (plugin, "ristsrc", GST_RANK_PRIMARY,
-          GST_TYPE_RIST_SRC))
-    return FALSE;
-  if (!gst_element_register (plugin, "ristsink", GST_RANK_PRIMARY,
-          GST_TYPE_RIST_SINK))
-    return FALSE;
-  if (!gst_element_register (plugin, "ristrtxsend", GST_RANK_NONE,
-          GST_TYPE_RIST_RTX_SEND))
-    return FALSE;
-  if (!gst_element_register (plugin, "ristrtxreceive", GST_RANK_NONE,
-          GST_TYPE_RIST_RTX_RECEIVE))
-    return FALSE;
-  if (!gst_element_register (plugin, "roundrobin", GST_RANK_NONE,
-          GST_TYPE_ROUND_ROBIN))
-    return FALSE;
-  if (!gst_element_register (plugin, "ristrtpext", GST_RANK_NONE,
-          GST_TYPE_RIST_RTP_EXT))
-    return FALSE;
-  if (!gst_element_register (plugin, "ristrtpdeext", GST_RANK_NONE,
-          GST_TYPE_RIST_RTP_DEEXT))
-    return FALSE;
+  gboolean ret = FALSE;
+
+  ret |= GST_ELEMENT_REGISTER (ristsrc, plugin);
+  ret |= GST_ELEMENT_REGISTER (ristsink, plugin);
+  ret |= GST_ELEMENT_REGISTER (ristrtxsend, plugin);
+  ret |= GST_ELEMENT_REGISTER (ristrtxreceive, plugin);
+  ret |= GST_ELEMENT_REGISTER (roundrobin, plugin);
+  ret |= GST_ELEMENT_REGISTER (ristrtpext, plugin);
+  ret |= GST_ELEMENT_REGISTER (ristrtpdeext, plugin);
 
-  return TRUE;
+  return ret;
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 47d3c2b..7dc2a04 100644 (file)
@@ -76,6 +76,8 @@ struct _GstRistRtpDeext
 G_DEFINE_TYPE_WITH_CODE (GstRistRtpDeext, gst_rist_rtp_deext, GST_TYPE_ELEMENT,
     GST_DEBUG_CATEGORY_INIT (gst_rist_rtp_deext_debug, "ristrtpdeext", 0,
         "RIST RTP De-extension"));
+GST_ELEMENT_REGISTER_DEFINE (ristrtpdeext, "ristrtpdeext", GST_RANK_NONE,
+    GST_TYPE_RIST_RTP_DEEXT);
 
 static guint8
 bit_count (guint8 value)
index 42b2993..32e3ea1 100644 (file)
@@ -85,7 +85,8 @@ struct _GstRistRtpExt
 G_DEFINE_TYPE_WITH_CODE (GstRistRtpExt, gst_rist_rtp_ext, GST_TYPE_ELEMENT,
     GST_DEBUG_CATEGORY_INIT (gst_rist_rtp_ext_debug, "ristrtpext", 0,
         "RIST RTP Extension"));
-
+GST_ELEMENT_REGISTER_DEFINE (ristrtpext, "ristrtpext", GST_RANK_NONE,
+    GST_TYPE_RIST_RTP_EXT);
 
 static GstFlowReturn
 gst_rist_rtp_ext_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
index fe8a6d5..861835a 100644 (file)
@@ -91,6 +91,8 @@ static void gst_rist_rtx_receive_get_property (GObject * object, guint prop_id,
 G_DEFINE_TYPE_WITH_CODE (GstRistRtxReceive, gst_rist_rtx_receive,
     GST_TYPE_ELEMENT, GST_DEBUG_CATEGORY_INIT (gst_rist_rtx_receive_debug,
         "ristrtxreceive", 0, "RIST retransmission receiver"));
+GST_ELEMENT_REGISTER_DEFINE (ristrtxreceive, "ristrtxreceive",
+    GST_RANK_NONE, GST_TYPE_RIST_RTX_RECEIVE);
 
 static void
 gst_rist_rtx_receive_class_init (GstRistRtxReceiveClass * klass)
index 3c4d404..fc2206a 100644 (file)
@@ -122,6 +122,8 @@ static void gst_rist_rtx_send_finalize (GObject * object);
 G_DEFINE_TYPE_WITH_CODE (GstRistRtxSend, gst_rist_rtx_send, GST_TYPE_ELEMENT,
     GST_DEBUG_CATEGORY_INIT (gst_rist_rtx_send_debug, "ristrtxsend", 0,
         "RIST retransmission sender"));
+GST_ELEMENT_REGISTER_DEFINE (ristrtxsend, "ristrtxsend", GST_RANK_NONE,
+    GST_TYPE_RIST_RTX_SEND);
 
 typedef struct
 {
index 6622257..1de516d 100644 (file)
@@ -188,6 +188,8 @@ gst_rist_bonding_method_get_type (void)
 
 G_DEFINE_TYPE_WITH_CODE (GstRistSink, gst_rist_sink, GST_TYPE_BIN,
     GST_DEBUG_CATEGORY_INIT (gst_rist_sink_debug, "ristsink", 0, "RIST Sink"));
+GST_ELEMENT_REGISTER_DEFINE (ristsink, "ristsink", GST_RANK_PRIMARY,
+    GST_TYPE_RIST_SINK);
 
 GQuark session_id_quark = 0;
 
index 5e194fc..369be39 100644 (file)
@@ -163,6 +163,8 @@ static void gst_rist_src_uri_init (gpointer g_iface, gpointer iface_data);
 G_DEFINE_TYPE_WITH_CODE (GstRistSrc, gst_rist_src, GST_TYPE_BIN,
     G_IMPLEMENT_INTERFACE (GST_TYPE_URI_HANDLER, gst_rist_src_uri_init);
     GST_DEBUG_CATEGORY_INIT (gst_rist_src_debug, "ristsrc", 0, "RIST Source"));
+GST_ELEMENT_REGISTER_DEFINE (ristsrc, "ristsrc", GST_RANK_PRIMARY,
+    GST_TYPE_RIST_SRC);
 
 /* called with bonds lock */
 static RistReceiverBond *
index 2ff8ff3..d899e7e 100644 (file)
@@ -53,6 +53,8 @@ struct _GstRoundRobin
 G_DEFINE_TYPE_WITH_CODE (GstRoundRobin, gst_round_robin,
     GST_TYPE_ELEMENT, GST_DEBUG_CATEGORY_INIT (gst_round_robin_debug,
         "roundrobin", 0, "Round Robin"));
+GST_ELEMENT_REGISTER_DEFINE (roundrobin, "roundrobin", GST_RANK_NONE,
+    GST_TYPE_ROUND_ROBIN);
 
 static GstFlowReturn
 gst_round_robin_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
index d1a9180..96fd28c 100644 (file)
@@ -30,5 +30,6 @@ typedef struct {
   GstElementClass parent;
 } GstRoundRobinClass;
 GType gst_round_robin_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (roundrobin);
 
 #endif
index a7ef8bb..88c9e87 100644 (file)
@@ -4,6 +4,7 @@ rist_sources = [
   'gstristrtxreceive.c',
   'gstristsrc.c',
   'gstristsink.c',
+  'gstrist.c',
   'gstristplugin.c',
   'gstristrtpext.c',
   'gstristrtpdeext.c'
index 1be1a3c..3565022 100644 (file)
 #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 (file)
index 0000000..2a01c06
--- /dev/null
@@ -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 (file)
index 0000000..be20c16
--- /dev/null
@@ -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__ */
index 13b4d08..46dbe35 100644 (file)
@@ -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)
index 2df92e4..6cad882 100644 (file)
@@ -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)
index c67a248..e9cabbd 100644 (file)
@@ -1,5 +1,6 @@
 rtmp2_sources = [
   'gstrtmp2.c',
+  'gstrtmp2element.c',
   'gstrtmp2locationhandler.c',
   'gstrtmp2sink.c',
   'gstrtmp2src.c',
index 364b688..c94c6da 100644 (file)
@@ -81,6 +81,8 @@ static void gst_rtp_sink_uri_handler_init (gpointer g_iface,
 G_DEFINE_TYPE_WITH_CODE (GstRtpSink, gst_rtp_sink, GST_TYPE_BIN,
     G_IMPLEMENT_INTERFACE (GST_TYPE_URI_HANDLER, gst_rtp_sink_uri_handler_init);
     GST_DEBUG_CATEGORY_INIT (gst_rtp_sink_debug, "rtpsink", 0, "RTP Sink"));
+GST_ELEMENT_REGISTER_DEFINE (rtpsink, "rtpsink", GST_RANK_PRIMARY + 1,
+    GST_TYPE_RTP_SINK);
 
 #define GST_RTP_SINK_GET_LOCK(obj) (&((GstRtpSink*)(obj))->lock)
 #define GST_RTP_SINK_LOCK(obj) (g_mutex_lock (GST_RTP_SINK_GET_LOCK(obj)))
index 1af5e0b..bc1f6dc 100644 (file)
@@ -66,6 +66,7 @@ struct _GstRtpSinkClass
 };
 
 GType gst_rtp_sink_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (rtpsink);
 
 G_END_DECLS
 #endif /* __GST_RTP_SINK_H__ */
index 6dda142..8ff6f21 100644 (file)
@@ -91,6 +91,8 @@ static void gst_rtp_src_uri_handler_init (gpointer g_iface,
 G_DEFINE_TYPE_WITH_CODE (GstRtpSrc, gst_rtp_src, GST_TYPE_BIN,
     G_IMPLEMENT_INTERFACE (GST_TYPE_URI_HANDLER, gst_rtp_src_uri_handler_init);
     GST_DEBUG_CATEGORY_INIT (gst_rtp_src_debug, "rtpsrc", 0, "RTP Source"));
+GST_ELEMENT_REGISTER_DEFINE (rtpsrc, "rtpsrc", GST_RANK_PRIMARY + 1,
+    GST_TYPE_RTP_SRC);
 
 #define GST_RTP_SRC_GET_LOCK(obj) (&((GstRtpSrc*)(obj))->lock)
 #define GST_RTP_SRC_LOCK(obj) (g_mutex_lock (GST_RTP_SRC_GET_LOCK(obj)))
index ad773d9..616fdb1 100644 (file)
@@ -72,6 +72,7 @@ struct _GstRtpSrcClass
 };
 
 GType gst_rtp_src_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (rtpsrc);
 
 G_END_DECLS
 #endif /* __GST_RTP_SRC_H__ */
index 8c1d71f..5b8d467 100644 (file)
@@ -9,14 +9,10 @@
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-
   gboolean ret = FALSE;
 
-  ret |= gst_element_register (plugin, "rtpsrc",
-      GST_RANK_PRIMARY + 1, GST_TYPE_RTP_SRC);
-
-  ret |= gst_element_register (plugin, "rtpsink",
-      GST_RANK_PRIMARY + 1, GST_TYPE_RTP_SINK);
+  ret |= GST_ELEMENT_REGISTER (rtpsrc, plugin);
+  ret |= GST_ELEMENT_REGISTER (rtpsink, plugin);
 
   return ret;
 }
index 1374bbb..1737ed8 100644 (file)
@@ -110,6 +110,8 @@ static GstFlowReturn gst_sdp_demux_sink_chain (GstPad * pad, GstObject * parent,
 
 #define gst_sdp_demux_parent_class parent_class
 G_DEFINE_TYPE (GstSDPDemux, gst_sdp_demux, GST_TYPE_BIN);
+GST_ELEMENT_REGISTER_DEFINE (sdpdemux, "sdpdemux", GST_RANK_NONE,
+    GST_TYPE_SDP_DEMUX);
 
 static void
 gst_sdp_demux_class_init (GstSDPDemuxClass * klass)
index 908ac5b..fb8ea44 100644 (file)
@@ -113,6 +113,7 @@ struct _GstSDPDemuxClass {
 };
 
 GType gst_sdp_demux_get_type(void);
+GST_ELEMENT_REGISTER_DECLARE (sdpdemux);
 
 G_END_DECLS
 
index 8a945cd..a9d22fc 100644 (file)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  if (!gst_element_register (plugin, "sdpdemux", GST_RANK_NONE,
-          GST_TYPE_SDP_DEMUX))
-    return FALSE;
-  if (!gst_element_register (plugin, "sdpsrc", GST_RANK_NONE, GST_TYPE_SDP_SRC))
-    return FALSE;
+  gboolean ret = FALSE;
 
-  return TRUE;
+  ret |= GST_ELEMENT_REGISTER (sdpdemux, plugin);
+  ret |= GST_ELEMENT_REGISTER (sdpsrc, plugin);
+
+  return ret;
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 96b483d..184c9bf 100644 (file)
@@ -45,6 +45,7 @@ static void gst_sdp_src_handler_init (gpointer g_iface, gpointer iface_data);
 #define gst_sdp_src_parent_class parent_class
 G_DEFINE_TYPE_WITH_CODE (GstSdpSrc, gst_sdp_src, GST_TYPE_BIN,
     G_IMPLEMENT_INTERFACE (GST_TYPE_URI_HANDLER, gst_sdp_src_handler_init));
+GST_ELEMENT_REGISTER_DEFINE (sdpsrc, "sdpsrc", GST_RANK_NONE, GST_TYPE_SDP_SRC);
 
 static void
 gst_sdp_src_finalize (GObject * object)
index 05f2074..955fc5c 100644 (file)
@@ -57,6 +57,7 @@ struct _GstSdpSrcClass
 };
 
 GType gst_sdp_src_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (sdpsrc);
 
 G_END_DECLS
 #endif /* __GST_SDP_SRC_H__ */
index 434424a..4c4ca72 100644 (file)
@@ -45,6 +45,8 @@ GST_DEBUG_CATEGORY_STATIC (gst_audio_segment_clip_debug);
 
 G_DEFINE_TYPE (GstAudioSegmentClip, gst_audio_segment_clip,
     GST_TYPE_SEGMENT_CLIP);
+GST_ELEMENT_REGISTER_DEFINE (audiosegmentclip, "audiosegmentclip",
+    GST_RANK_NONE, GST_TYPE_AUDIO_SEGMENT_CLIP);
 
 static void
 gst_audio_segment_clip_class_init (GstAudioSegmentClipClass * klass)
index 234172e..ccaa9d7 100644 (file)
@@ -55,6 +55,7 @@ struct _GstAudioSegmentClipClass
 };
 
 GType gst_audio_segment_clip_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (audiosegmentclip);
 
 G_END_DECLS
 
index 34ba58b..7057634 100644 (file)
@@ -45,6 +45,8 @@ GST_DEBUG_CATEGORY_STATIC (gst_video_segment_clip_debug);
 
 G_DEFINE_TYPE (GstVideoSegmentClip, gst_video_segment_clip,
     GST_TYPE_SEGMENT_CLIP);
+GST_ELEMENT_REGISTER_DEFINE (videosegmentclip, "videosegmentclip",
+    GST_RANK_NONE, GST_TYPE_VIDEO_SEGMENT_CLIP);
 
 static void
 gst_video_segment_clip_class_init (GstVideoSegmentClipClass * klass)
index f49f2a4..6f321f1 100644 (file)
@@ -54,6 +54,7 @@ struct _GstVideoSegmentClipClass
 };
 
 GType gst_video_segment_clip_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (videosegmentclip);
 
 G_END_DECLS
 
index 9f4cbb9..358ec55 100644 (file)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  if (!gst_element_register (plugin, "audiosegmentclip", GST_RANK_NONE,
-          GST_TYPE_AUDIO_SEGMENT_CLIP) ||
-      !gst_element_register (plugin, "videosegmentclip", GST_RANK_NONE,
-          GST_TYPE_VIDEO_SEGMENT_CLIP))
-    return FALSE;
+  gboolean ret = FALSE;
 
-  return TRUE;
+  ret |= GST_ELEMENT_REGISTER (audiosegmentclip, plugin);
+  ret |= GST_ELEMENT_REGISTER (videosegmentclip, plugin);
+
+  return ret;
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 6fde346..eb8d1d2 100644 (file)
 #include "config.h"
 #endif
 
+#include "gstsiren.h"
 #include "gstsirendec.h"
 #include "gstsirenenc.h"
 
-
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  if (!gst_siren_dec_plugin_init (plugin))
-    return FALSE;
+  gboolean ret = FALSE;
 
-  if (!gst_siren_enc_plugin_init (plugin))
-    return FALSE;
+  ret |= GST_ELEMENT_REGISTER (sirendec, plugin);
+  ret |= GST_ELEMENT_REGISTER (sirenenc, plugin);
 
-  return TRUE;
+  return ret;
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 045bcd6..3e0baae 100644 (file)
@@ -65,6 +65,8 @@ static GstFlowReturn gst_siren_dec_handle_frame (GstAudioDecoder * dec,
 
 
 G_DEFINE_TYPE (GstSirenDec, gst_siren_dec, GST_TYPE_AUDIO_DECODER);
+GST_ELEMENT_REGISTER_DEFINE (sirendec, "sirendec",
+    GST_RANK_MARGINAL, GST_TYPE_SIREN_DEC);
 
 static void
 gst_siren_dec_class_init (GstSirenDecClass * klass)
@@ -248,10 +250,3 @@ decode_error:
     goto done;
   }
 }
-
-gboolean
-gst_siren_dec_plugin_init (GstPlugin * plugin)
-{
-  return gst_element_register (plugin, "sirendec",
-      GST_RANK_MARGINAL, GST_TYPE_SIREN_DEC);
-}
index 27d7c86..3b5ed83 100644 (file)
@@ -60,8 +60,7 @@ struct _GstSirenDecClass
 };
 
 GType gst_siren_dec_get_type (void);
-
-gboolean gst_siren_dec_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (sirendec);
 
 G_END_DECLS
 
index b54f29c..2392b93 100644 (file)
@@ -62,7 +62,8 @@ static GstFlowReturn gst_siren_enc_handle_frame (GstAudioEncoder * enc,
     GstBuffer * in_buf);
 
 G_DEFINE_TYPE (GstSirenEnc, gst_siren_enc, GST_TYPE_AUDIO_ENCODER);
-
+GST_ELEMENT_REGISTER_DEFINE (sirenenc, "sirenenc",
+    GST_RANK_MARGINAL, GST_TYPE_SIREN_ENC);
 
 static void
 gst_siren_enc_class_init (GstSirenEncClass * klass)
@@ -228,10 +229,3 @@ encode_error:
     goto done;
   }
 }
-
-gboolean
-gst_siren_enc_plugin_init (GstPlugin * plugin)
-{
-  return gst_element_register (plugin, "sirenenc",
-      GST_RANK_MARGINAL, GST_TYPE_SIREN_ENC);
-}
index acfb5e6..3fe1eaa 100644 (file)
@@ -60,8 +60,7 @@ struct _GstSirenEncClass
 };
 
 GType gst_siren_enc_get_type (void);
-
-gboolean gst_siren_enc_plugin_init (GstPlugin * plugin);
+GST_ELEMENT_REGISTER_DECLARE (sirenenc);
 
 G_END_DECLS
 #endif /* __GST_SIREN_ENC_H__ */
index 3bc233a..6fab7ac 100644 (file)
@@ -64,6 +64,7 @@ static void gst_smooth_get_property (GObject * object, guint prop_id,
     GValue * value, GParamSpec * pspec);
 
 G_DEFINE_TYPE (GstSmooth, gst_smooth, GST_TYPE_VIDEO_FILTER);
+GST_ELEMENT_REGISTER_DEFINE (smooth, "smooth", GST_RANK_NONE, GST_TYPE_SMOOTH);
 
 static void
 gst_smooth_class_init (GstSmoothClass * klass)
@@ -277,8 +278,7 @@ gst_smooth_get_property (GObject * object, guint prop_id, GValue * value,
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  return gst_element_register (plugin, "smooth",
-      GST_RANK_NONE, GST_TYPE_SMOOTH);
+  return GST_ELEMENT_REGISTER (smooth, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 3bec383..13ca1b8 100644 (file)
@@ -65,7 +65,7 @@ struct _GstSmoothClass {
 };
 
 GType gst_smooth_get_type(void);
-
+GST_ELEMENT_REGISTER_DECLARE (smooth);
 
 #ifdef __cplusplus
 }
index 8d90518..6a536a2 100644 (file)
@@ -95,6 +95,10 @@ static gboolean speed_src_event (GstPad * pad, GstObject * parent,
     GstEvent * event);
 
 G_DEFINE_TYPE (GstSpeed, gst_speed, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (speed, "speed", GST_RANK_NONE,
+    GST_TYPE_SPEED, GST_DEBUG_CATEGORY_INIT (speed_debug, "speed", 0,
+        "speed element");
+    );
 
 static gboolean
 speed_setcaps (GstPad * pad, GstCaps * caps)
@@ -690,9 +694,7 @@ speed_change_state (GstElement * element, GstStateChange transition)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  GST_DEBUG_CATEGORY_INIT (speed_debug, "speed", 0, "speed element");
-
-  return gst_element_register (plugin, "speed", GST_RANK_NONE, GST_TYPE_SPEED);
+  return GST_ELEMENT_REGISTER (speed, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index d3a0658..2485a66 100644 (file)
@@ -61,6 +61,7 @@ struct _GstSpeedClass {
 };
 
 GType gst_speed_get_type(void);
+GST_ELEMENT_REGISTER_DECLARE (speed);
 
 G_END_DECLS
 
index c16e6ed..e32a70d 100644 (file)
@@ -57,6 +57,7 @@ static void gst_srt_enc_set_property (GObject * object, guint prop_id,
 
 #define parent_class gst_srt_enc_parent_class
 G_DEFINE_TYPE (GstSrtEnc, gst_srt_enc, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE (srtenc, "srtenc", GST_RANK_NONE, GST_TYPE_SRT_ENC);
 
 static void
 gst_srt_enc_append_timestamp_to_string (GstClockTime timestamp, GString * str)
index 4fe83e0..05ff34d 100644 (file)
@@ -58,6 +58,7 @@ struct _GstSrtEnc
 };
 
 GType gst_srt_enc_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (srtenc);
 
 G_END_DECLS
 #endif
index 0637c5b..0e3b682 100644 (file)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gst_element_register (plugin, "srtenc", GST_RANK_NONE, GST_TYPE_SRT_ENC);
-  gst_element_register (plugin, "webvttenc", GST_RANK_NONE,
-      GST_TYPE_WEBVTT_ENC);
+  gboolean ret = FALSE;
 
-  return TRUE;
+  ret |= GST_ELEMENT_REGISTER (srtenc, plugin);
+  ret |= GST_ELEMENT_REGISTER (webvttenc, plugin);
+
+  return ret;
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index c8a54b6..d6cf109 100644 (file)
@@ -58,6 +58,8 @@ static void gst_webvtt_enc_set_property (GObject * object, guint prop_id,
 
 #define parent_class gst_webvtt_enc_parent_class
 G_DEFINE_TYPE (GstWebvttEnc, gst_webvtt_enc, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE (webvttenc, "webvttenc", GST_RANK_NONE,
+    GST_TYPE_WEBVTT_ENC);
 
 static void
 gst_webvtt_enc_append_timestamp_to_string (GstClockTime timestamp,
index ef76a49..e4f2cda 100644 (file)
@@ -60,6 +60,7 @@ struct _GstWebvttEnc
 };
 
 GType gst_webvtt_enc_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (webvttenc);
 
 G_END_DECLS
 #endif
index 330d378..c3757d7 100644 (file)
@@ -111,6 +111,8 @@ G_DEFINE_TYPE_WITH_CODE (GstSwitchBin,
     G_IMPLEMENT_INTERFACE (GST_TYPE_CHILD_PROXY,
         gst_switch_bin_child_proxy_iface_init)
     );
+GST_ELEMENT_REGISTER_DEFINE (switchbin, "switchbin", GST_RANK_NONE,
+    gst_switch_bin_get_type ());
 
 static void gst_switch_bin_unlock_paths_and_notify (GstSwitchBin * switchbin);
 
index 8151067..68b4345 100644 (file)
@@ -81,7 +81,7 @@ struct _GstSwitchBinPath
 
 GType gst_switch_bin_get_type(void);
 GType gst_switch_bin_path_get_type(void);
-
+GST_ELEMENT_REGISTER_DECLARE (switchbin);
 
 G_END_DECLS
 
index a784b24..37f1340 100644 (file)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gboolean ret = TRUE;
-  ret = ret
-      && gst_element_register (plugin, "switchbin", GST_RANK_NONE,
-      gst_switch_bin_get_type ());
-  return ret;
+  return GST_ELEMENT_REGISTER (switchbin, plugin);
 }
 
-
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
     GST_VERSION_MINOR,
     switchbin,
index eff57f1..7f73053 100644 (file)
@@ -84,6 +84,7 @@ GST_STATIC_PAD_TEMPLATE ("vsrc",
 
 #define parent_class gst_avwait_parent_class
 G_DEFINE_TYPE (GstAvWait, gst_avwait, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE (avwait, "avwait", GST_RANK_NONE, GST_TYPE_AVWAIT);
 
 enum
 {
index 8e0bc94..ce892f1 100644 (file)
@@ -98,6 +98,7 @@ struct _GstAvWaitClass
 };
 
 GType gst_avwait_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (avwait);
 
 G_END_DECLS
 #endif /* __GST_AVWAIT_H__ */
index ebb2300..9a91b39 100644 (file)
@@ -161,6 +161,8 @@ static void gst_timecodestamper_update_drop_frame (GstTimeCodeStamper *
 
 G_DEFINE_TYPE (GstTimeCodeStamper, gst_timecodestamper,
     GST_TYPE_BASE_TRANSFORM);
+GST_ELEMENT_REGISTER_DEFINE (timecodestamper, "timecodestamper",
+    GST_RANK_NONE, GST_TYPE_TIME_CODE_STAMPER);
 
 GType
 gst_timecodestamper_source_get_type (void)
index f4387ec..7a9922b 100644 (file)
@@ -161,6 +161,7 @@ struct _GstTimeCodeStamperClass
 };
 
 GType gst_timecodestamper_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (timecodestamper);
 
 GType gst_timecodestamper_source_get_type (void);
 GType gst_timecodestamper_set_get_type (void);
index 245f3aa..59dc288 100644 (file)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gboolean ret;
+  gboolean ret = FALSE;
 
-  ret = gst_element_register (plugin, "timecodestamper", GST_RANK_NONE,
-      GST_TYPE_TIME_CODE_STAMPER);
-
-  ret &= gst_element_register (plugin, "avwait", GST_RANK_NONE,
-      GST_TYPE_AVWAIT);
+  ret |= GST_ELEMENT_REGISTER (timecodestamper, plugin);
+  ret |= GST_ELEMENT_REGISTER (avwait, plugin);
 
   return ret;
 }
index e5c041c..0ceb163 100644 (file)
 #endif
 
 #include "gsttranscoding.h"
+#include "gsttranscodeelements.h"
 #include <gst/gst-i18n-plugin.h>
 #include <gst/pbutils/pbutils.h>
 
 #include <gst/pbutils/missing-plugins.h>
 
-GST_DEBUG_CATEGORY_STATIC (gst_transcodebin_debug);
-#define GST_CAT_DEFAULT gst_transcodebin_debug
+
 
 /**
  * GstTranscodeBin!sink_%u:
@@ -123,7 +123,10 @@ typedef struct
 
 #define DEFAULT_AVOID_REENCODING   FALSE
 
-G_DEFINE_TYPE (GstTranscodeBin, gst_transcode_bin, GST_TYPE_BIN)
+G_DEFINE_TYPE (GstTranscodeBin, gst_transcode_bin, GST_TYPE_BIN);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (transcodebin, "transcodebin", GST_RANK_NONE,
+      GST_TYPE_TRANSCODE_BIN, transcodebin_element_init (plugin));
+
 enum
 {
  PROP_0,
@@ -1011,27 +1014,3 @@ gst_transcode_bin_init (GstTranscodeBin * self)
 
   make_decodebin (self);
 }
-
-static gboolean
-plugin_init (GstPlugin * plugin)
-{
-  gboolean res = TRUE;
-  gst_pb_utils_init ();
-
-  GST_DEBUG_CATEGORY_INIT (gst_transcodebin_debug, "transcodebin", 0,
-      "Transcodebin element");
-
-  res &= gst_element_register (plugin, "transcodebin", GST_RANK_NONE,
-      GST_TYPE_TRANSCODE_BIN);
-
-  res &= gst_element_register (plugin, "uritranscodebin", GST_RANK_NONE,
-      gst_uri_transcode_bin_get_type ());
-
-  return res;
-}
-
-GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
-    GST_VERSION_MINOR,
-    transcode,
-    "A plugin containing elements for transcoding", plugin_init, VERSION,
-    GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
diff --git a/gst/transcode/gsttranscodeelement.c b/gst/transcode/gsttranscodeelement.c
new file mode 100644 (file)
index 0000000..7fae04b
--- /dev/null
@@ -0,0 +1,46 @@
+
+/* GStreamer
+ * Copyright (C) 2019 Thibault Saunier <tsaunier@igalia.com>
+ *
+ * gsttranscodebin.c:
+ *
+ * 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 "gsttranscodeelements.h"
+#include <gst/gst-i18n-plugin.h>
+#include <gst/pbutils/pbutils.h>
+
+#include <gst/pbutils/missing-plugins.h>
+
+GST_DEBUG_CATEGORY_STATIC (gst_transcodebin_debug);
+#define GST_CAT_DEFAULT gst_transcodebin_debug
+
+void
+transcodebin_element_init (GstPlugin * plugin)
+{
+  static gsize res = FALSE;
+
+  if (g_once_init_enter (&res)) {
+    gst_pb_utils_init ();
+    GST_DEBUG_CATEGORY_INIT (gst_transcodebin_debug, "transcodebin", 0,
+        "Transcodebin element");
+    g_once_init_leave (&res, TRUE);
+  }
+}
diff --git a/gst/transcode/gsttranscodeelements.h b/gst/transcode/gsttranscodeelements.h
new file mode 100644 (file)
index 0000000..25d6df3
--- /dev/null
@@ -0,0 +1,33 @@
+/* GStreamer
+ * Copyright (C) 2015 Thibault Saunier <tsaunier@gnome.org>
+ *
+ * gsttranscodebin.c:
+ *
+ * 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_TRANSCODE_ELEMENTS_H__
+#define __GST_TRANSCODE_ELEMENTS_H__
+
+
+#include <gst/gst.h>
+
+void transcodebin_element_init (GstPlugin * plugin);
+
+GST_ELEMENT_REGISTER_DECLARE (transcodebin);
+GST_ELEMENT_REGISTER_DECLARE (uritranscodebin);
+
+#endif /* __GST_TRANSCODE_ELEMENTS_H__ */
diff --git a/gst/transcode/gsttranscodeplugin.c b/gst/transcode/gsttranscodeplugin.c
new file mode 100644 (file)
index 0000000..78fb88a
--- /dev/null
@@ -0,0 +1,43 @@
+/* GStreamer
+ * Copyright (C) 2019 Thibault Saunier <tsaunier@igalia.com>
+ *
+ * gsttranscodebin.c:
+ *
+ * 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 "gsttranscodeelements.h"
+
+
+static gboolean
+plugin_init (GstPlugin * plugin)
+{
+  gboolean res = FALSE;
+
+  res |= GST_ELEMENT_REGISTER (transcodebin, plugin);
+  res |= GST_ELEMENT_REGISTER (uritranscodebin, plugin);
+
+  return res;
+}
+
+GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
+    GST_VERSION_MINOR,
+    transcode,
+    "A plugin containing elements for transcoding", plugin_init, VERSION,
+    GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
index c51ea37..8cf13d3 100644 (file)
@@ -23,6 +23,7 @@
 #endif
 
 #include "gsttranscoding.h"
+#include "gsttranscodeelements.h"
 #if HAVE_GETRUSAGE
 #include "gst-cpu-throttling-clock.h"
 #endif
@@ -73,7 +74,10 @@ typedef struct
 
 #define DEFAULT_AVOID_REENCODING   FALSE
 
-G_DEFINE_TYPE (GstUriTranscodeBin, gst_uri_transcode_bin, GST_TYPE_PIPELINE)
+G_DEFINE_TYPE (GstUriTranscodeBin, gst_uri_transcode_bin, GST_TYPE_PIPELINE);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (uritranscodebin, "uritranscodebin", GST_RANK_NONE,
+    gst_uri_transcode_bin_get_type (), transcodebin_element_init (plugin));
+
 enum
 {
  PROP_0,
index a28af9a..080623e 100644 (file)
@@ -1,4 +1,6 @@
 gsttranscoder_plugin = library('gsttranscode',
+  'gsttranscodeelement.c',
+  'gsttranscodeplugin.c',
   'gsttranscodebin.c',
   'gst-cpu-throttling-clock.c',
   'gsturitranscodebin.c',
index b9be4a7..93e761b 100644 (file)
@@ -112,6 +112,8 @@ G_DEFINE_TYPE_WITH_CODE (GstSceneChange, gst_scene_change,
     GST_TYPE_VIDEO_FILTER,
     GST_DEBUG_CATEGORY_INIT (gst_scene_change_debug_category, "scenechange", 0,
         "debug category for scenechange element"));
+GST_ELEMENT_REGISTER_DEFINE (scenechange, "scenechange",
+    GST_RANK_NONE, gst_scene_change_get_type ());
 
 static void
 gst_scene_change_class_init (GstSceneChangeClass * klass)
index 762c5a8..b339824 100644 (file)
@@ -53,6 +53,7 @@ struct _GstSceneChangeClass
 };
 
 GType gst_scene_change_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (scenechange);
 
 G_END_DECLS
 
index a602759..9251c40 100644 (file)
@@ -57,6 +57,8 @@ static GstFlowReturn gst_video_diff_transform_frame (GstVideoFilter * filter,
 G_DEFINE_TYPE_WITH_CODE (GstVideoDiff, gst_video_diff, GST_TYPE_VIDEO_FILTER,
     GST_DEBUG_CATEGORY_INIT (gst_video_diff_debug_category, "videodiff", 0,
         "debug category for videodiff element"));
+GST_ELEMENT_REGISTER_DEFINE (videodiff, "videodiff",
+    GST_RANK_NONE, GST_TYPE_VIDEO_DIFF);
 
 static void
 gst_video_diff_class_init (GstVideoDiffClass * klass)
index 8d76d70..3df98e6 100644 (file)
@@ -52,6 +52,7 @@ struct _GstVideoDiffClass
 };
 
 GType gst_video_diff_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (videodiff);
 
 G_END_DECLS
 
index 1f361e4..84c50c2 100644 (file)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
+  gboolean ret = FALSE;
 
-  gst_element_register (plugin, "scenechange", GST_RANK_NONE,
-      gst_scene_change_get_type ());
-  gst_element_register (plugin, "zebrastripe", GST_RANK_NONE,
-      gst_zebra_stripe_get_type ());
-  return gst_element_register (plugin, "videodiff", GST_RANK_NONE,
-      GST_TYPE_VIDEO_DIFF);
+  ret |= GST_ELEMENT_REGISTER (scenechange, plugin);
+  ret |= GST_ELEMENT_REGISTER (zebrastripe, plugin);
+  ret |= GST_ELEMENT_REGISTER (videodiff, plugin);
 
-  return TRUE;
+  return ret;
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index e14ab99..b62b665 100644 (file)
@@ -88,6 +88,8 @@ G_DEFINE_TYPE_WITH_CODE (GstZebraStripe, gst_zebra_stripe,
     GST_TYPE_VIDEO_FILTER,
     GST_DEBUG_CATEGORY_INIT (gst_zebra_stripe_debug_category, "zebrastripe", 0,
         "debug category for zebrastripe element"));
+GST_ELEMENT_REGISTER_DEFINE (zebrastripe, "zebrastripe",
+    GST_RANK_NONE, gst_zebra_stripe_get_type ());
 
 static void
 gst_zebra_stripe_class_init (GstZebraStripeClass * klass)
index 479ce5c..5f2e7bf 100644 (file)
@@ -52,6 +52,7 @@ struct _GstZebraStripeClass
 };
 
 GType gst_zebra_stripe_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (zebrastripe);
 
 G_END_DECLS
 
index bd5b43d..cb1390d 100644 (file)
@@ -86,6 +86,8 @@ GST_STATIC_PAD_TEMPLATE ("vsrc",
 #define parent_class gst_videoframe_audiolevel_parent_class
 G_DEFINE_TYPE (GstVideoFrameAudioLevel, gst_videoframe_audiolevel,
     GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE (videoframe_audiolevel, "videoframe-audiolevel",
+    GST_RANK_NONE, GST_TYPE_VIDEOFRAME_AUDIOLEVEL);
 
 static GstFlowReturn gst_videoframe_audiolevel_asink_chain (GstPad * pad,
     GstObject * parent, GstBuffer * inbuf);
@@ -777,8 +779,7 @@ out:
 static gboolean
 gst_videoframe_audiolevel_plugin_init (GstPlugin * plugin)
 {
-  return gst_element_register (plugin, "videoframe-audiolevel",
-      GST_RANK_NONE, GST_TYPE_VIDEOFRAME_AUDIOLEVEL);
+  return GST_ELEMENT_REGISTER (videoframe_audiolevel, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index 83332e5..320132d 100644 (file)
@@ -68,6 +68,7 @@ struct _GstVideoFrameAudioLevelClass
 };
 
 GType gst_videoframe_audiolevel_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (videoframe_audiolevel);
 
 G_END_DECLS
 #endif /* __GST_VIDEOFRAME_AUDIOLEVEL_H__ */
index 048d656..a2c0edc 100644 (file)
@@ -73,6 +73,7 @@
 #include <gst/base/gstbitwriter.h>
 #include <gst/codecparsers/gstav1parser.h>
 #include <gst/video/video.h>
+#include "gstvideoparserselements.h"
 #include "gstav1parse.h"
 
 #include <string.h>
@@ -137,6 +138,8 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
 
 #define parent_class gst_av1_parse_parent_class
 G_DEFINE_TYPE (GstAV1Parse, gst_av1_parse, GST_TYPE_BASE_PARSE);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (av1parse, "av1parse", GST_RANK_SECONDARY,
+    GST_TYPE_AV1_PARSE, videoparsers_element_init (plugin));
 
 static void
 remove_fields (GstCaps * caps, gboolean all)
index 105f4f4..d7a0c92 100644 (file)
@@ -38,6 +38,7 @@
 #include <gst/base/base.h>
 #include <gst/pbutils/pbutils.h>
 #include <string.h>
+#include "gstvideoparserselements.h"
 #include "gstdiracparse.h"
 #include "dirac_parse.h"
 
@@ -96,6 +97,8 @@ GST_STATIC_PAD_TEMPLATE ("src",
 
 #define parent_class gst_dirac_parse_parent_class
 G_DEFINE_TYPE (GstDiracParse, gst_dirac_parse, GST_TYPE_BASE_PARSE);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (diracparse, "diracparse", GST_RANK_NONE,
+    GST_TYPE_DIRAC_PARSE, videoparsers_element_init (plugin));
 
 static void
 gst_dirac_parse_class_init (GstDiracParseClass * klass)
index 0f4d42e..d2c1e49 100644 (file)
@@ -31,6 +31,7 @@
 
 #include <gst/base/base.h>
 #include <gst/pbutils/pbutils.h>
+#include "gstvideoparserselements.h"
 #include "gsth263parse.h"
 
 #include <string.h>
@@ -53,6 +54,9 @@ GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK,
 
 #define parent_class gst_h263_parse_parent_class
 G_DEFINE_TYPE (GstH263Parse, gst_h263_parse, GST_TYPE_BASE_PARSE);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (h263parse, "h263parse",
+    GST_RANK_PRIMARY + 1, GST_TYPE_H263_PARSE,
+    videoparsers_element_init (plugin));
 
 static gboolean gst_h263_parse_start (GstBaseParse * parse);
 static gboolean gst_h263_parse_stop (GstBaseParse * parse);
index 621b1b0..ef265d3 100644 (file)
@@ -29,6 +29,7 @@
 #include <gst/base/base.h>
 #include <gst/pbutils/pbutils.h>
 #include <gst/video/video.h>
+#include "gstvideoparserselements.h"
 #include "gsth264parse.h"
 
 #include <string.h>
@@ -98,6 +99,9 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
 
 #define parent_class gst_h264_parse_parent_class
 G_DEFINE_TYPE (GstH264Parse, gst_h264_parse, GST_TYPE_BASE_PARSE);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (h264parse, "h264parse",
+    GST_RANK_PRIMARY + 1, GST_TYPE_H264_PARSE,
+    videoparsers_element_init (plugin));
 
 static void gst_h264_parse_finalize (GObject * object);
 
index 7f45337..977bc9d 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <gst/base/base.h>
 #include <gst/pbutils/pbutils.h>
+#include "gstvideoparserselements.h"
 #include "gsth265parse.h"
 
 #include <string.h>
@@ -91,6 +92,9 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
 
 #define parent_class gst_h265_parse_parent_class
 G_DEFINE_TYPE (GstH265Parse, gst_h265_parse, GST_TYPE_BASE_PARSE);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (h265parse, "h265parse",
+    GST_RANK_SECONDARY, GST_TYPE_H265_PARSE,
+    videoparsers_element_init (plugin));
 
 static void gst_h265_parse_finalize (GObject * object);
 
index 170b920..3ba0358 100644 (file)
@@ -22,6 +22,7 @@
 #  include "config.h"
 #endif
 
+#include "gstvideoparserselements.h"
 #include "gstjpeg2000parse.h"
 #include <gst/base/base.h>
 
@@ -117,6 +118,9 @@ static GstStaticPadTemplate sinktemplate =
 
 #define parent_class gst_jpeg2000_parse_parent_class
 G_DEFINE_TYPE (GstJPEG2000Parse, gst_jpeg2000_parse, GST_TYPE_BASE_PARSE);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (jpeg2000parse, "jpeg2000parse",
+    GST_RANK_PRIMARY, GST_TYPE_JPEG2000_PARSE,
+    videoparsers_element_init (plugin));
 
 static gboolean gst_jpeg2000_parse_start (GstBaseParse * parse);
 static gboolean gst_jpeg2000_parse_event (GstBaseParse * parse,
index 53dddd4..4b133ad 100644 (file)
@@ -33,6 +33,7 @@
 #include <gst/pbutils/pbutils.h>
 #include <gst/video/video.h>
 
+#include "gstvideoparserselements.h"
 #include "gstmpeg4videoparse.h"
 
 GST_DEBUG_CATEGORY (mpeg4v_parse_debug);
@@ -71,6 +72,9 @@ enum
 
 #define gst_mpeg4vparse_parent_class parent_class
 G_DEFINE_TYPE (GstMpeg4VParse, gst_mpeg4vparse, GST_TYPE_BASE_PARSE);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (mpeg4videoparse, "mpeg4videoparse",
+    GST_RANK_PRIMARY + 1, GST_TYPE_MPEG4VIDEO_PARSE,
+    videoparsers_element_init (plugin));
 
 static gboolean gst_mpeg4vparse_start (GstBaseParse * parse);
 static gboolean gst_mpeg4vparse_stop (GstBaseParse * parse);
index 6e27dee..f8ef31a 100644 (file)
@@ -31,6 +31,7 @@
 #include <gst/pbutils/pbutils.h>
 #include <gst/codecparsers/gstmpegvideometa.h>
 
+#include "gstvideoparserselements.h"
 #include "gstmpegvideoparse.h"
 
 GST_DEBUG_CATEGORY (mpegv_parse_debug);
@@ -64,6 +65,9 @@ enum
 
 #define parent_class gst_mpegv_parse_parent_class
 G_DEFINE_TYPE (GstMpegvParse, gst_mpegv_parse, GST_TYPE_BASE_PARSE);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (mpegvideoparse, "mpegvideoparse",
+    GST_RANK_PRIMARY + 1, GST_TYPE_MPEGVIDEO_PARSE,
+    videoparsers_element_init (plugin));
 
 static gboolean gst_mpegv_parse_start (GstBaseParse * parse);
 static gboolean gst_mpegv_parse_stop (GstBaseParse * parse);
index 6df53bd..81621d9 100644 (file)
@@ -22,6 +22,7 @@
 #  include "config.h"
 #endif
 
+#include "gstvideoparserselements.h"
 #include "gstpngparse.h"
 
 #include <gst/base/base.h>
@@ -47,6 +48,8 @@ GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK,
 
 #define parent_class gst_png_parse_parent_class
 G_DEFINE_TYPE (GstPngParse, gst_png_parse, GST_TYPE_BASE_PARSE);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (pngparse, "pngparse", GST_RANK_PRIMARY,
+    GST_TYPE_PNG_PARSE, videoparsers_element_init (plugin));
 
 static gboolean gst_png_parse_start (GstBaseParse * parse);
 static gboolean gst_png_parse_event (GstBaseParse * parse, GstEvent * event);
index 68033df..74f3b96 100644 (file)
@@ -79,6 +79,7 @@
 #include "config.h"
 #endif
 
+#include "gstvideoparserselements.h"
 #include "gstvc1parse.h"
 
 #include <gst/base/base.h>
@@ -186,6 +187,8 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
 
 #define parent_class gst_vc1_parse_parent_class
 G_DEFINE_TYPE (GstVC1Parse, gst_vc1_parse, GST_TYPE_BASE_PARSE);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (vc1parse, "vc1parse", GST_RANK_NONE,
+    GST_TYPE_VC1_PARSE, videoparsers_element_init (plugin));
 
 static void gst_vc1_parse_finalize (GObject * object);
 
diff --git a/gst/videoparsers/gstvideoparserselement.c b/gst/videoparsers/gstvideoparserselement.c
new file mode 100644 (file)
index 0000000..d555641
--- /dev/null
@@ -0,0 +1,39 @@
+/* GStreamer video parsers
+ * Copyright (C) 2011 Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
+ * Copyright (C) 2009 Tim-Philipp Müller <tim centricular net>
+ *
+ * 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 "gstvideoparserselements.h"
+
+GST_DEBUG_CATEGORY (videoparseutils_debug);
+
+void
+videoparsers_element_init (GstPlugin * plugin)
+{
+  static gsize res = FALSE;
+
+  if (g_once_init_enter (&res)) {
+    GST_DEBUG_CATEGORY_INIT (videoparseutils_debug, "videoparseutils", 0,
+        "video parse utilities");
+    g_once_init_leave (&res, TRUE);
+  }
+}
diff --git a/gst/videoparsers/gstvideoparserselements.h b/gst/videoparsers/gstvideoparserselements.h
new file mode 100644 (file)
index 0000000..a8d40c9
--- /dev/null
@@ -0,0 +1,46 @@
+/* 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_VIDEOPARSERS_ELEMENTS_H__
+#define __GST_VIDEOPARSERS_ELEMENTS_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gst/gst.h>
+
+
+void videoparsers_element_init (GstPlugin * plugin);
+
+GST_ELEMENT_REGISTER_DECLARE (av1parse);
+GST_ELEMENT_REGISTER_DECLARE (diracparse);
+GST_ELEMENT_REGISTER_DECLARE (h263parse);
+GST_ELEMENT_REGISTER_DECLARE (h264parse);
+GST_ELEMENT_REGISTER_DECLARE (h265parse);
+GST_ELEMENT_REGISTER_DECLARE (jpeg2000parse);
+GST_ELEMENT_REGISTER_DECLARE (mpeg4videoparse);
+GST_ELEMENT_REGISTER_DECLARE (mpegvideoparse);
+GST_ELEMENT_REGISTER_DECLARE (pngparse);
+GST_ELEMENT_REGISTER_DECLARE (vc1parse);
+GST_ELEMENT_REGISTER_DECLARE (vp9parse);
+
+#endif /* __GST_VIDEOPARSERS_ELEMENTS_H__ */
index ccf3d8f..79ca9ff 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <gst/codecparsers/gstvp9parser.h>
 #include <gst/video/video.h>
+#include "gstvideoparserselements.h"
 #include "gstvp9parse.h"
 
 #include <string.h>
@@ -74,6 +75,8 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
 
 #define parent_class gst_vp9_parse_parent_class
 G_DEFINE_TYPE (GstVp9Parse, gst_vp9_parse, GST_TYPE_BASE_PARSE);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (vp9parse, "vp9parse", GST_RANK_SECONDARY,
+    GST_TYPE_VP9_PARSE, videoparsers_element_init (plugin));
 
 static gboolean gst_vp9_parse_start (GstBaseParse * parse);
 static gboolean gst_vp9_parse_stop (GstBaseParse * parse);
index 61f3757..147a265 100644 (file)
@@ -1,5 +1,6 @@
 vparse_sources = [
   'plugin.c',
+  'gstvideoparserselement.c',
   'h263parse.c',
   'gsth263parse.c',
   'gstdiracparse.c',
index 9cf2962..069da70 100644 (file)
 #include "config.h"
 #endif
 
-#include "gsth263parse.h"
-#include "gsth264parse.h"
-#include "gstdiracparse.h"
-#include "gstmpegvideoparse.h"
-#include "gstmpeg4videoparse.h"
-#include "gstpngparse.h"
-#include "gstjpeg2000parse.h"
-#include "gstvc1parse.h"
-#include "gsth265parse.h"
-#include "gstvp9parse.h"
-#include "gstav1parse.h"
-
-GST_DEBUG_CATEGORY (videoparseutils_debug);
+#include "gstvideoparserselements.h"
 
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
   gboolean ret = FALSE;
 
-  GST_DEBUG_CATEGORY_INIT (videoparseutils_debug, "videoparseutils", 0,
-      "video parse utilities");
-
-  ret |= gst_element_register (plugin, "h263parse",
-      GST_RANK_PRIMARY + 1, GST_TYPE_H263_PARSE);
-  ret |= gst_element_register (plugin, "h264parse",
-      GST_RANK_PRIMARY + 1, GST_TYPE_H264_PARSE);
-  ret |= gst_element_register (plugin, "diracparse",
-      GST_RANK_NONE, GST_TYPE_DIRAC_PARSE);
-  ret |= gst_element_register (plugin, "mpegvideoparse",
-      GST_RANK_PRIMARY + 1, GST_TYPE_MPEGVIDEO_PARSE);
-  ret |= gst_element_register (plugin, "mpeg4videoparse",
-      GST_RANK_PRIMARY + 1, GST_TYPE_MPEG4VIDEO_PARSE);
-  ret |= gst_element_register (plugin, "pngparse",
-      GST_RANK_PRIMARY, GST_TYPE_PNG_PARSE);
-  ret |= gst_element_register (plugin, "jpeg2000parse",
-      GST_RANK_PRIMARY, GST_TYPE_JPEG2000_PARSE);
-  ret |= gst_element_register (plugin, "h265parse",
-      GST_RANK_SECONDARY, GST_TYPE_H265_PARSE);
-  ret |= gst_element_register (plugin, "vc1parse",
-      GST_RANK_NONE, GST_TYPE_VC1_PARSE);
-
+  ret |= GST_ELEMENT_REGISTER (h263parse, plugin);
+  ret |= GST_ELEMENT_REGISTER (h264parse, plugin);
+  ret |= GST_ELEMENT_REGISTER (diracparse, plugin);
+  ret |= GST_ELEMENT_REGISTER (mpegvideoparse, plugin);
+  ret |= GST_ELEMENT_REGISTER (mpeg4videoparse, plugin);
+  ret |= GST_ELEMENT_REGISTER (pngparse, plugin);
+  ret |= GST_ELEMENT_REGISTER (jpeg2000parse, plugin);
+  ret |= GST_ELEMENT_REGISTER (h265parse, plugin);
+  ret |= GST_ELEMENT_REGISTER (vc1parse, plugin);
   /**
    * element-vp9parse:
    *
    * Since: 1.20
    */
-  ret |= gst_element_register (plugin, "vp9parse",
-      GST_RANK_SECONDARY, GST_TYPE_VP9_PARSE);
-
+  ret |= GST_ELEMENT_REGISTER (vp9parse, plugin);
   /**
    * element-av1parse:
    *
    * Since: 1.20
    */
-  ret |= gst_element_register (plugin, "av1parse",
-      GST_RANK_SECONDARY, GST_TYPE_AV1_PARSE);
+  ret |= GST_ELEMENT_REGISTER (av1parse, plugin);
 
   return ret;
 }
index 30d9914..2b7606a 100644 (file)
@@ -106,6 +106,8 @@ G_DEFINE_TYPE_WITH_CODE (GstSimpleVideoMark, gst_video_mark,
     GST_TYPE_VIDEO_FILTER,
     GST_DEBUG_CATEGORY_INIT (gst_video_mark_debug_category, "simplevideomark",
         0, "debug category for simplevideomark element"));
+GST_ELEMENT_REGISTER_DEFINE (simplevideomark, "simplevideomark",
+    GST_RANK_NONE, GST_TYPE_SIMPLE_VIDEO_MARK);
 
 static void
 gst_video_mark_class_init (GstSimpleVideoMarkClass * klass)
index 63bc311..e4b8136 100644 (file)
@@ -56,6 +56,8 @@ struct _GstSimpleVideoMarkClass
 
 GType gst_video_mark_get_type (void);
 
+GST_ELEMENT_REGISTER_DECLARE (simplevideomark);
+
 G_END_DECLS
 
 #endif
index 112d5d8..5f806bc 100644 (file)
@@ -128,6 +128,8 @@ G_DEFINE_TYPE_WITH_CODE (GstSimpleVideoMarkDetect, gst_video_detect,
     GST_DEBUG_CATEGORY_INIT (gst_video_detect_debug_category,
         "simplevideomarkdetect", 0,
         "debug category for simplevideomarkdetect element"));
+GST_ELEMENT_REGISTER_DEFINE (simplevideomarkdetect,
+    "simplevideomarkdetect", GST_RANK_NONE, GST_TYPE_SIMPLE_VIDEO_MARK_DETECT);
 
 static void
 gst_video_detect_class_init (GstSimpleVideoMarkDetectClass * klass)
index 5138686..f7628c2 100644 (file)
@@ -58,6 +58,8 @@ struct _GstSimpleVideoMarkDetectClass
 
 GType gst_video_detect_get_type (void);
 
+GST_ELEMENT_REGISTER_DECLARE (simplevideomarkdetect);
+
 G_END_DECLS
 
 #endif
index ab51f52..99f814a 100644 (file)
@@ -87,6 +87,8 @@ G_DEFINE_TYPE_WITH_CODE (GstVideoAnalyse, gst_video_analyse,
     GST_TYPE_VIDEO_FILTER,
     GST_DEBUG_CATEGORY_INIT (gst_video_analyse_debug_category, "videoanalyse",
         0, "debug category for videoanalyse element"));
+GST_ELEMENT_REGISTER_DEFINE (videoanalyse, "videoanalyse",
+    GST_RANK_NONE, GST_TYPE_VIDEO_ANALYSE);
 
 static void
 gst_video_analyse_class_init (GstVideoAnalyseClass * klass)
index ee61672..2490c08 100644 (file)
@@ -52,6 +52,8 @@ struct _GstVideoAnalyseClass
 
 GType gst_video_analyse_get_type (void);
 
+GST_ELEMENT_REGISTER_DECLARE (videoanalyse);
+
 G_END_DECLS
 
 #endif
index 918dc02..76ef12f 100644 (file)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  gboolean res;
-
-  res = gst_element_register (plugin, "videoanalyse", GST_RANK_NONE,
-      GST_TYPE_VIDEO_ANALYSE);
+  gboolean ret = FALSE;
 
+  ret |= GST_ELEMENT_REGISTER (videoanalyse, plugin);
   /* FIXME under no circumstances is anyone allowed to revive the
    * element formerly known as simplevideomarkdetect without changing the name
    * first.  XOXO  --ds  */
+  ret |= GST_ELEMENT_REGISTER (simplevideomarkdetect, plugin);
+  ret |= GST_ELEMENT_REGISTER (simplevideomark, plugin);
 
-  res &= gst_element_register (plugin, "simplevideomarkdetect", GST_RANK_NONE,
-      GST_TYPE_SIMPLE_VIDEO_MARK_DETECT);
-
-  res &= gst_element_register (plugin, "simplevideomark", GST_RANK_NONE,
-      GST_TYPE_SIMPLE_VIDEO_MARK);
-
-  return res;
+  return ret;
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index cc51c20..93c34e7 100644 (file)
@@ -79,6 +79,8 @@ GST_STATIC_PAD_TEMPLATE ("sink",
     );
 
 G_DEFINE_TYPE (GstVMncDec, gst_vmnc_dec, GST_TYPE_VIDEO_DECODER);
+GST_ELEMENT_REGISTER_DEFINE (vmncdec, "vmncdec", GST_RANK_PRIMARY,
+    GST_TYPE_VMNC_DEC);
 
 static void
 gst_vmnc_dec_class_init (GstVMncDecClass * klass)
@@ -957,10 +959,7 @@ gst_vmnc_dec_parse (GstVideoDecoder * decoder, GstVideoCodecFrame * frame,
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-  if (!gst_element_register (plugin, "vmncdec", GST_RANK_PRIMARY,
-          GST_TYPE_VMNC_DEC))
-    return FALSE;
-  return TRUE;
+  return GST_ELEMENT_REGISTER (vmncdec, plugin);
 }
 
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
index d28ef7d..7bdd3cb 100644 (file)
@@ -104,7 +104,7 @@ typedef struct
 } GstVMncDecClass;
 
 GType gst_vmnc_dec_get_type (void);
-
+GST_ELEMENT_REGISTER_DECLARE (vmncdec);
 
 G_END_DECLS
 
index da8ae38..bae28f4 100644 (file)
@@ -92,7 +92,9 @@ GST_STATIC_PAD_TEMPLATE ("src",
 /* class initialization */
 #define gst_y4m_dec_parent_class parent_class
 G_DEFINE_TYPE (GstY4mDec, gst_y4m_dec, GST_TYPE_ELEMENT);
-
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (y4mdec, "y4mdec", GST_RANK_SECONDARY,
+    gst_y4m_dec_get_type (), GST_DEBUG_CATEGORY_INIT (y4mdec_debug, "y4mdec", 0,
+        "y4mdec element"));
 static void
 gst_y4m_dec_class_init (GstY4mDecClass * klass)
 {
@@ -894,16 +896,9 @@ gst_y4m_dec_src_query (GstPad * pad, GstObject * parent, GstQuery * query)
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
-
-  gst_element_register (plugin, "y4mdec", GST_RANK_SECONDARY,
-      gst_y4m_dec_get_type ());
-
-  GST_DEBUG_CATEGORY_INIT (y4mdec_debug, "y4mdec", 0, "y4mdec element");
-
-  return TRUE;
+  return GST_ELEMENT_REGISTER (y4mdec, plugin);
 }
 
-
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
     GST_VERSION_MINOR,
     y4mdec,
index c2eb9b0..9e56e2f 100644 (file)
@@ -62,6 +62,7 @@ struct _GstY4mDecClass
 };
 
 GType gst_y4m_dec_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (y4mdec);
 
 G_END_DECLS