summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStéphane Cerveau <scerveau@collabora.com>2021-02-25 15:22:15 +0100
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2021-04-11 16:16:55 +0000
commit891be511057dbcdf1f38740e55cbd376c4b25894 (patch)
treeb077e8cd0b584ebe2a10950ef2398ab3f60b48b4
parent7f60138ef68e2a1fef8ccd4ff3710dfccd243314 (diff)
gst-plugins: allow per feature registration
Split plugin into features including dynamic types which can be indiviually registered during a static build. More details here: https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/199 https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/661 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2110>
-rw-r--r--gst/accurip/gstaccurip.c15
-rw-r--r--gst/accurip/gstaccurip.h2
-rw-r--r--gst/adpcmdec/adpcmdec.c14
-rw-r--r--gst/adpcmenc/adpcmenc.c14
-rw-r--r--gst/aiff/aiff.c33
-rw-r--r--gst/aiff/aiffelements.h35
-rw-r--r--gst/aiff/aiffmux.c6
-rw-r--r--gst/aiff/aiffparse.c6
-rw-r--r--gst/aiff/gstaiffelement.c50
-rw-r--r--gst/aiff/meson.build2
-rw-r--r--gst/asfmux/gstasf.c17
-rw-r--r--gst/asfmux/gstasfmux.c9
-rw-r--r--gst/asfmux/gstasfmux.h2
-rw-r--r--gst/asfmux/gstasfparse.c9
-rw-r--r--gst/asfmux/gstasfparse.h2
-rw-r--r--gst/asfmux/gstrtpasfpay.c9
-rw-r--r--gst/asfmux/gstrtpasfpay.h3
-rw-r--r--gst/audiobuffersplit/gstaudiobuffersplit.c14
-rw-r--r--gst/audiobuffersplit/gstaudiobuffersplit.h1
-rw-r--r--gst/audiofxbad/gstaudiochannelmix.c2
-rw-r--r--gst/audiofxbad/gstaudiochannelmix.h2
-rw-r--r--gst/audiofxbad/gstaudiofxbad.c3
-rw-r--r--gst/audiolatency/gstaudiolatency.c12
-rw-r--r--gst/audiolatency/gstaudiolatency.h2
-rw-r--r--gst/audiomixmatrix/gstaudiomixmatrix.c5
-rw-r--r--gst/audiomixmatrix/gstaudiomixmatrix.h2
-rw-r--r--gst/audiovisualizers/gstspacescope.c15
-rw-r--r--gst/audiovisualizers/gstspacescope.h3
-rw-r--r--gst/audiovisualizers/gstspectrascope.c16
-rw-r--r--gst/audiovisualizers/gstspectrascope.h3
-rw-r--r--gst/audiovisualizers/gstsynaescope.c15
-rw-r--r--gst/audiovisualizers/gstsynaescope.h3
-rw-r--r--gst/audiovisualizers/gstwavescope.c15
-rw-r--r--gst/audiovisualizers/gstwavescope.h3
-rw-r--r--gst/audiovisualizers/plugin.c13
-rw-r--r--gst/autoconvert/gstautoconvert.c2
-rw-r--r--gst/autoconvert/gstautoconvert.h1
-rw-r--r--gst/autoconvert/gstautovideoconvert.c2
-rw-r--r--gst/autoconvert/gstautovideoconvert.h1
-rw-r--r--gst/autoconvert/plugin.c9
-rw-r--r--gst/bayer/gstbayer.c14
-rw-r--r--gst/bayer/gstbayer2rgb.c3
-rw-r--r--gst/bayer/gstbayerelements.h33
-rw-r--r--gst/bayer/gstrgb2bayer.c3
-rw-r--r--gst/camerabin2/gstcamerabin2.c14
-rw-r--r--gst/camerabin2/gstcamerabin2.h2
-rw-r--r--gst/camerabin2/gstplugin.c13
-rw-r--r--gst/camerabin2/gstviewfinderbin.c14
-rw-r--r--gst/camerabin2/gstviewfinderbin.h2
-rw-r--r--gst/camerabin2/gstwrappercamerabinsrc.c9
-rw-r--r--gst/camerabin2/gstwrappercamerabinsrc.h2
-rw-r--r--gst/coloreffects/gstchromahold.c2
-rw-r--r--gst/coloreffects/gstchromahold.h1
-rw-r--r--gst/coloreffects/gstcoloreffects.c2
-rw-r--r--gst/coloreffects/gstcoloreffects.h1
-rw-r--r--gst/coloreffects/gstplugin.c23
-rw-r--r--gst/debugutils/debugutilsbad.c50
-rw-r--r--gst/debugutils/fpsdisplaysink.c4
-rw-r--r--gst/debugutils/gstchecksumsink.c3
-rw-r--r--gst/debugutils/gstchopmydata.c3
-rw-r--r--gst/debugutils/gstclockselect.c3
-rw-r--r--gst/debugutils/gstcompare.c3
-rw-r--r--gst/debugutils/gstdebugspy.c3
-rw-r--r--gst/debugutils/gstdebugutilsbadelements.h43
-rw-r--r--gst/debugutils/gsterrorignore.c3
-rw-r--r--gst/debugutils/gstfakeaudiosink.c3
-rw-r--r--gst/debugutils/gstfakevideosink.c3
-rw-r--r--gst/debugutils/gsttestsrcbin.c4
-rw-r--r--gst/debugutils/gstwatchdog.c3
-rw-r--r--gst/dvbsubenc/gstdvbsubenc.c14
-rw-r--r--gst/dvbsubenc/gstdvbsubenc.h1
-rw-r--r--gst/dvbsuboverlay/gstdvbsuboverlay.c11
-rw-r--r--gst/dvbsuboverlay/gstdvbsuboverlay.h1
-rw-r--r--gst/dvdspu/gstdvdspu.c11
-rw-r--r--gst/dvdspu/gstdvdspu.h1
-rw-r--r--gst/faceoverlay/gstfaceoverlay.c13
-rw-r--r--gst/faceoverlay/gstfaceoverlay.h1
-rw-r--r--gst/festival/gstfestival.c18
-rw-r--r--gst/festival/gstfestival.h1
-rw-r--r--gst/fieldanalysis/gstfieldanalysis.c14
-rw-r--r--gst/fieldanalysis/gstfieldanalysis.h1
-rw-r--r--gst/freeverb/gstfreeverb.c5
-rw-r--r--gst/freeverb/gstfreeverb.h1
-rw-r--r--gst/gaudieffects/gstburn.c21
-rw-r--r--gst/gaudieffects/gstburn.h1
-rw-r--r--gst/gaudieffects/gstchromium.c23
-rw-r--r--gst/gaudieffects/gstchromium.h1
-rw-r--r--gst/gaudieffects/gstdilate.c16
-rw-r--r--gst/gaudieffects/gstdilate.h1
-rw-r--r--gst/gaudieffects/gstdodge.c15
-rw-r--r--gst/gaudieffects/gstdodge.h1
-rw-r--r--gst/gaudieffects/gstexclusion.c17
-rw-r--r--gst/gaudieffects/gstexclusion.h1
-rw-r--r--gst/gaudieffects/gstgaussblur.c18
-rw-r--r--gst/gaudieffects/gstgaussblur.h1
-rw-r--r--gst/gaudieffects/gstplugin.c25
-rw-r--r--gst/gaudieffects/gstplugin.h63
-rw-r--r--gst/gaudieffects/gstsolarize.c17
-rw-r--r--gst/gaudieffects/gstsolarize.h1
-rw-r--r--gst/gdp/gstgdp.c14
-rw-r--r--gst/gdp/gstgdpdepay.c13
-rw-r--r--gst/gdp/gstgdpdepay.h2
-rw-r--r--gst/gdp/gstgdpelement.c37
-rw-r--r--gst/gdp/gstgdpelements.h35
-rw-r--r--gst/gdp/gstgdppay.c12
-rw-r--r--gst/gdp/gstgdppay.h2
-rw-r--r--gst/gdp/meson.build1
-rw-r--r--gst/geometrictransform/gstbulge.c11
-rw-r--r--gst/geometrictransform/gstbulge.h2
-rw-r--r--gst/geometrictransform/gstcircle.c12
-rw-r--r--gst/geometrictransform/gstcircle.h2
-rw-r--r--gst/geometrictransform/gstdiffuse.c12
-rw-r--r--gst/geometrictransform/gstdiffuse.h2
-rw-r--r--gst/geometrictransform/gstfisheye.c12
-rw-r--r--gst/geometrictransform/gstfisheye.h2
-rw-r--r--gst/geometrictransform/gstkaleidoscope.c14
-rw-r--r--gst/geometrictransform/gstkaleidoscope.h2
-rw-r--r--gst/geometrictransform/gstmarble.c13
-rw-r--r--gst/geometrictransform/gstmarble.h2
-rw-r--r--gst/geometrictransform/gstmirror.c12
-rw-r--r--gst/geometrictransform/gstmirror.h2
-rw-r--r--gst/geometrictransform/gstperspective.c14
-rw-r--r--gst/geometrictransform/gstperspective.h2
-rw-r--r--gst/geometrictransform/gstpinch.c11
-rw-r--r--gst/geometrictransform/gstpinch.h2
-rw-r--r--gst/geometrictransform/gstrotate.c12
-rw-r--r--gst/geometrictransform/gstrotate.h2
-rw-r--r--gst/geometrictransform/gstsphere.c12
-rw-r--r--gst/geometrictransform/gstsphere.h2
-rw-r--r--gst/geometrictransform/gstsquare.c12
-rw-r--r--gst/geometrictransform/gstsquare.h2
-rw-r--r--gst/geometrictransform/gststretch.c12
-rw-r--r--gst/geometrictransform/gststretch.h2
-rw-r--r--gst/geometrictransform/gsttunnel.c12
-rw-r--r--gst/geometrictransform/gsttunnel.h2
-rw-r--r--gst/geometrictransform/gsttwirl.c11
-rw-r--r--gst/geometrictransform/gsttwirl.h2
-rw-r--r--gst/geometrictransform/gstwaterripple.c14
-rw-r--r--gst/geometrictransform/gstwaterripple.h2
-rw-r--r--gst/geometrictransform/plugin.c69
-rw-r--r--gst/id3tag/gstid3mux.c18
-rw-r--r--gst/id3tag/gstid3mux.h2
-rw-r--r--gst/inter/gstinter.c22
-rw-r--r--gst/inter/gstinteraudiosink.c2
-rw-r--r--gst/inter/gstinteraudiosink.h1
-rw-r--r--gst/inter/gstinteraudiosrc.c2
-rw-r--r--gst/inter/gstinteraudiosrc.h2
-rw-r--r--gst/inter/gstintersubsink.c2
-rw-r--r--gst/inter/gstintersubsink.h1
-rw-r--r--gst/inter/gstintersubsrc.c2
-rw-r--r--gst/inter/gstintersubsrc.h1
-rw-r--r--gst/inter/gstintervideosink.c2
-rw-r--r--gst/inter/gstintervideosink.h1
-rw-r--r--gst/inter/gstintervideosrc.c2
-rw-r--r--gst/inter/gstintervideosrc.h1
-rw-r--r--gst/interlace/gstinterlace.c12
-rw-r--r--gst/ivfparse/gstivfparse.c11
-rw-r--r--gst/ivfparse/gstivfparse.h1
-rw-r--r--gst/ivtc/gstcombdetect.c2
-rw-r--r--gst/ivtc/gstcombdetect.h2
-rw-r--r--gst/ivtc/gstivtc.c6
-rw-r--r--gst/ivtc/gstivtc.h2
-rw-r--r--gst/jp2kdecimator/gstjp2kdecimator.c13
-rw-r--r--gst/jp2kdecimator/gstjp2kdecimator.h1
-rw-r--r--gst/jpegformat/gstjifmux.c2
-rw-r--r--gst/jpegformat/gstjifmux.h2
-rw-r--r--gst/jpegformat/gstjpegformat.c12
-rw-r--r--gst/jpegformat/gstjpegparse.c2
-rw-r--r--gst/jpegformat/gstjpegparse.h2
-rw-r--r--gst/librfb/gstrfbsrc.c4
-rw-r--r--gst/librfb/gstrfbsrc.h1
-rw-r--r--gst/midi/midi.c12
-rw-r--r--gst/midi/midiparse.c2
-rw-r--r--gst/midi/midiparse.h1
-rw-r--r--gst/mpegdemux/gstmpegdemux.c7
-rw-r--r--gst/mpegdemux/gstmpegdemux.h1
-rw-r--r--gst/mpegdemux/plugin.c11
-rw-r--r--gst/mpegpsmux/mpegpsmux.c13
-rw-r--r--gst/mpegpsmux/mpegpsmux.h1
-rw-r--r--gst/mpegtsdemux/gsttsdemux.c14
-rw-r--r--gst/mpegtsdemux/mpegtsbase.c3
-rw-r--r--gst/mpegtsdemux/mpegtsparse.c15
-rw-r--r--gst/mpegtsdemux/mpegtsparse.h3
-rw-r--r--gst/mpegtsdemux/tsdemux.c17
-rw-r--r--gst/mpegtsdemux/tsdemux.h3
-rw-r--r--gst/mpegtsmux/gstatscmux.c2
-rw-r--r--gst/mpegtsmux/gstatscmux.h1
-rw-r--r--gst/mpegtsmux/gstbasetsmux.c3
-rw-r--r--gst/mpegtsmux/gstmpegtsmux.c4
-rw-r--r--gst/mpegtsmux/gstmpegtsmux.h1
-rw-r--r--gst/mpegtsmux/gstmpegtsmuxplugin.c15
-rw-r--r--gst/mxf/gstmxfelement.c82
-rw-r--r--gst/mxf/gstmxfelements.h36
-rw-r--r--gst/mxf/meson.build1
-rw-r--r--gst/mxf/mxf.c59
-rw-r--r--gst/mxf/mxfdemux.c3
-rw-r--r--gst/mxf/mxfmux.c3
-rw-r--r--gst/netsim/gstnetsim.c5
-rw-r--r--gst/netsim/gstnetsim.h1
-rw-r--r--gst/onvif/gstrtponvif.c12
-rw-r--r--gst/onvif/gstrtponvifparse.c2
-rw-r--r--gst/onvif/gstrtponvifparse.h1
-rw-r--r--gst/onvif/gstrtponviftimestamp.c2
-rw-r--r--gst/onvif/gstrtponviftimestamp.h1
-rw-r--r--gst/pcapparse/gstirtspparse.c2
-rw-r--r--gst/pcapparse/gstirtspparse.h1
-rw-r--r--gst/pcapparse/gstpcapparse.c2
-rw-r--r--gst/pcapparse/gstpcapparse.h1
-rw-r--r--gst/pcapparse/plugin.c8
-rw-r--r--gst/pnm/gstpnm.c15
-rw-r--r--gst/pnm/gstpnmdec.c2
-rw-r--r--gst/pnm/gstpnmdec.h2
-rw-r--r--gst/pnm/gstpnmenc.c5
-rw-r--r--gst/pnm/gstpnmenc.h1
-rw-r--r--gst/proxy/gstproxy.c9
-rw-r--r--gst/proxy/gstproxysink.c2
-rw-r--r--gst/proxy/gstproxysink.h1
-rw-r--r--gst/proxy/gstproxysrc.c2
-rw-r--r--gst/proxy/gstproxysrc.h1
-rw-r--r--gst/rawparse/gstaudioparse.c2
-rw-r--r--gst/rawparse/gstaudioparse.h1
-rw-r--r--gst/rawparse/gstvideoparse.c2
-rw-r--r--gst/rawparse/gstvideoparse.h1
-rw-r--r--gst/rawparse/plugin.c8
-rw-r--r--gst/removesilence/gstremovesilence.c5
-rw-r--r--gst/removesilence/gstremovesilence.h1
-rw-r--r--gst/rist/gstrist.c93
-rw-r--r--gst/rist/gstrist.h7
-rw-r--r--gst/rist/gstristplugin.c99
-rw-r--r--gst/rist/gstristrtpdeext.c2
-rw-r--r--gst/rist/gstristrtpext.c3
-rw-r--r--gst/rist/gstristrtxreceive.c2
-rw-r--r--gst/rist/gstristrtxsend.c2
-rw-r--r--gst/rist/gstristsink.c2
-rw-r--r--gst/rist/gstristsrc.c2
-rw-r--r--gst/rist/gstroundrobin.c2
-rw-r--r--gst/rist/gstroundrobin.h1
-rw-r--r--gst/rist/meson.build1
-rw-r--r--gst/rtmp2/gstrtmp2.c16
-rw-r--r--gst/rtmp2/gstrtmp2element.c41
-rw-r--r--gst/rtmp2/gstrtmp2elements.h36
-rw-r--r--gst/rtmp2/gstrtmp2sink.c3
-rw-r--r--gst/rtmp2/gstrtmp2src.c3
-rw-r--r--gst/rtmp2/meson.build1
-rw-r--r--gst/rtp/gstrtpsink.c2
-rw-r--r--gst/rtp/gstrtpsink.h1
-rw-r--r--gst/rtp/gstrtpsrc.c2
-rw-r--r--gst/rtp/gstrtpsrc.h1
-rw-r--r--gst/rtp/plugin.c8
-rw-r--r--gst/sdp/gstsdpdemux.c2
-rw-r--r--gst/sdp/gstsdpdemux.h1
-rw-r--r--gst/sdp/gstsdpelem.c11
-rw-r--r--gst/sdp/gstsdpsrc.c1
-rw-r--r--gst/sdp/gstsdpsrc.h1
-rw-r--r--gst/segmentclip/gstaudiosegmentclip.c2
-rw-r--r--gst/segmentclip/gstaudiosegmentclip.h1
-rw-r--r--gst/segmentclip/gstvideosegmentclip.c2
-rw-r--r--gst/segmentclip/gstvideosegmentclip.h1
-rw-r--r--gst/segmentclip/plugin.c11
-rw-r--r--gst/siren/gstsiren.c11
-rw-r--r--gst/siren/gstsirendec.c9
-rw-r--r--gst/siren/gstsirendec.h3
-rw-r--r--gst/siren/gstsirenenc.c10
-rw-r--r--gst/siren/gstsirenenc.h3
-rw-r--r--gst/smooth/gstsmooth.c4
-rw-r--r--gst/smooth/gstsmooth.h2
-rw-r--r--gst/speed/gstspeed.c8
-rw-r--r--gst/speed/gstspeed.h1
-rw-r--r--gst/subenc/gstsrtenc.c1
-rw-r--r--gst/subenc/gstsrtenc.h1
-rw-r--r--gst/subenc/gstsubenc.c9
-rw-r--r--gst/subenc/gstwebvttenc.c2
-rw-r--r--gst/subenc/gstwebvttenc.h1
-rw-r--r--gst/switchbin/gstswitchbin.c2
-rw-r--r--gst/switchbin/gstswitchbin.h2
-rw-r--r--gst/switchbin/plugin.c7
-rw-r--r--gst/timecode/gstavwait.c1
-rw-r--r--gst/timecode/gstavwait.h1
-rw-r--r--gst/timecode/gsttimecodestamper.c2
-rw-r--r--gst/timecode/gsttimecodestamper.h1
-rw-r--r--gst/timecode/plugin.c9
-rw-r--r--gst/transcode/gsttranscodebin.c33
-rw-r--r--gst/transcode/gsttranscodeelement.c46
-rw-r--r--gst/transcode/gsttranscodeelements.h33
-rw-r--r--gst/transcode/gsttranscodeplugin.c43
-rw-r--r--gst/transcode/gsturitranscodebin.c6
-rw-r--r--gst/transcode/meson.build2
-rw-r--r--gst/videofilters/gstscenechange.c2
-rw-r--r--gst/videofilters/gstscenechange.h1
-rw-r--r--gst/videofilters/gstvideodiff.c2
-rw-r--r--gst/videofilters/gstvideodiff.h1
-rw-r--r--gst/videofilters/gstvideofiltersbad.c12
-rw-r--r--gst/videofilters/gstzebrastripe.c2
-rw-r--r--gst/videofilters/gstzebrastripe.h1
-rw-r--r--gst/videoframe_audiolevel/gstvideoframe-audiolevel.c5
-rw-r--r--gst/videoframe_audiolevel/gstvideoframe-audiolevel.h1
-rw-r--r--gst/videoparsers/gstav1parse.c3
-rw-r--r--gst/videoparsers/gstdiracparse.c3
-rw-r--r--gst/videoparsers/gsth263parse.c4
-rw-r--r--gst/videoparsers/gsth264parse.c4
-rw-r--r--gst/videoparsers/gsth265parse.c4
-rw-r--r--gst/videoparsers/gstjpeg2000parse.c4
-rw-r--r--gst/videoparsers/gstmpeg4videoparse.c4
-rw-r--r--gst/videoparsers/gstmpegvideoparse.c4
-rw-r--r--gst/videoparsers/gstpngparse.c3
-rw-r--r--gst/videoparsers/gstvc1parse.c3
-rw-r--r--gst/videoparsers/gstvideoparserselement.c39
-rw-r--r--gst/videoparsers/gstvideoparserselements.h46
-rw-r--r--gst/videoparsers/gstvp9parse.c3
-rw-r--r--gst/videoparsers/meson.build1
-rw-r--r--gst/videoparsers/plugin.c52
-rw-r--r--gst/videosignal/gstsimplevideomark.c2
-rw-r--r--gst/videosignal/gstsimplevideomark.h2
-rw-r--r--gst/videosignal/gstsimplevideomarkdetect.c2
-rw-r--r--gst/videosignal/gstsimplevideomarkdetect.h2
-rw-r--r--gst/videosignal/gstvideoanalyse.c2
-rw-r--r--gst/videosignal/gstvideoanalyse.h2
-rw-r--r--gst/videosignal/gstvideosignal.c16
-rw-r--r--gst/vmnc/vmncdec.c7
-rw-r--r--gst/vmnc/vmncdec.h2
-rw-r--r--gst/y4m/gsty4mdec.c13
-rw-r--r--gst/y4m/gsty4mdec.h1
322 files changed, 1584 insertions, 1200 deletions
diff --git a/gst/accurip/gstaccurip.c b/gst/accurip/gstaccurip.c
index e69c3f4df..efc299564 100644
--- a/gst/accurip/gstaccurip.c
+++ b/gst/accurip/gstaccurip.c
@@ -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,
diff --git a/gst/accurip/gstaccurip.h b/gst/accurip/gstaccurip.h
index e9ecba5b8..88cc101eb 100644
--- a/gst/accurip/gstaccurip.h
+++ b/gst/accurip/gstaccurip.h
@@ -80,6 +80,8 @@ struct _GstAccuripClass
GType gst_accurip_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (accurip);
+
G_END_DECLS
#endif /* __GST_ACCURIP_H__ */
diff --git a/gst/adpcmdec/adpcmdec.c b/gst/adpcmdec/adpcmdec.c
index 3cfa82093..fb25ca5af 100644
--- a/gst/adpcmdec/adpcmdec.c
+++ b/gst/adpcmdec/adpcmdec.c
@@ -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,
diff --git a/gst/adpcmenc/adpcmenc.c b/gst/adpcmenc/adpcmenc.c
index 52962e408..027029cf5 100644
--- a/gst/adpcmenc/adpcmenc.c
+++ b/gst/adpcmenc/adpcmenc.c
@@ -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,
diff --git a/gst/aiff/aiff.c b/gst/aiff/aiff.c
index 8c412034c..5fabbd49e 100644
--- a/gst/aiff/aiff.c
+++ b/gst/aiff/aiff.c
@@ -22,41 +22,16 @@
#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
index 000000000..69b4b515e
--- /dev/null
+++ b/gst/aiff/aiffelements.h
@@ -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__ */
diff --git a/gst/aiff/aiffmux.c b/gst/aiff/aiffmux.c
index 96cac95bb..04cec5bc1 100644
--- a/gst/aiff/aiffmux.c
+++ b/gst/aiff/aiffmux.c
@@ -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)
diff --git a/gst/aiff/aiffparse.c b/gst/aiff/aiffparse.c
index db85a9754..e15543130 100644
--- a/gst/aiff/aiffparse.c
+++ b/gst/aiff/aiffparse.c
@@ -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
index 000000000..3d2f91b15
--- /dev/null
+++ b/gst/aiff/gstaiffelement.c
@@ -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);
+ }
+}
diff --git a/gst/aiff/meson.build b/gst/aiff/meson.build
index a2221b429..cc5ebd36e 100644
--- a/gst/aiff/meson.build
+++ b/gst/aiff/meson.build
@@ -1,5 +1,5 @@
aiff_sources = [
- 'aiff.c', 'aiffmux.c', 'aiffparse.c',
+ 'aiff.c', 'aiffmux.c', 'aiffparse.c', 'gstaiffelement.c'
]
gstaiff = library('gstaiff',
diff --git a/gst/asfmux/gstasf.c b/gst/asfmux/gstasf.c
index 1a00fb49e..eb81165ec 100644
--- a/gst/asfmux/gstasf.c
+++ b/gst/asfmux/gstasf.c
@@ -32,16 +32,13 @@
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,
diff --git a/gst/asfmux/gstasfmux.c b/gst/asfmux/gstasfmux.c
index 1e79c3972..0ab466035 100644
--- a/gst/asfmux/gstasfmux.c
+++ b/gst/asfmux/gstasfmux.c
@@ -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);
-}
diff --git a/gst/asfmux/gstasfmux.h b/gst/asfmux/gstasfmux.h
index f5ebb07eb..741828454 100644
--- a/gst/asfmux/gstasfmux.h
+++ b/gst/asfmux/gstasfmux.h
@@ -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__ */
diff --git a/gst/asfmux/gstasfparse.c b/gst/asfmux/gstasfparse.c
index 6cc75b671..5859c7fcd 100644
--- a/gst/asfmux/gstasfparse.c
+++ b/gst/asfmux/gstasfparse.c
@@ -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);
-}
diff --git a/gst/asfmux/gstasfparse.h b/gst/asfmux/gstasfparse.h
index f01dd2683..3bd91e81d 100644
--- a/gst/asfmux/gstasfparse.h
+++ b/gst/asfmux/gstasfparse.h
@@ -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
diff --git a/gst/asfmux/gstrtpasfpay.c b/gst/asfmux/gstrtpasfpay.c
index 9b1e03204..ad0b20600 100644
--- a/gst/asfmux/gstrtpasfpay.c
+++ b/gst/asfmux/gstrtpasfpay.c
@@ -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);
-}
diff --git a/gst/asfmux/gstrtpasfpay.h b/gst/asfmux/gstrtpasfpay.h
index da990c233..bd2e9e924 100644
--- a/gst/asfmux/gstrtpasfpay.h
+++ b/gst/asfmux/gstrtpasfpay.h
@@ -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__ */
diff --git a/gst/audiobuffersplit/gstaudiobuffersplit.c b/gst/audiobuffersplit/gstaudiobuffersplit.c
index 911c59824..e1ea507a8 100644
--- a/gst/audiobuffersplit/gstaudiobuffersplit.c
+++ b/gst/audiobuffersplit/gstaudiobuffersplit.c
@@ -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,
diff --git a/gst/audiobuffersplit/gstaudiobuffersplit.h b/gst/audiobuffersplit/gstaudiobuffersplit.h
index 31fda864a..021f6b283 100644
--- a/gst/audiobuffersplit/gstaudiobuffersplit.h
+++ b/gst/audiobuffersplit/gstaudiobuffersplit.h
@@ -74,6 +74,7 @@ struct _GstAudioBufferSplitClass {
};
GType gst_audio_buffer_split_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (audiobuffersplit);
G_END_DECLS
diff --git a/gst/audiofxbad/gstaudiochannelmix.c b/gst/audiofxbad/gstaudiochannelmix.c
index c65a5c47c..49190d4da 100644
--- a/gst/audiofxbad/gstaudiochannelmix.c
+++ b/gst/audiofxbad/gstaudiochannelmix.c
@@ -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)
diff --git a/gst/audiofxbad/gstaudiochannelmix.h b/gst/audiofxbad/gstaudiochannelmix.h
index cc2fabae3..dc8b08ce7 100644
--- a/gst/audiofxbad/gstaudiochannelmix.h
+++ b/gst/audiofxbad/gstaudiochannelmix.h
@@ -50,6 +50,8 @@ struct _GstAudioChannelMixClass
GType gst_audio_channel_mix_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (audiochannelmix);
+
G_END_DECLS
#endif
diff --git a/gst/audiofxbad/gstaudiofxbad.c b/gst/audiofxbad/gstaudiofxbad.c
index c0d900f29..29141e0eb 100644
--- a/gst/audiofxbad/gstaudiofxbad.c
+++ b/gst/audiofxbad/gstaudiofxbad.c
@@ -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,
diff --git a/gst/audiolatency/gstaudiolatency.c b/gst/audiolatency/gstaudiolatency.c
index 7e6ec42a3..4ae5bfaf7 100644
--- a/gst/audiolatency/gstaudiolatency.c
+++ b/gst/audiolatency/gstaudiolatency.c
@@ -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,
diff --git a/gst/audiolatency/gstaudiolatency.h b/gst/audiolatency/gstaudiolatency.h
index 22cc427a5..414b833ac 100644
--- a/gst/audiolatency/gstaudiolatency.h
+++ b/gst/audiolatency/gstaudiolatency.h
@@ -65,5 +65,7 @@ struct _GstAudioLatencyClass
GType gst_audiolatency_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (audiolatency);
+
G_END_DECLS
#endif /* __GST_AUDIOLATENCY_H__ */
diff --git a/gst/audiomixmatrix/gstaudiomixmatrix.c b/gst/audiomixmatrix/gstaudiomixmatrix.c
index 77b5c92ed..0d1c9b30a 100644
--- a/gst/audiomixmatrix/gstaudiomixmatrix.c
+++ b/gst/audiomixmatrix/gstaudiomixmatrix.c
@@ -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,
diff --git a/gst/audiomixmatrix/gstaudiomixmatrix.h b/gst/audiomixmatrix/gstaudiomixmatrix.h
index 5321954b4..dcd345655 100644
--- a/gst/audiomixmatrix/gstaudiomixmatrix.h
+++ b/gst/audiomixmatrix/gstaudiomixmatrix.h
@@ -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
diff --git a/gst/audiovisualizers/gstspacescope.c b/gst/audiovisualizers/gstspacescope.c
index b14f7fc62..1cc4b22af 100644
--- a/gst/audiovisualizers/gstspacescope.c
+++ b/gst/audiovisualizers/gstspacescope.c
@@ -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);
-}
diff --git a/gst/audiovisualizers/gstspacescope.h b/gst/audiovisualizers/gstspacescope.h
index 10659fe64..76e59adb2 100644
--- a/gst/audiovisualizers/gstspacescope.h
+++ b/gst/audiovisualizers/gstspacescope.h
@@ -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__ */
diff --git a/gst/audiovisualizers/gstspectrascope.c b/gst/audiovisualizers/gstspectrascope.c
index 5ba73ba11..06077f10a 100644
--- a/gst/audiovisualizers/gstspectrascope.c
+++ b/gst/audiovisualizers/gstspectrascope.c
@@ -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);
-}
diff --git a/gst/audiovisualizers/gstspectrascope.h b/gst/audiovisualizers/gstspectrascope.h
index d063734c3..d3166522a 100644
--- a/gst/audiovisualizers/gstspectrascope.h
+++ b/gst/audiovisualizers/gstspectrascope.h
@@ -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__ */
diff --git a/gst/audiovisualizers/gstsynaescope.c b/gst/audiovisualizers/gstsynaescope.c
index 1e2be0599..bd92d58e3 100644
--- a/gst/audiovisualizers/gstsynaescope.c
+++ b/gst/audiovisualizers/gstsynaescope.c
@@ -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);
-}
diff --git a/gst/audiovisualizers/gstsynaescope.h b/gst/audiovisualizers/gstsynaescope.h
index f6ec26419..fa3ba0646 100644
--- a/gst/audiovisualizers/gstsynaescope.h
+++ b/gst/audiovisualizers/gstsynaescope.h
@@ -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__ */
diff --git a/gst/audiovisualizers/gstwavescope.c b/gst/audiovisualizers/gstwavescope.c
index f584b6992..91a935b25 100644
--- a/gst/audiovisualizers/gstwavescope.c
+++ b/gst/audiovisualizers/gstwavescope.c
@@ -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);
-}
diff --git a/gst/audiovisualizers/gstwavescope.h b/gst/audiovisualizers/gstwavescope.h
index f367f88b8..d3b112fd2 100644
--- a/gst/audiovisualizers/gstwavescope.h
+++ b/gst/audiovisualizers/gstwavescope.h
@@ -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__ */
diff --git a/gst/audiovisualizers/plugin.c b/gst/audiovisualizers/plugin.c
index b93f49193..1bee912d9 100644
--- a/gst/audiovisualizers/plugin.c
+++ b/gst/audiovisualizers/plugin.c
@@ -32,13 +32,14 @@
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,
diff --git a/gst/autoconvert/gstautoconvert.c b/gst/autoconvert/gstautoconvert.c
index 2c2433e03..08ad54a08 100644
--- a/gst/autoconvert/gstautoconvert.c
+++ b/gst/autoconvert/gstautoconvert.c
@@ -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)
diff --git a/gst/autoconvert/gstautoconvert.h b/gst/autoconvert/gstautoconvert.h
index eaa4f02c9..310dfb022 100644
--- a/gst/autoconvert/gstautoconvert.h
+++ b/gst/autoconvert/gstautoconvert.h
@@ -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__ */
diff --git a/gst/autoconvert/gstautovideoconvert.c b/gst/autoconvert/gstautovideoconvert.c
index 5992c78c4..7481e7d18 100644
--- a/gst/autoconvert/gstautovideoconvert.c
+++ b/gst/autoconvert/gstautovideoconvert.c
@@ -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)
diff --git a/gst/autoconvert/gstautovideoconvert.h b/gst/autoconvert/gstautovideoconvert.h
index b3fe894a6..813899363 100644
--- a/gst/autoconvert/gstautovideoconvert.h
+++ b/gst/autoconvert/gstautovideoconvert.h
@@ -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__ */
diff --git a/gst/autoconvert/plugin.c b/gst/autoconvert/plugin.c
index 03c05ab37..fd6d39ceb 100644
--- a/gst/autoconvert/plugin.c
+++ b/gst/autoconvert/plugin.c
@@ -28,13 +28,10 @@
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;
}
diff --git a/gst/bayer/gstbayer.c b/gst/bayer/gstbayer.c
index 70f54d151..c8042a997 100644
--- a/gst/bayer/gstbayer.c
+++ b/gst/bayer/gstbayer.c
@@ -23,19 +23,17 @@
#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,
diff --git a/gst/bayer/gstbayer2rgb.c b/gst/bayer/gstbayer2rgb.c
index e13a5cc0a..109bab246 100644
--- a/gst/bayer/gstbayer2rgb.c
+++ b/gst/bayer/gstbayer2rgb.c
@@ -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
index 000000000..cba956889
--- /dev/null
+++ b/gst/bayer/gstbayerelements.h
@@ -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__ */
diff --git a/gst/bayer/gstrgb2bayer.c b/gst/bayer/gstrgb2bayer.c
index 787fe9950..8adeb779a 100644
--- a/gst/bayer/gstrgb2bayer.c
+++ b/gst/bayer/gstrgb2bayer.c
@@ -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)
diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c
index 502ed736d..6ac5ce4d2 100644
--- a/gst/camerabin2/gstcamerabin2.c
+++ b/gst/camerabin2/gstcamerabin2.c
@@ -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 ());
-}
diff --git a/gst/camerabin2/gstcamerabin2.h b/gst/camerabin2/gstcamerabin2.h
index ba55a7ea0..f478daa11 100644
--- a/gst/camerabin2/gstcamerabin2.h
+++ b/gst/camerabin2/gstcamerabin2.h
@@ -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
diff --git a/gst/camerabin2/gstplugin.c b/gst/camerabin2/gstplugin.c
index 320bb2c9a..bc0c816b7 100644
--- a/gst/camerabin2/gstplugin.c
+++ b/gst/camerabin2/gstplugin.c
@@ -30,14 +30,13 @@
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,
diff --git a/gst/camerabin2/gstviewfinderbin.c b/gst/camerabin2/gstviewfinderbin.c
index 3a96e8956..1c37cef31 100644
--- a/gst/camerabin2/gstviewfinderbin.c
+++ b/gst/camerabin2/gstviewfinderbin.c
@@ -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 ());
-}
diff --git a/gst/camerabin2/gstviewfinderbin.h b/gst/camerabin2/gstviewfinderbin.h
index 3479120f7..28845dbd7 100644
--- a/gst/camerabin2/gstviewfinderbin.h
+++ b/gst/camerabin2/gstviewfinderbin.h
@@ -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
diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c
index 6fd11292a..491007e0d 100644
--- a/gst/camerabin2/gstwrappercamerabinsrc.c
+++ b/gst/camerabin2/gstwrappercamerabinsrc.c
@@ -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 ());
-}
diff --git a/gst/camerabin2/gstwrappercamerabinsrc.h b/gst/camerabin2/gstwrappercamerabinsrc.h
index 90ab0ccd7..66a6723ef 100644
--- a/gst/camerabin2/gstwrappercamerabinsrc.h
+++ b/gst/camerabin2/gstwrappercamerabinsrc.h
@@ -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
diff --git a/gst/coloreffects/gstchromahold.c b/gst/coloreffects/gstchromahold.c
index 1ddb4c072..06b0001bf 100644
--- a/gst/coloreffects/gstchromahold.c
+++ b/gst/coloreffects/gstchromahold.c
@@ -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)
diff --git a/gst/coloreffects/gstchromahold.h b/gst/coloreffects/gstchromahold.h
index ebe74a2c6..4cfea3d82 100644
--- a/gst/coloreffects/gstchromahold.h
+++ b/gst/coloreffects/gstchromahold.h
@@ -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__ */
diff --git a/gst/coloreffects/gstcoloreffects.c b/gst/coloreffects/gstcoloreffects.c
index ecbc3fc4c..68bbb5c01 100644
--- a/gst/coloreffects/gstcoloreffects.c
+++ b/gst/coloreffects/gstcoloreffects.c
@@ -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 }")
diff --git a/gst/coloreffects/gstcoloreffects.h b/gst/coloreffects/gstcoloreffects.h
index 50c9aa02a..c35f78687 100644
--- a/gst/coloreffects/gstcoloreffects.h
+++ b/gst/coloreffects/gstcoloreffects.h
@@ -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__ */
diff --git a/gst/coloreffects/gstplugin.c b/gst/coloreffects/gstplugin.c
index fdd4b5581..071d0c564 100644
--- a/gst/coloreffects/gstplugin.c
+++ b/gst/coloreffects/gstplugin.c
@@ -26,31 +26,16 @@
#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,
diff --git a/gst/debugutils/debugutilsbad.c b/gst/debugutils/debugutilsbad.c
index 51682e9c8..29376a3d9 100644
--- a/gst/debugutils/debugutilsbad.c
+++ b/gst/debugutils/debugutilsbad.c
@@ -23,45 +23,27 @@
#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,
diff --git a/gst/debugutils/fpsdisplaysink.c b/gst/debugutils/fpsdisplaysink.c
index 90c429e9c..fd2b9745b 100644
--- a/gst/debugutils/fpsdisplaysink.c
+++ b/gst/debugutils/fpsdisplaysink.c
@@ -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 ());
diff --git a/gst/debugutils/gstchecksumsink.c b/gst/debugutils/gstchecksumsink.c
index 337fba0f3..37a5d77f6 100644
--- a/gst/debugutils/gstchecksumsink.c
+++ b/gst/debugutils/gstchecksumsink.c
@@ -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)
diff --git a/gst/debugutils/gstchopmydata.c b/gst/debugutils/gstchopmydata.c
index 2d4c4b40a..7689b42b9 100644
--- a/gst/debugutils/gstchopmydata.c
+++ b/gst/debugutils/gstchopmydata.c
@@ -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)
diff --git a/gst/debugutils/gstclockselect.c b/gst/debugutils/gstclockselect.c
index a8f574b7e..663228a39 100644
--- a/gst/debugutils/gstclockselect.c
+++ b/gst/debugutils/gstclockselect.c
@@ -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)
diff --git a/gst/debugutils/gstcompare.c b/gst/debugutils/gstcompare.c
index 196d79b78..31f9ee6a7 100644
--- a/gst/debugutils/gstcompare.c
+++ b/gst/debugutils/gstcompare.c
@@ -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)
diff --git a/gst/debugutils/gstdebugspy.c b/gst/debugutils/gstdebugspy.c
index baacc4bc8..58f30b9e9 100644
--- a/gst/debugutils/gstdebugspy.c
+++ b/gst/debugutils/gstdebugspy.c
@@ -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
index 000000000..71a42cbe1
--- /dev/null
+++ b/gst/debugutils/gstdebugutilsbadelements.h
@@ -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__ */
diff --git a/gst/debugutils/gsterrorignore.c b/gst/debugutils/gsterrorignore.c
index 768d8f7e0..f65ca9210 100644
--- a/gst/debugutils/gsterrorignore.c
+++ b/gst/debugutils/gsterrorignore.c
@@ -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);
diff --git a/gst/debugutils/gstfakeaudiosink.c b/gst/debugutils/gstfakeaudiosink.c
index 8f8c56bf8..89553456f 100644
--- a/gst/debugutils/gstfakeaudiosink.c
+++ b/gst/debugutils/gstfakeaudiosink.c
@@ -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
diff --git a/gst/debugutils/gstfakevideosink.c b/gst/debugutils/gstfakevideosink.c
index ddb2ae1a0..c524ccfe6 100644
--- a/gst/debugutils/gstfakevideosink.c
+++ b/gst/debugutils/gstfakevideosink.c
@@ -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)
diff --git a/gst/debugutils/gsttestsrcbin.c b/gst/debugutils/gsttestsrcbin.c
index 89e18e849..e97556fa3 100644
--- a/gst/debugutils/gsttestsrcbin.c
+++ b/gst/debugutils/gsttestsrcbin.c
@@ -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)
diff --git a/gst/debugutils/gstwatchdog.c b/gst/debugutils/gstwatchdog.c
index a45039a9f..eb12841da 100644
--- a/gst/debugutils/gstwatchdog.c
+++ b/gst/debugutils/gstwatchdog.c
@@ -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)
diff --git a/gst/dvbsubenc/gstdvbsubenc.c b/gst/dvbsubenc/gstdvbsubenc.c
index bde095434..ab25ae24f 100644
--- a/gst/dvbsubenc/gstdvbsubenc.c
+++ b/gst/dvbsubenc/gstdvbsubenc.c
@@ -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,
diff --git a/gst/dvbsubenc/gstdvbsubenc.h b/gst/dvbsubenc/gstdvbsubenc.h
index 76d8f5fd6..507e9f54d 100644
--- a/gst/dvbsubenc/gstdvbsubenc.h
+++ b/gst/dvbsubenc/gstdvbsubenc.h
@@ -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);
diff --git a/gst/dvbsuboverlay/gstdvbsuboverlay.c b/gst/dvbsuboverlay/gstdvbsuboverlay.c
index f28590cd9..d8ac5d6fd 100644
--- a/gst/dvbsuboverlay/gstdvbsuboverlay.c
+++ b/gst/dvbsuboverlay/gstdvbsuboverlay.c
@@ -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,
diff --git a/gst/dvbsuboverlay/gstdvbsuboverlay.h b/gst/dvbsuboverlay/gstdvbsuboverlay.h
index aecfa9d27..518fe664a 100644
--- a/gst/dvbsuboverlay/gstdvbsuboverlay.h
+++ b/gst/dvbsuboverlay/gstdvbsuboverlay.h
@@ -76,6 +76,7 @@ struct _GstDVBSubOverlayClass
};
GType gst_dvbsub_overlay_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (dvbsuboverlay);
G_END_DECLS
diff --git a/gst/dvdspu/gstdvdspu.c b/gst/dvdspu/gstdvdspu.c
index 41c964b0d..2e049b691 100644
--- a/gst/dvdspu/gstdvdspu.c
+++ b/gst/dvdspu/gstdvdspu.c
@@ -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,
diff --git a/gst/dvdspu/gstdvdspu.h b/gst/dvdspu/gstdvdspu.h
index aa8ae77ca..5c8585d23 100644
--- a/gst/dvdspu/gstdvdspu.h
+++ b/gst/dvdspu/gstdvdspu.h
@@ -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),
diff --git a/gst/faceoverlay/gstfaceoverlay.c b/gst/faceoverlay/gstfaceoverlay.c
index 236d483db..12dc6413d 100644
--- a/gst/faceoverlay/gstfaceoverlay.c
+++ b/gst/faceoverlay/gstfaceoverlay.c
@@ -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,
diff --git a/gst/faceoverlay/gstfaceoverlay.h b/gst/faceoverlay/gstfaceoverlay.h
index 810e28adc..315861f81 100644
--- a/gst/faceoverlay/gstfaceoverlay.h
+++ b/gst/faceoverlay/gstfaceoverlay.h
@@ -88,6 +88,7 @@ struct _GstFaceOverlayClass
};
GType gst_face_overlay_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (faceoverlay);
G_END_DECLS
diff --git a/gst/festival/gstfestival.c b/gst/festival/gstfestival.c
index d1637ab46..0876776c0 100644
--- a/gst/festival/gstfestival.c
+++ b/gst/festival/gstfestival.c
@@ -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,
diff --git a/gst/festival/gstfestival.h b/gst/festival/gstfestival.h
index 1e43283da..24cba5c1b 100644
--- a/gst/festival/gstfestival.h
+++ b/gst/festival/gstfestival.h
@@ -116,6 +116,7 @@ struct _GstFestivalClass {
};
GType gst_festival_get_type(void);
+GST_ELEMENT_REGISTER_DECLARE (festival);
#ifdef __cplusplus
}
diff --git a/gst/fieldanalysis/gstfieldanalysis.c b/gst/fieldanalysis/gstfieldanalysis.c
index 644a91ea1..8e8f71970 100644
--- a/gst/fieldanalysis/gstfieldanalysis.c
+++ b/gst/fieldanalysis/gstfieldanalysis.c
@@ -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,
diff --git a/gst/fieldanalysis/gstfieldanalysis.h b/gst/fieldanalysis/gstfieldanalysis.h
index ff68835ec..6269b8bb6 100644
--- a/gst/fieldanalysis/gstfieldanalysis.h
+++ b/gst/fieldanalysis/gstfieldanalysis.h
@@ -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__ */
diff --git a/gst/freeverb/gstfreeverb.c b/gst/freeverb/gstfreeverb.c
index 2ea9ee803..59f727121 100644
--- a/gst/freeverb/gstfreeverb.c
+++ b/gst/freeverb/gstfreeverb.c
@@ -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,
diff --git a/gst/freeverb/gstfreeverb.h b/gst/freeverb/gstfreeverb.h
index ac6f13438..320aefaf7 100644
--- a/gst/freeverb/gstfreeverb.h
+++ b/gst/freeverb/gstfreeverb.h
@@ -62,6 +62,7 @@ struct _GstFreeverbClass {
};
GType gst_freeverb_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (freeverb);
G_END_DECLS
diff --git a/gst/gaudieffects/gstburn.c b/gst/gaudieffects/gstburn.c
index bc5aefb63..e009fd2fe 100644
--- a/gst/gaudieffects/gstburn.c
+++ b/gst/gaudieffects/gstburn.c
@@ -64,17 +64,19 @@
#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);
-}
diff --git a/gst/gaudieffects/gstburn.h b/gst/gaudieffects/gstburn.h
index 5f563f82c..e467e8edb 100644
--- a/gst/gaudieffects/gstburn.h
+++ b/gst/gaudieffects/gstburn.h
@@ -81,6 +81,7 @@ struct _GstBurnClass
};
GType gst_burn_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (burn);
G_END_DECLS
diff --git a/gst/gaudieffects/gstchromium.c b/gst/gaudieffects/gstchromium.c
index 1a3f3666e..24c93aa5b 100644
--- a/gst/gaudieffects/gstchromium.c
+++ b/gst/gaudieffects/gstchromium.c
@@ -64,15 +64,17 @@
#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
diff --git a/gst/gaudieffects/gstchromium.h b/gst/gaudieffects/gstchromium.h
index 8c3b4a000..1b8a44c6d 100644
--- a/gst/gaudieffects/gstchromium.h
+++ b/gst/gaudieffects/gstchromium.h
@@ -79,6 +79,7 @@ struct _GstChromiumClass
};
GType gst_chromium_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (chromium);
G_END_DECLS
diff --git a/gst/gaudieffects/gstdilate.c b/gst/gaudieffects/gstdilate.c
index 2a1e77521..aec92b14f 100644
--- a/gst/gaudieffects/gstdilate.c
+++ b/gst/gaudieffects/gstdilate.c
@@ -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 */
diff --git a/gst/gaudieffects/gstdilate.h b/gst/gaudieffects/gstdilate.h
index afb09018f..c216a352f 100644
--- a/gst/gaudieffects/gstdilate.h
+++ b/gst/gaudieffects/gstdilate.h
@@ -81,6 +81,7 @@ struct _GstDilateClass
};
GType gst_dilate_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (dilate);
G_END_DECLS
diff --git a/gst/gaudieffects/gstdodge.c b/gst/gaudieffects/gstdodge.c
index ee2ce7dbf..db3c251f9 100644
--- a/gst/gaudieffects/gstdodge.c
+++ b/gst/gaudieffects/gstdodge.c
@@ -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. */
diff --git a/gst/gaudieffects/gstdodge.h b/gst/gaudieffects/gstdodge.h
index 64bf4d0cb..53e41c522 100644
--- a/gst/gaudieffects/gstdodge.h
+++ b/gst/gaudieffects/gstdodge.h
@@ -78,6 +78,7 @@ struct _GstDodgeClass
};
GType gst_dodge_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (dodge);
G_END_DECLS
diff --git a/gst/gaudieffects/gstexclusion.c b/gst/gaudieffects/gstexclusion.c
index 6c696b6f3..0fa4658ad 100644
--- a/gst/gaudieffects/gstexclusion.c
+++ b/gst/gaudieffects/gstexclusion.c
@@ -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. */
diff --git a/gst/gaudieffects/gstexclusion.h b/gst/gaudieffects/gstexclusion.h
index b91083560..fc15e704c 100644
--- a/gst/gaudieffects/gstexclusion.h
+++ b/gst/gaudieffects/gstexclusion.h
@@ -81,6 +81,7 @@ struct _GstExclusionClass
};
GType gst_exclusion_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (exclusion);
G_END_DECLS
diff --git a/gst/gaudieffects/gstgaussblur.c b/gst/gaudieffects/gstgaussblur.c
index dc2d479f9..1c274c814 100644
--- a/gst/gaudieffects/gstgaussblur.c
+++ b/gst/gaudieffects/gstgaussblur.c
@@ -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);
-}
diff --git a/gst/gaudieffects/gstgaussblur.h b/gst/gaudieffects/gstgaussblur.h
index 33cbb02c9..bd39ee336 100644
--- a/gst/gaudieffects/gstgaussblur.h
+++ b/gst/gaudieffects/gstgaussblur.h
@@ -81,6 +81,7 @@ struct _GstGaussianBlurClass
};
GType gst_gaussianblur_get_type(void);
+GST_ELEMENT_REGISTER_DECLARE (gaussianblur);
G_END_DECLS
diff --git a/gst/gaudieffects/gstplugin.c b/gst/gaudieffects/gstplugin.c
index 0bcd01148..1f1ceb5bc 100644
--- a/gst/gaudieffects/gstplugin.c
+++ b/gst/gaudieffects/gstplugin.c
@@ -49,7 +49,14 @@
#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
@@ -63,15 +70,15 @@
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
index 5cc42493c..000000000
--- a/gst/gaudieffects/gstplugin.h
+++ /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__ */
diff --git a/gst/gaudieffects/gstsolarize.c b/gst/gaudieffects/gstsolarize.c
index 23a69d0d8..00f317d52 100644
--- a/gst/gaudieffects/gstsolarize.c
+++ b/gst/gaudieffects/gstsolarize.c
@@ -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. */
diff --git a/gst/gaudieffects/gstsolarize.h b/gst/gaudieffects/gstsolarize.h
index 239056306..e81615e19 100644
--- a/gst/gaudieffects/gstsolarize.h
+++ b/gst/gaudieffects/gstsolarize.h
@@ -81,6 +81,7 @@ struct _GstSolarizeClass
};
GType gst_solarize_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (solarize);
G_END_DECLS
diff --git a/gst/gdp/gstgdp.c b/gst/gdp/gstgdp.c
index 4ac3a0f22..d35e778c8 100644
--- a/gst/gdp/gstgdp.c
+++ b/gst/gdp/gstgdp.c
@@ -23,21 +23,17 @@
#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,
diff --git a/gst/gdp/gstgdpdepay.c b/gst/gdp/gstgdpdepay.c
index 750571e6f..f17960bd0 100644
--- a/gst/gdp/gstgdpdepay.c
+++ b/gst/gdp/gstgdpdepay.c
@@ -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;
-}
diff --git a/gst/gdp/gstgdpdepay.h b/gst/gdp/gstgdpdepay.h
index c21f302be..698f9d996 100644
--- a/gst/gdp/gstgdpdepay.h
+++ b/gst/gdp/gstgdpdepay.h
@@ -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
index 000000000..56aaa11fe
--- /dev/null
+++ b/gst/gdp/gstgdpelement.c
@@ -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
index 000000000..29aed343a
--- /dev/null
+++ b/gst/gdp/gstgdpelements.h
@@ -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__ */
diff --git a/gst/gdp/gstgdppay.c b/gst/gdp/gstgdppay.c
index 493472f91..2f132f826 100644
--- a/gst/gdp/gstgdppay.c
+++ b/gst/gdp/gstgdppay.c
@@ -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;
-}
diff --git a/gst/gdp/gstgdppay.h b/gst/gdp/gstgdppay.h
index 2e01eb1fe..0e7b3db2b 100644
--- a/gst/gdp/gstgdppay.h
+++ b/gst/gdp/gstgdppay.h
@@ -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
diff --git a/gst/gdp/meson.build b/gst/gdp/meson.build
index d55d65e28..b76de9221 100644
--- a/gst/gdp/meson.build
+++ b/gst/gdp/meson.build
@@ -1,5 +1,6 @@
gdp_sources = [
'dataprotocol.c',
+ 'gstgdpelement.c',
'gstgdp.c',
'gstgdppay.c',
'gstgdpdepay.c',
diff --git a/gst/geometrictransform/gstbulge.c b/gst/geometrictransform/gstbulge.c
index 315aa0cd2..dc5eebade 100644
--- a/gst/geometrictransform/gstbulge.c
+++ b/gst/geometrictransform/gstbulge.c
@@ -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);
-}
diff --git a/gst/geometrictransform/gstbulge.h b/gst/geometrictransform/gstbulge.h
index 452ae0ebc..dcb2e0435 100644
--- a/gst/geometrictransform/gstbulge.h
+++ b/gst/geometrictransform/gstbulge.h
@@ -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__ */
diff --git a/gst/geometrictransform/gstcircle.c b/gst/geometrictransform/gstcircle.c
index b326fd00b..8e5f48e03 100644
--- a/gst/geometrictransform/gstcircle.c
+++ b/gst/geometrictransform/gstcircle.c
@@ -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);
-}
diff --git a/gst/geometrictransform/gstcircle.h b/gst/geometrictransform/gstcircle.h
index 7b278caa1..ceeec29d8 100644
--- a/gst/geometrictransform/gstcircle.h
+++ b/gst/geometrictransform/gstcircle.h
@@ -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
diff --git a/gst/geometrictransform/gstdiffuse.c b/gst/geometrictransform/gstdiffuse.c
index 36e4e62a2..3be6241c5 100644
--- a/gst/geometrictransform/gstdiffuse.c
+++ b/gst/geometrictransform/gstdiffuse.c
@@ -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);
-}
diff --git a/gst/geometrictransform/gstdiffuse.h b/gst/geometrictransform/gstdiffuse.h
index 31ee9cdb2..a3b6d82cf 100644
--- a/gst/geometrictransform/gstdiffuse.h
+++ b/gst/geometrictransform/gstdiffuse.h
@@ -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
diff --git a/gst/geometrictransform/gstfisheye.c b/gst/geometrictransform/gstfisheye.c
index 7150e3844..8d2d0dde2 100644
--- a/gst/geometrictransform/gstfisheye.c
+++ b/gst/geometrictransform/gstfisheye.c
@@ -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);
-}
diff --git a/gst/geometrictransform/gstfisheye.h b/gst/geometrictransform/gstfisheye.h
index d4d8cbe7d..41ccddba2 100644
--- a/gst/geometrictransform/gstfisheye.h
+++ b/gst/geometrictransform/gstfisheye.h
@@ -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__ */
diff --git a/gst/geometrictransform/gstkaleidoscope.c b/gst/geometrictransform/gstkaleidoscope.c
index 00f988f72..bed2cf96e 100644
--- a/gst/geometrictransform/gstkaleidoscope.c
+++ b/gst/geometrictransform/gstkaleidoscope.c
@@ -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);
-}
diff --git a/gst/geometrictransform/gstkaleidoscope.h b/gst/geometrictransform/gstkaleidoscope.h
index bbe338cb6..c4fd0037e 100644
--- a/gst/geometrictransform/gstkaleidoscope.h
+++ b/gst/geometrictransform/gstkaleidoscope.h
@@ -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
diff --git a/gst/geometrictransform/gstmarble.c b/gst/geometrictransform/gstmarble.c
index f508d2a51..298790262 100644
--- a/gst/geometrictransform/gstmarble.c
+++ b/gst/geometrictransform/gstmarble.c
@@ -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);
-}
diff --git a/gst/geometrictransform/gstmarble.h b/gst/geometrictransform/gstmarble.h
index 2665775ab..61cb7962e 100644
--- a/gst/geometrictransform/gstmarble.h
+++ b/gst/geometrictransform/gstmarble.h
@@ -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
diff --git a/gst/geometrictransform/gstmirror.c b/gst/geometrictransform/gstmirror.c
index e7b29c1a7..d59f95416 100644
--- a/gst/geometrictransform/gstmirror.c
+++ b/gst/geometrictransform/gstmirror.c
@@ -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);
-}
diff --git a/gst/geometrictransform/gstmirror.h b/gst/geometrictransform/gstmirror.h
index 22e6aa5d9..f534ae553 100644
--- a/gst/geometrictransform/gstmirror.h
+++ b/gst/geometrictransform/gstmirror.h
@@ -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__ */
diff --git a/gst/geometrictransform/gstperspective.c b/gst/geometrictransform/gstperspective.c
index e4da32fca..3b7da1871 100644
--- a/gst/geometrictransform/gstperspective.c
+++ b/gst/geometrictransform/gstperspective.c
@@ -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);
-}
diff --git a/gst/geometrictransform/gstperspective.h b/gst/geometrictransform/gstperspective.h
index 03393b7df..db70723c8 100644
--- a/gst/geometrictransform/gstperspective.h
+++ b/gst/geometrictransform/gstperspective.h
@@ -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
diff --git a/gst/geometrictransform/gstpinch.c b/gst/geometrictransform/gstpinch.c
index 798b96586..ffc9b2a94 100644
--- a/gst/geometrictransform/gstpinch.c
+++ b/gst/geometrictransform/gstpinch.c
@@ -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);
-}
diff --git a/gst/geometrictransform/gstpinch.h b/gst/geometrictransform/gstpinch.h
index 896a6d6a3..70d0c75c3 100644
--- a/gst/geometrictransform/gstpinch.h
+++ b/gst/geometrictransform/gstpinch.h
@@ -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
diff --git a/gst/geometrictransform/gstrotate.c b/gst/geometrictransform/gstrotate.c
index d6f65152b..0047e2c0b 100644
--- a/gst/geometrictransform/gstrotate.c
+++ b/gst/geometrictransform/gstrotate.c
@@ -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);
-}
diff --git a/gst/geometrictransform/gstrotate.h b/gst/geometrictransform/gstrotate.h
index ce19d493f..d67d09179 100644
--- a/gst/geometrictransform/gstrotate.h
+++ b/gst/geometrictransform/gstrotate.h
@@ -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
diff --git a/gst/geometrictransform/gstsphere.c b/gst/geometrictransform/gstsphere.c
index 90947a865..37aae47c5 100644
--- a/gst/geometrictransform/gstsphere.c
+++ b/gst/geometrictransform/gstsphere.c
@@ -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);
-}
diff --git a/gst/geometrictransform/gstsphere.h b/gst/geometrictransform/gstsphere.h
index e8028de5d..6e09e39d7 100644
--- a/gst/geometrictransform/gstsphere.h
+++ b/gst/geometrictransform/gstsphere.h
@@ -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
diff --git a/gst/geometrictransform/gstsquare.c b/gst/geometrictransform/gstsquare.c
index 14271bd1e..b27649988 100644
--- a/gst/geometrictransform/gstsquare.c
+++ b/gst/geometrictransform/gstsquare.c
@@ -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);
-}
diff --git a/gst/geometrictransform/gstsquare.h b/gst/geometrictransform/gstsquare.h
index 62cf17362..99d5f5264 100644
--- a/gst/geometrictransform/gstsquare.h
+++ b/gst/geometrictransform/gstsquare.h
@@ -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__ */
diff --git a/gst/geometrictransform/gststretch.c b/gst/geometrictransform/gststretch.c
index 77086f07d..5fe390f39 100644
--- a/gst/geometrictransform/gststretch.c
+++ b/gst/geometrictransform/gststretch.c
@@ -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);
-}
diff --git a/gst/geometrictransform/gststretch.h b/gst/geometrictransform/gststretch.h
index 3f0e9b93e..92e46b79d 100644
--- a/gst/geometrictransform/gststretch.h
+++ b/gst/geometrictransform/gststretch.h
@@ -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__ */
diff --git a/gst/geometrictransform/gsttunnel.c b/gst/geometrictransform/gsttunnel.c
index 2dd9c41e3..b659c5d09 100644
--- a/gst/geometrictransform/gsttunnel.c
+++ b/gst/geometrictransform/gsttunnel.c
@@ -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);
-}
diff --git a/gst/geometrictransform/gsttunnel.h b/gst/geometrictransform/gsttunnel.h
index 28db3aff3..a37755dfd 100644
--- a/gst/geometrictransform/gsttunnel.h
+++ b/gst/geometrictransform/gsttunnel.h
@@ -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__ */
diff --git a/gst/geometrictransform/gsttwirl.c b/gst/geometrictransform/gsttwirl.c
index 54ec46b9c..f1d94cbf5 100644
--- a/gst/geometrictransform/gsttwirl.c
+++ b/gst/geometrictransform/gsttwirl.c
@@ -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);
-}
diff --git a/gst/geometrictransform/gsttwirl.h b/gst/geometrictransform/gsttwirl.h
index 914389470..c6abac74d 100644
--- a/gst/geometrictransform/gsttwirl.h
+++ b/gst/geometrictransform/gsttwirl.h
@@ -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
diff --git a/gst/geometrictransform/gstwaterripple.c b/gst/geometrictransform/gstwaterripple.c
index 2d39df9db..652437729 100644
--- a/gst/geometrictransform/gstwaterripple.c
+++ b/gst/geometrictransform/gstwaterripple.c
@@ -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);
-}
diff --git a/gst/geometrictransform/gstwaterripple.h b/gst/geometrictransform/gstwaterripple.h
index a2680b5a8..2dadeb15f 100644
--- a/gst/geometrictransform/gstwaterripple.h
+++ b/gst/geometrictransform/gstwaterripple.h
@@ -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
diff --git a/gst/geometrictransform/plugin.c b/gst/geometrictransform/plugin.c
index 9622ebb14..d353b2aa7 100644
--- a/gst/geometrictransform/plugin.c
+++ b/gst/geometrictransform/plugin.c
@@ -41,55 +41,26 @@
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,
diff --git a/gst/id3tag/gstid3mux.c b/gst/id3tag/gstid3mux.c
index ccb23f91a..c5b10c4db 100644
--- a/gst/id3tag/gstid3mux.c
+++ b/gst/id3tag/gstid3mux.c
@@ -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,
diff --git a/gst/id3tag/gstid3mux.h b/gst/id3tag/gstid3mux.h
index 69a2e0f01..5017c6994 100644
--- a/gst/id3tag/gstid3mux.h
+++ b/gst/id3tag/gstid3mux.h
@@ -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 */
diff --git a/gst/inter/gstinter.c b/gst/inter/gstinter.c
index e1f88b29f..b71b5de88 100644
--- a/gst/inter/gstinter.c
+++ b/gst/inter/gstinter.c
@@ -32,20 +32,16 @@
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,
diff --git a/gst/inter/gstinteraudiosink.c b/gst/inter/gstinteraudiosink.c
index eaa5b2e65..a33fe8194 100644
--- a/gst/inter/gstinteraudiosink.c
+++ b/gst/inter/gstinteraudiosink.c
@@ -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)
diff --git a/gst/inter/gstinteraudiosink.h b/gst/inter/gstinteraudiosink.h
index 8f8c9a256..c6e3482be 100644
--- a/gst/inter/gstinteraudiosink.h
+++ b/gst/inter/gstinteraudiosink.h
@@ -51,6 +51,7 @@ struct _GstInterAudioSinkClass
};
GType gst_inter_audio_sink_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (interaudiosink);
G_END_DECLS
diff --git a/gst/inter/gstinteraudiosrc.c b/gst/inter/gstinteraudiosrc.c
index 3190955b7..f516a585f 100644
--- a/gst/inter/gstinteraudiosrc.c
+++ b/gst/inter/gstinteraudiosrc.c
@@ -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)
diff --git a/gst/inter/gstinteraudiosrc.h b/gst/inter/gstinteraudiosrc.h
index 131b2af29..e00b406e7 100644
--- a/gst/inter/gstinteraudiosrc.h
+++ b/gst/inter/gstinteraudiosrc.h
@@ -54,7 +54,7 @@ struct _GstInterAudioSrcClass
};
GType gst_inter_audio_src_get_type (void);
-
+GST_ELEMENT_REGISTER_DECLARE (interaudiosrc);
G_END_DECLS
#endif
diff --git a/gst/inter/gstintersubsink.c b/gst/inter/gstintersubsink.c
index 882a1663b..d62f7ce23 100644
--- a/gst/inter/gstintersubsink.c
+++ b/gst/inter/gstintersubsink.c
@@ -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)
diff --git a/gst/inter/gstintersubsink.h b/gst/inter/gstintersubsink.h
index 0a53798a1..81b45a929 100644
--- a/gst/inter/gstintersubsink.h
+++ b/gst/inter/gstintersubsink.h
@@ -52,6 +52,7 @@ struct _GstInterSubSinkClass
};
GType gst_inter_sub_sink_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (intersubsink);
G_END_DECLS
diff --git a/gst/inter/gstintersubsrc.c b/gst/inter/gstintersubsrc.c
index dc42caeda..801a96289 100644
--- a/gst/inter/gstintersubsrc.c
+++ b/gst/inter/gstintersubsrc.c
@@ -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)
diff --git a/gst/inter/gstintersubsrc.h b/gst/inter/gstintersubsrc.h
index a9d757e17..3c6225843 100644
--- a/gst/inter/gstintersubsrc.h
+++ b/gst/inter/gstintersubsrc.h
@@ -51,6 +51,7 @@ struct _GstInterSubSrcClass
};
GType gst_inter_sub_src_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (intersubsrc);
G_END_DECLS
diff --git a/gst/inter/gstintervideosink.c b/gst/inter/gstintervideosink.c
index 12a971a5d..d3dd3bd33 100644
--- a/gst/inter/gstintervideosink.c
+++ b/gst/inter/gstintervideosink.c
@@ -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)
diff --git a/gst/inter/gstintervideosink.h b/gst/inter/gstintervideosink.h
index 096cee242..5b2d280af 100644
--- a/gst/inter/gstintervideosink.h
+++ b/gst/inter/gstintervideosink.h
@@ -50,6 +50,7 @@ struct _GstInterVideoSinkClass
};
GType gst_inter_video_sink_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (intervideosink);
G_END_DECLS
diff --git a/gst/inter/gstintervideosrc.c b/gst/inter/gstintervideosrc.c
index 9e607f336..4a4e07d19 100644
--- a/gst/inter/gstintervideosrc.c
+++ b/gst/inter/gstintervideosrc.c
@@ -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)
diff --git a/gst/inter/gstintervideosrc.h b/gst/inter/gstintervideosrc.h
index 0de36f46a..89ef344d7 100644
--- a/gst/inter/gstintervideosrc.h
+++ b/gst/inter/gstintervideosrc.h
@@ -56,6 +56,7 @@ struct _GstInterVideoSrcClass
};
GType gst_inter_video_src_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (intervideosrc);
G_END_DECLS
diff --git a/gst/interlace/gstinterlace.c b/gst/interlace/gstinterlace.c
index ac109af20..5c7fc7e9d 100644
--- a/gst/interlace/gstinterlace.c
+++ b/gst/interlace/gstinterlace.c
@@ -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,
diff --git a/gst/ivfparse/gstivfparse.c b/gst/ivfparse/gstivfparse.c
index 34675de77..35c0bd5a6 100644
--- a/gst/ivfparse/gstivfparse.c
+++ b/gst/ivfparse/gstivfparse.c
@@ -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 */
diff --git a/gst/ivfparse/gstivfparse.h b/gst/ivfparse/gstivfparse.h
index 1a72f35b1..b37a0f88f 100644
--- a/gst/ivfparse/gstivfparse.h
+++ b/gst/ivfparse/gstivfparse.h
@@ -66,6 +66,7 @@ struct _GstIvfParseClass
};
GType gst_ivf_parse_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (ivfparse);
G_END_DECLS
diff --git a/gst/ivtc/gstcombdetect.c b/gst/ivtc/gstcombdetect.c
index 87b3f73bc..2d29fba2f 100644
--- a/gst/ivtc/gstcombdetect.c
+++ b/gst/ivtc/gstcombdetect.c
@@ -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)
diff --git a/gst/ivtc/gstcombdetect.h b/gst/ivtc/gstcombdetect.h
index 9b10989f9..cd59f60ae 100644
--- a/gst/ivtc/gstcombdetect.h
+++ b/gst/ivtc/gstcombdetect.h
@@ -48,6 +48,8 @@ struct _GstCombDetectClass
GType gst_comb_detect_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (combdetect);
+
G_END_DECLS
#endif
diff --git a/gst/ivtc/gstivtc.c b/gst/ivtc/gstivtc.c
index 2556eed11..c35481e9b 100644
--- a/gst/ivtc/gstivtc.c
+++ b/gst/ivtc/gstivtc.c
@@ -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;
}
diff --git a/gst/ivtc/gstivtc.h b/gst/ivtc/gstivtc.h
index bf7076099..879a25943 100644
--- a/gst/ivtc/gstivtc.h
+++ b/gst/ivtc/gstivtc.h
@@ -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))
diff --git a/gst/jp2kdecimator/gstjp2kdecimator.c b/gst/jp2kdecimator/gstjp2kdecimator.c
index 3688381b9..532864e7c 100644
--- a/gst/jp2kdecimator/gstjp2kdecimator.c
+++ b/gst/jp2kdecimator/gstjp2kdecimator.c
@@ -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,
diff --git a/gst/jp2kdecimator/gstjp2kdecimator.h b/gst/jp2kdecimator/gstjp2kdecimator.h
index f5f3458b7..7f5a1a9dc 100644
--- a/gst/jp2kdecimator/gstjp2kdecimator.h
+++ b/gst/jp2kdecimator/gstjp2kdecimator.h
@@ -51,6 +51,7 @@ struct _GstJP2kDecimatorClass
};
GType gst_jp2k_decimator_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (jp2kdecimator);
G_END_DECLS
diff --git a/gst/jpegformat/gstjifmux.c b/gst/jpegformat/gstjifmux.c
index e958f54d3..79241bbbf 100644
--- a/gst/jpegformat/gstjifmux.c
+++ b/gst/jpegformat/gstjifmux.c
@@ -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)
diff --git a/gst/jpegformat/gstjifmux.h b/gst/jpegformat/gstjifmux.h
index 400e64c83..96830bb28 100644
--- a/gst/jpegformat/gstjifmux.h
+++ b/gst/jpegformat/gstjifmux.h
@@ -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__ */
diff --git a/gst/jpegformat/gstjpegformat.c b/gst/jpegformat/gstjpegformat.c
index b410466be..bc370458c 100644
--- a/gst/jpegformat/gstjpegformat.c
+++ b/gst/jpegformat/gstjpegformat.c
@@ -30,14 +30,12 @@
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,
diff --git a/gst/jpegformat/gstjpegparse.c b/gst/jpegformat/gstjpegparse.c
index 244b5a2f3..f08986f5b 100644
--- a/gst/jpegformat/gstjpegparse.c
+++ b/gst/jpegformat/gstjpegparse.c
@@ -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)
diff --git a/gst/jpegformat/gstjpegparse.h b/gst/jpegformat/gstjpegparse.h
index f809fa394..e77742160 100644
--- a/gst/jpegformat/gstjpegparse.h
+++ b/gst/jpegformat/gstjpegparse.h
@@ -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__ */
diff --git a/gst/librfb/gstrfbsrc.c b/gst/librfb/gstrfbsrc.c
index 194ee0766..cadfda37a 100644
--- a/gst/librfb/gstrfbsrc.c
+++ b/gst/librfb/gstrfbsrc.c
@@ -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,
diff --git a/gst/librfb/gstrfbsrc.h b/gst/librfb/gstrfbsrc.h
index 81ebd45bb..e10654925 100644
--- a/gst/librfb/gstrfbsrc.h
+++ b/gst/librfb/gstrfbsrc.h
@@ -68,6 +68,7 @@ struct _GstRfbSrc
};
GType gst_rfb_src_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (rfbsrc);
G_END_DECLS
#endif
diff --git a/gst/midi/midi.c b/gst/midi/midi.c
index 6171359f6..01e9b6dc7 100644
--- a/gst/midi/midi.c
+++ b/gst/midi/midi.c
@@ -28,16 +28,9 @@
#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,
diff --git a/gst/midi/midiparse.c b/gst/midi/midiparse.c
index dc3c078ad..11893103f 100644
--- a/gst/midi/midiparse.c
+++ b/gst/midi/midiparse.c
@@ -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
diff --git a/gst/midi/midiparse.h b/gst/midi/midiparse.h
index 5794c376d..05b627aac 100644
--- a/gst/midi/midiparse.h
+++ b/gst/midi/midiparse.h
@@ -87,6 +87,7 @@ struct _GstMidiParseClass
};
GType gst_midi_parse_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (midiparse);
G_END_DECLS
diff --git a/gst/mpegdemux/gstmpegdemux.c b/gst/mpegdemux/gstmpegdemux.c
index c0de4695e..bfbe0d9d4 100644
--- a/gst/mpegdemux/gstmpegdemux.c
+++ b/gst/mpegdemux/gstmpegdemux.c
@@ -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)
{
diff --git a/gst/mpegdemux/gstmpegdemux.h b/gst/mpegdemux/gstmpegdemux.h
index d43d42aac..d11f8c288 100644
--- a/gst/mpegdemux/gstmpegdemux.h
+++ b/gst/mpegdemux/gstmpegdemux.h
@@ -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__ */
diff --git a/gst/mpegdemux/plugin.c b/gst/mpegdemux/plugin.c
index 4d0bca217..0ad254833 100644
--- a/gst/mpegdemux/plugin.c
+++ b/gst/mpegdemux/plugin.c
@@ -47,19 +47,10 @@
#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,
diff --git a/gst/mpegpsmux/mpegpsmux.c b/gst/mpegpsmux/mpegpsmux.c
index c7e4cc22c..50c6c707e 100644
--- a/gst/mpegpsmux/mpegpsmux.c
+++ b/gst/mpegpsmux/mpegpsmux.c
@@ -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,
diff --git a/gst/mpegpsmux/mpegpsmux.h b/gst/mpegpsmux/mpegpsmux.h
index c04edf4ed..e469267cb 100644
--- a/gst/mpegpsmux/mpegpsmux.h
+++ b/gst/mpegpsmux/mpegpsmux.h
@@ -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)
diff --git a/gst/mpegtsdemux/gsttsdemux.c b/gst/mpegtsdemux/gsttsdemux.c
index af3da3890..188bf46ec 100644
--- a/gst/mpegtsdemux/gsttsdemux.c
+++ b/gst/mpegtsdemux/gsttsdemux.c
@@ -31,14 +31,12 @@
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,
diff --git a/gst/mpegtsdemux/mpegtsbase.c b/gst/mpegtsdemux/mpegtsbase.c
index bce8e8fc8..cc567f088 100644
--- a/gst/mpegtsdemux/mpegtsbase.c
+++ b/gst/mpegtsdemux/mpegtsbase.c
@@ -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
diff --git a/gst/mpegtsdemux/mpegtsparse.c b/gst/mpegtsdemux/mpegtsparse.c
index 7bb928a13..76ac55be6 100644
--- a/gst/mpegtsdemux/mpegtsparse.c
+++ b/gst/mpegtsdemux/mpegtsparse.c
@@ -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);
-}
diff --git a/gst/mpegtsdemux/mpegtsparse.h b/gst/mpegtsdemux/mpegtsparse.h
index 6b2aa33ea..55f2a55b2 100644
--- a/gst/mpegtsdemux/mpegtsparse.h
+++ b/gst/mpegtsdemux/mpegtsparse.h
@@ -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
diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c
index 52665762f..2f932c999 100644
--- a/gst/mpegtsdemux/tsdemux.c
+++ b/gst/mpegtsdemux/tsdemux.c
@@ -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);
-}
diff --git a/gst/mpegtsdemux/tsdemux.h b/gst/mpegtsdemux/tsdemux.h
index 931306ac6..dd0275aa6 100644
--- a/gst/mpegtsdemux/tsdemux.h
+++ b/gst/mpegtsdemux/tsdemux.h
@@ -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 */
diff --git a/gst/mpegtsmux/gstatscmux.c b/gst/mpegtsmux/gstatscmux.c
index bdd8bf150..9a54fe016 100644
--- a/gst/mpegtsmux/gstatscmux.c
+++ b/gst/mpegtsmux/gstatscmux.c
@@ -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
diff --git a/gst/mpegtsmux/gstatscmux.h b/gst/mpegtsmux/gstatscmux.h
index e2c6dd801..41015723f 100644
--- a/gst/mpegtsmux/gstatscmux.h
+++ b/gst/mpegtsmux/gstatscmux.h
@@ -40,6 +40,7 @@ struct GstATSCMuxClass {
};
GType gst_atsc_mux_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (atscmux);
G_END_DECLS
diff --git a/gst/mpegtsmux/gstbasetsmux.c b/gst/mpegtsmux/gstbasetsmux.c
index 3fe7da4c1..fd6138af8 100644
--- a/gst/mpegtsmux/gstbasetsmux.c
+++ b/gst/mpegtsmux/gstbasetsmux.c
@@ -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 */
diff --git a/gst/mpegtsmux/gstmpegtsmux.c b/gst/mpegtsmux/gstmpegtsmux.c
index 1b3638e52..1c26f398a 100644
--- a/gst/mpegtsmux/gstmpegtsmux.c
+++ b/gst/mpegtsmux/gstmpegtsmux.c
@@ -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 */
diff --git a/gst/mpegtsmux/gstmpegtsmux.h b/gst/mpegtsmux/gstmpegtsmux.h
index bb796b409..fb97405ec 100644
--- a/gst/mpegtsmux/gstmpegtsmux.h
+++ b/gst/mpegtsmux/gstmpegtsmux.h
@@ -118,6 +118,7 @@ struct GstMpegTsMuxClass {
};
GType gst_mpeg_ts_mux_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (mpegtsmux);
G_END_DECLS
diff --git a/gst/mpegtsmux/gstmpegtsmuxplugin.c b/gst/mpegtsmux/gstmpegtsmuxplugin.c
index aea1bae9c..22552a8b5 100644
--- a/gst/mpegtsmux/gstmpegtsmuxplugin.c
+++ b/gst/mpegtsmux/gstmpegtsmuxplugin.c
@@ -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
index 000000000..f2c11663c
--- /dev/null
+++ b/gst/mxf/gstmxfelement.c
@@ -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
index 000000000..bc2cc573d
--- /dev/null
+++ b/gst/mxf/gstmxfelements.h
@@ -0,0 +1,36 @@
+/* GStreamer
+ * Copyright (C) 2020 Huawei Technologies Co., Ltd.
+ * @Author: Stéphane Cerveau <stephane.cerveau@collabora.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+
+#ifndef __GST_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__ */
diff --git a/gst/mxf/meson.build b/gst/mxf/meson.build
index 30980dfb9..db9c41942 100644
--- a/gst/mxf/meson.build
+++ b/gst/mxf/meson.build
@@ -1,5 +1,6 @@
mxf_sources = [
'mxf.c',
+ 'gstmxfelement.c',
'mxful.c',
'mxftypes.c',
'mxfmetadata.c',
diff --git a/gst/mxf/mxf.c b/gst/mxf/mxf.c
index e4f94cb8b..e3e9fe351 100644
--- a/gst/mxf/mxf.c
+++ b/gst/mxf/mxf.c
@@ -1,3 +1,4 @@
+
/* GStreamer
* Copyright (C) <2008> Sebastian Dröge <sebastian.droege@collabora.co.uk>
*
@@ -20,67 +21,19 @@
#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,
diff --git a/gst/mxf/mxfdemux.c b/gst/mxf/mxfdemux.c
index f6e5ac048..d34827c58 100644
--- a/gst/mxf/mxfdemux.c
+++ b/gst/mxf/mxfdemux.c
@@ -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)
diff --git a/gst/mxf/mxfmux.c b/gst/mxf/mxfmux.c
index 1fb9c6fe6..2eade4761 100644
--- a/gst/mxf/mxfmux.c
+++ b/gst/mxf/mxfmux.c
@@ -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);
diff --git a/gst/netsim/gstnetsim.c b/gst/netsim/gstnetsim.c
index 692b3893d..c917de3b7 100644
--- a/gst/netsim/gstnetsim.c
+++ b/gst/netsim/gstnetsim.c
@@ -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,
diff --git a/gst/netsim/gstnetsim.h b/gst/netsim/gstnetsim.h
index bfbfa3f9f..cbd627012 100644
--- a/gst/netsim/gstnetsim.h
+++ b/gst/netsim/gstnetsim.h
@@ -96,6 +96,7 @@ struct _GstNetSimClass
};
GType gst_net_sim_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (netsim);
G_END_DECLS
diff --git a/gst/onvif/gstrtponvif.c b/gst/onvif/gstrtponvif.c
index c6742327d..3ae7ea86c 100644
--- a/gst/onvif/gstrtponvif.c
+++ b/gst/onvif/gstrtponvif.c
@@ -30,14 +30,12 @@
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,
diff --git a/gst/onvif/gstrtponvifparse.c b/gst/onvif/gstrtponvifparse.c
index 8fa0d8591..aaae94a26 100644
--- a/gst/onvif/gstrtponvifparse.c
+++ b/gst/onvif/gstrtponvifparse.c
@@ -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)
diff --git a/gst/onvif/gstrtponvifparse.h b/gst/onvif/gstrtponvifparse.h
index 437b1abcf..a5b8d157f 100644
--- a/gst/onvif/gstrtponvifparse.h
+++ b/gst/onvif/gstrtponvifparse.h
@@ -54,6 +54,7 @@ struct _GstRtpOnvifParseClass {
};
GType gst_rtp_onvif_parse_get_type(void);
+GST_ELEMENT_REGISTER_DECLARE (rtponvifparse);
#ifdef __cplusplus
}
diff --git a/gst/onvif/gstrtponviftimestamp.c b/gst/onvif/gstrtponviftimestamp.c
index 1ed546500..c5fb1d451 100644
--- a/gst/onvif/gstrtponviftimestamp.c
+++ b/gst/onvif/gstrtponviftimestamp.c
@@ -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,
diff --git a/gst/onvif/gstrtponviftimestamp.h b/gst/onvif/gstrtponviftimestamp.h
index f093f0edf..15a47f828 100644
--- a/gst/onvif/gstrtponviftimestamp.h
+++ b/gst/onvif/gstrtponviftimestamp.h
@@ -75,6 +75,7 @@ struct _GstRtpOnvifTimestampClass {
};
GType gst_rtp_onvif_timestamp_get_type(void);
+GST_ELEMENT_REGISTER_DECLARE (rtponviftimestamp);
#ifdef __cplusplus
}
diff --git a/gst/pcapparse/gstirtspparse.c b/gst/pcapparse/gstirtspparse.c
index e9ab037df..c04984545 100644
--- a/gst/pcapparse/gstirtspparse.c
+++ b/gst/pcapparse/gstirtspparse.c
@@ -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)
diff --git a/gst/pcapparse/gstirtspparse.h b/gst/pcapparse/gstirtspparse.h
index e3d3b745c..1ebbf3e9f 100644
--- a/gst/pcapparse/gstirtspparse.h
+++ b/gst/pcapparse/gstirtspparse.h
@@ -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__ */
diff --git a/gst/pcapparse/gstpcapparse.c b/gst/pcapparse/gstpcapparse.c
index aab2b8a1f..967e4ca4e 100644
--- a/gst/pcapparse/gstpcapparse.c
+++ b/gst/pcapparse/gstpcapparse.c
@@ -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)
diff --git a/gst/pcapparse/gstpcapparse.h b/gst/pcapparse/gstpcapparse.h
index 5feb4c661..29e2188c7 100644
--- a/gst/pcapparse/gstpcapparse.h
+++ b/gst/pcapparse/gstpcapparse.h
@@ -94,6 +94,7 @@ struct _GstPcapParseClass
};
GType gst_pcap_parse_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (pcapparse);
G_END_DECLS
diff --git a/gst/pcapparse/plugin.c b/gst/pcapparse/plugin.c
index 3e6eb3873..10f2cb192 100644
--- a/gst/pcapparse/plugin.c
+++ b/gst/pcapparse/plugin.c
@@ -27,12 +27,10 @@
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;
}
diff --git a/gst/pnm/gstpnm.c b/gst/pnm/gstpnm.c
index 2b0860991..8f3efac27 100644
--- a/gst/pnm/gstpnm.c
+++ b/gst/pnm/gstpnm.c
@@ -23,21 +23,16 @@
#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,
diff --git a/gst/pnm/gstpnmdec.c b/gst/pnm/gstpnmdec.c
index b11a7310b..d67cba3ad 100644
--- a/gst/pnm/gstpnmdec.c
+++ b/gst/pnm/gstpnmdec.c
@@ -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",
diff --git a/gst/pnm/gstpnmdec.h b/gst/pnm/gstpnmdec.h
index b5aac35cf..790968052 100644
--- a/gst/pnm/gstpnmdec.h
+++ b/gst/pnm/gstpnmdec.h
@@ -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__ */
diff --git a/gst/pnm/gstpnmenc.c b/gst/pnm/gstpnmenc.c
index 7919f5d18..c637b7407 100644
--- a/gst/pnm/gstpnmenc.c
+++ b/gst/pnm/gstpnmenc.c
@@ -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);
diff --git a/gst/pnm/gstpnmenc.h b/gst/pnm/gstpnmenc.h
index cb7f45bcb..3dc57b037 100644
--- a/gst/pnm/gstpnmenc.h
+++ b/gst/pnm/gstpnmenc.h
@@ -51,6 +51,7 @@ struct _GstPnmencClass
};
GType gst_pnmenc_get_type (void) G_GNUC_CONST;
+GST_ELEMENT_REGISTER_DECLARE (pnmenc);
G_END_DECLS
diff --git a/gst/proxy/gstproxy.c b/gst/proxy/gstproxy.c
index fbe4e5ee2..74bc86e59 100644
--- a/gst/proxy/gstproxy.c
+++ b/gst/proxy/gstproxy.c
@@ -29,11 +29,12 @@
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,
diff --git a/gst/proxy/gstproxysink.c b/gst/proxy/gstproxysink.c
index f44f8ec46..9425dccc4 100644
--- a/gst/proxy/gstproxysink.c
+++ b/gst/proxy/gstproxysink.c
@@ -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);
diff --git a/gst/proxy/gstproxysink.h b/gst/proxy/gstproxysink.h
index 9da4b3917..9bd382c45 100644
--- a/gst/proxy/gstproxysink.h
+++ b/gst/proxy/gstproxysink.h
@@ -55,6 +55,7 @@ struct _GstProxySinkClass {
};
GType gst_proxy_sink_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (proxysink);
G_END_DECLS
diff --git a/gst/proxy/gstproxysrc.c b/gst/proxy/gstproxysrc.c
index c7fb4b62a..97fbc121f 100644
--- a/gst/proxy/gstproxysrc.c
+++ b/gst/proxy/gstproxysrc.c
@@ -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);
diff --git a/gst/proxy/gstproxysrc.h b/gst/proxy/gstproxysrc.h
index 4f5c3021a..4e7648c4e 100644
--- a/gst/proxy/gstproxysrc.h
+++ b/gst/proxy/gstproxysrc.h
@@ -63,6 +63,7 @@ struct _GstProxySrcClass {
};
GType gst_proxy_src_get_type(void);
+GST_ELEMENT_REGISTER_DECLARE (proxysrc);
G_END_DECLS
diff --git a/gst/rawparse/gstaudioparse.c b/gst/rawparse/gstaudioparse.c
index 6e4c647bd..3e737626f 100644
--- a/gst/rawparse/gstaudioparse.c
+++ b/gst/rawparse/gstaudioparse.c
@@ -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)
diff --git a/gst/rawparse/gstaudioparse.h b/gst/rawparse/gstaudioparse.h
index 41b23d444..22039e723 100644
--- a/gst/rawparse/gstaudioparse.h
+++ b/gst/rawparse/gstaudioparse.h
@@ -50,5 +50,6 @@ struct _GstAudioParseClass
};
GType gst_audio_parse_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (audioparse);
#endif /* __GST_AUDIO_PARSE_H__ */
diff --git a/gst/rawparse/gstvideoparse.c b/gst/rawparse/gstvideoparse.c
index ee931a9f7..35942821c 100644
--- a/gst/rawparse/gstvideoparse.c
+++ b/gst/rawparse/gstvideoparse.c
@@ -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)
diff --git a/gst/rawparse/gstvideoparse.h b/gst/rawparse/gstvideoparse.h
index 57b9b686d..59391e0c6 100644
--- a/gst/rawparse/gstvideoparse.h
+++ b/gst/rawparse/gstvideoparse.h
@@ -51,5 +51,6 @@ struct _GstVideoParseClass
};
GType gst_video_parse_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (videoparse);
#endif /* __GST_VIDEO_PARSE_H__ */
diff --git a/gst/rawparse/plugin.c b/gst/rawparse/plugin.c
index d7de87693..0487b502a 100644
--- a/gst/rawparse/plugin.c
+++ b/gst/rawparse/plugin.c
@@ -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;
}
diff --git a/gst/removesilence/gstremovesilence.c b/gst/removesilence/gstremovesilence.c
index 5529f6a9e..6822e57b5 100644
--- a/gst/removesilence/gstremovesilence.c
+++ b/gst/removesilence/gstremovesilence.c
@@ -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,
diff --git a/gst/removesilence/gstremovesilence.h b/gst/removesilence/gstremovesilence.h
index f7faf1014..2cecb077c 100644
--- a/gst/removesilence/gstremovesilence.h
+++ b/gst/removesilence/gstremovesilence.h
@@ -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
index 000000000..b393925c0
--- /dev/null
+++ b/gst/rist/gstrist.c
@@ -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;
+}
diff --git a/gst/rist/gstrist.h b/gst/rist/gstrist.h
index 1f74044e2..b6d3c8386 100644
--- a/gst/rist/gstrist.h
+++ b/gst/rist/gstrist.h
@@ -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);
diff --git a/gst/rist/gstristplugin.c b/gst/rist/gstristplugin.c
index e06865583..ff6fda22e 100644
--- a/gst/rist/gstristplugin.c
+++ b/gst/rist/gstristplugin.c
@@ -25,99 +25,20 @@
#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,
diff --git a/gst/rist/gstristrtpdeext.c b/gst/rist/gstristrtpdeext.c
index 47d3c2bfe..7dc2a0475 100644
--- a/gst/rist/gstristrtpdeext.c
+++ b/gst/rist/gstristrtpdeext.c
@@ -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)
diff --git a/gst/rist/gstristrtpext.c b/gst/rist/gstristrtpext.c
index 42b29931f..32e3ea177 100644
--- a/gst/rist/gstristrtpext.c
+++ b/gst/rist/gstristrtpext.c
@@ -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)
diff --git a/gst/rist/gstristrtxreceive.c b/gst/rist/gstristrtxreceive.c
index fe8a6d5fa..861835a39 100644
--- a/gst/rist/gstristrtxreceive.c
+++ b/gst/rist/gstristrtxreceive.c
@@ -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)
diff --git a/gst/rist/gstristrtxsend.c b/gst/rist/gstristrtxsend.c
index 3c4d40474..fc2206a2c 100644
--- a/gst/rist/gstristrtxsend.c
+++ b/gst/rist/gstristrtxsend.c
@@ -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
{
diff --git a/gst/rist/gstristsink.c b/gst/rist/gstristsink.c
index 6622257c9..1de516d50 100644
--- a/gst/rist/gstristsink.c
+++ b/gst/rist/gstristsink.c
@@ -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;
diff --git a/gst/rist/gstristsrc.c b/gst/rist/gstristsrc.c
index 5e194fcea..369be39b2 100644
--- a/gst/rist/gstristsrc.c
+++ b/gst/rist/gstristsrc.c
@@ -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 *
diff --git a/gst/rist/gstroundrobin.c b/gst/rist/gstroundrobin.c
index 2ff8ff306..d899e7e87 100644
--- a/gst/rist/gstroundrobin.c
+++ b/gst/rist/gstroundrobin.c
@@ -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)
diff --git a/gst/rist/gstroundrobin.h b/gst/rist/gstroundrobin.h
index d1a918059..96fd28c78 100644
--- a/gst/rist/gstroundrobin.h
+++ b/gst/rist/gstroundrobin.h
@@ -30,5 +30,6 @@ typedef struct {
GstElementClass parent;
} GstRoundRobinClass;
GType gst_round_robin_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (roundrobin);
#endif
diff --git a/gst/rist/meson.build b/gst/rist/meson.build
index a7ef8bbda..88c9e8735 100644
--- a/gst/rist/meson.build
+++ b/gst/rist/meson.build
@@ -4,6 +4,7 @@ rist_sources = [
'gstristrtxreceive.c',
'gstristsrc.c',
'gstristsink.c',
+ 'gstrist.c',
'gstristplugin.c',
'gstristrtpext.c',
'gstristrtpdeext.c'
diff --git a/gst/rtmp2/gstrtmp2.c b/gst/rtmp2/gstrtmp2.c
index 1be1a3c5e..35650227a 100644
--- a/gst/rtmp2/gstrtmp2.c
+++ b/gst/rtmp2/gstrtmp2.c
@@ -23,24 +23,18 @@
#include "config.h"
#endif
-#include "gstrtmp2src.h"
-#include "gstrtmp2sink.h"
+#include "gstrtmp2elements.h"
-#include "rtmp/rtmpclient.h"
static gboolean
plugin_init (GstPlugin * plugin)
{
- gst_element_register (plugin, "rtmp2src", GST_RANK_PRIMARY + 1,
- GST_TYPE_RTMP2_SRC);
- gst_element_register (plugin, "rtmp2sink", GST_RANK_PRIMARY + 1,
- GST_TYPE_RTMP2_SINK);
+ gboolean ret = FALSE;
- gst_type_mark_as_plugin_api (GST_TYPE_RTMP_SCHEME, 0);
- gst_type_mark_as_plugin_api (GST_TYPE_RTMP_AUTHMOD, 0);
- gst_type_mark_as_plugin_api (GST_TYPE_RTMP_STOP_COMMANDS, 0);
+ ret |= GST_ELEMENT_REGISTER (rtmp2src, plugin);
+ ret |= GST_ELEMENT_REGISTER (rtmp2sink, plugin);
- return TRUE;
+ return ret;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
diff --git a/gst/rtmp2/gstrtmp2element.c b/gst/rtmp2/gstrtmp2element.c
new file mode 100644
index 000000000..2a01c06e0
--- /dev/null
+++ b/gst/rtmp2/gstrtmp2element.c
@@ -0,0 +1,41 @@
+/* GStreamer
+ * Copyright (C) 2014 David Schleef <ds@schleef.org>
+ * Copyright (C) 2017 Make.TV, Inc. <info@make.tv>
+ * Contact: Jan Alexander Steffens (heftig) <jsteffens@make.tv>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Suite 500,
+ * Boston, MA 02110-1335, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "gstrtmp2elements.h"
+
+#include "rtmp/rtmpclient.h"
+
+void
+rtmp2_element_init (GstPlugin * plugin)
+{
+ static gsize res = FALSE;
+
+ if (g_once_init_enter (&res)) {
+ gst_type_mark_as_plugin_api (GST_TYPE_RTMP_SCHEME, 0);
+ gst_type_mark_as_plugin_api (GST_TYPE_RTMP_AUTHMOD, 0);
+ gst_type_mark_as_plugin_api (GST_TYPE_RTMP_STOP_COMMANDS, 0);
+ g_once_init_leave (&res, TRUE);
+ }
+}
diff --git a/gst/rtmp2/gstrtmp2elements.h b/gst/rtmp2/gstrtmp2elements.h
new file mode 100644
index 000000000..be20c169a
--- /dev/null
+++ b/gst/rtmp2/gstrtmp2elements.h
@@ -0,0 +1,36 @@
+/* GStreamer
+ * Copyright (C) 2020 Huawei Technologies Co., Ltd.
+ * @Author: Stéphane Cerveau <stephane.cerveau@collabora.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+
+#ifndef __GST_RTMP2_ELEMENTS_H__
+#define __GST_RTMP2_ELEMENTS_H__
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <gst/gst.h>
+
+void rtmp2_element_init (GstPlugin * plugin);
+
+GST_ELEMENT_REGISTER_DECLARE (rtmp2sink);
+GST_ELEMENT_REGISTER_DECLARE (rtmp2src);
+
+#endif /* __GST_RTMP2_ELEMENTS_H__ */
diff --git a/gst/rtmp2/gstrtmp2sink.c b/gst/rtmp2/gstrtmp2sink.c
index 13b4d0825..46dbe355d 100644
--- a/gst/rtmp2/gstrtmp2sink.c
+++ b/gst/rtmp2/gstrtmp2sink.c
@@ -38,6 +38,7 @@
#include "config.h"
#endif
+#include "gstrtmp2elements.h"
#include "gstrtmp2sink.h"
#include "gstrtmp2locationhandler.h"
@@ -167,6 +168,8 @@ G_DEFINE_TYPE_WITH_CODE (GstRtmp2Sink, gst_rtmp2_sink, GST_TYPE_BASE_SINK,
G_IMPLEMENT_INTERFACE (GST_TYPE_URI_HANDLER,
gst_rtmp2_sink_uri_handler_init);
G_IMPLEMENT_INTERFACE (GST_TYPE_RTMP_LOCATION_HANDLER, NULL));
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (rtmp2sink, "rtmp2sink",
+ GST_RANK_PRIMARY + 1, GST_TYPE_RTMP2_SINK, rtmp2_element_init (plugin));
static void
gst_rtmp2_sink_class_init (GstRtmp2SinkClass * klass)
diff --git a/gst/rtmp2/gstrtmp2src.c b/gst/rtmp2/gstrtmp2src.c
index 2df92e4e7..6cad882ff 100644
--- a/gst/rtmp2/gstrtmp2src.c
+++ b/gst/rtmp2/gstrtmp2src.c
@@ -36,6 +36,7 @@
#include "config.h"
#endif
+#include "gstrtmp2elements.h"
#include "gstrtmp2src.h"
#include "gstrtmp2locationhandler.h"
@@ -157,6 +158,8 @@ G_DEFINE_TYPE_WITH_CODE (GstRtmp2Src, gst_rtmp2_src, GST_TYPE_PUSH_SRC,
G_IMPLEMENT_INTERFACE (GST_TYPE_URI_HANDLER,
gst_rtmp2_src_uri_handler_init);
G_IMPLEMENT_INTERFACE (GST_TYPE_RTMP_LOCATION_HANDLER, NULL));
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (rtmp2src, "rtmp2src",
+ GST_RANK_PRIMARY + 1, GST_TYPE_RTMP2_SRC, rtmp2_element_init (plugin));
static void
gst_rtmp2_src_class_init (GstRtmp2SrcClass * klass)
diff --git a/gst/rtmp2/meson.build b/gst/rtmp2/meson.build
index c67a24867..e9cabbd64 100644
--- a/gst/rtmp2/meson.build
+++ b/gst/rtmp2/meson.build
@@ -1,5 +1,6 @@
rtmp2_sources = [
'gstrtmp2.c',
+ 'gstrtmp2element.c',
'gstrtmp2locationhandler.c',
'gstrtmp2sink.c',
'gstrtmp2src.c',
diff --git a/gst/rtp/gstrtpsink.c b/gst/rtp/gstrtpsink.c
index 364b6884c..c94c6dadf 100644
--- a/gst/rtp/gstrtpsink.c
+++ b/gst/rtp/gstrtpsink.c
@@ -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)))
diff --git a/gst/rtp/gstrtpsink.h b/gst/rtp/gstrtpsink.h
index 1af5e0b97..bc1f6dc65 100644
--- a/gst/rtp/gstrtpsink.h
+++ b/gst/rtp/gstrtpsink.h
@@ -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__ */
diff --git a/gst/rtp/gstrtpsrc.c b/gst/rtp/gstrtpsrc.c
index 6dda142b0..8ff6f2172 100644
--- a/gst/rtp/gstrtpsrc.c
+++ b/gst/rtp/gstrtpsrc.c
@@ -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)))
diff --git a/gst/rtp/gstrtpsrc.h b/gst/rtp/gstrtpsrc.h
index ad773d9f4..616fdb1f8 100644
--- a/gst/rtp/gstrtpsrc.h
+++ b/gst/rtp/gstrtpsrc.h
@@ -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__ */
diff --git a/gst/rtp/plugin.c b/gst/rtp/plugin.c
index 8c1d71f8b..5b8d46798 100644
--- a/gst/rtp/plugin.c
+++ b/gst/rtp/plugin.c
@@ -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;
}
diff --git a/gst/sdp/gstsdpdemux.c b/gst/sdp/gstsdpdemux.c
index 1374bbb92..1737ed8d4 100644
--- a/gst/sdp/gstsdpdemux.c
+++ b/gst/sdp/gstsdpdemux.c
@@ -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)
diff --git a/gst/sdp/gstsdpdemux.h b/gst/sdp/gstsdpdemux.h
index 908ac5baf..fb8ea4402 100644
--- a/gst/sdp/gstsdpdemux.h
+++ b/gst/sdp/gstsdpdemux.h
@@ -113,6 +113,7 @@ struct _GstSDPDemuxClass {
};
GType gst_sdp_demux_get_type(void);
+GST_ELEMENT_REGISTER_DECLARE (sdpdemux);
G_END_DECLS
diff --git a/gst/sdp/gstsdpelem.c b/gst/sdp/gstsdpelem.c
index 8a945cdbf..a9d22fc78 100644
--- a/gst/sdp/gstsdpelem.c
+++ b/gst/sdp/gstsdpelem.c
@@ -27,13 +27,12 @@
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,
diff --git a/gst/sdp/gstsdpsrc.c b/gst/sdp/gstsdpsrc.c
index 96b483d23..184c9bfda 100644
--- a/gst/sdp/gstsdpsrc.c
+++ b/gst/sdp/gstsdpsrc.c
@@ -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)
diff --git a/gst/sdp/gstsdpsrc.h b/gst/sdp/gstsdpsrc.h
index 05f2074f9..955fc5c3a 100644
--- a/gst/sdp/gstsdpsrc.h
+++ b/gst/sdp/gstsdpsrc.h
@@ -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__ */
diff --git a/gst/segmentclip/gstaudiosegmentclip.c b/gst/segmentclip/gstaudiosegmentclip.c
index 434424a45..4c4ca72cb 100644
--- a/gst/segmentclip/gstaudiosegmentclip.c
+++ b/gst/segmentclip/gstaudiosegmentclip.c
@@ -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)
diff --git a/gst/segmentclip/gstaudiosegmentclip.h b/gst/segmentclip/gstaudiosegmentclip.h
index 234172e0c..ccaa9d7b3 100644
--- a/gst/segmentclip/gstaudiosegmentclip.h
+++ b/gst/segmentclip/gstaudiosegmentclip.h
@@ -55,6 +55,7 @@ struct _GstAudioSegmentClipClass
};
GType gst_audio_segment_clip_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (audiosegmentclip);
G_END_DECLS
diff --git a/gst/segmentclip/gstvideosegmentclip.c b/gst/segmentclip/gstvideosegmentclip.c
index 34ba58b59..70576340a 100644
--- a/gst/segmentclip/gstvideosegmentclip.c
+++ b/gst/segmentclip/gstvideosegmentclip.c
@@ -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)
diff --git a/gst/segmentclip/gstvideosegmentclip.h b/gst/segmentclip/gstvideosegmentclip.h
index f49f2a442..6f321f114 100644
--- a/gst/segmentclip/gstvideosegmentclip.h
+++ b/gst/segmentclip/gstvideosegmentclip.h
@@ -54,6 +54,7 @@ struct _GstVideoSegmentClipClass
};
GType gst_video_segment_clip_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (videosegmentclip);
G_END_DECLS
diff --git a/gst/segmentclip/plugin.c b/gst/segmentclip/plugin.c
index 9f4cbb9c0..358ec5581 100644
--- a/gst/segmentclip/plugin.c
+++ b/gst/segmentclip/plugin.c
@@ -27,13 +27,12 @@
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,
diff --git a/gst/siren/gstsiren.c b/gst/siren/gstsiren.c
index 6fde346dc..eb8d1d24a 100644
--- a/gst/siren/gstsiren.c
+++ b/gst/siren/gstsiren.c
@@ -24,20 +24,19 @@
#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,
diff --git a/gst/siren/gstsirendec.c b/gst/siren/gstsirendec.c
index 045bcd668..3e0baae33 100644
--- a/gst/siren/gstsirendec.c
+++ b/gst/siren/gstsirendec.c
@@ -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);
-}
diff --git a/gst/siren/gstsirendec.h b/gst/siren/gstsirendec.h
index 27d7c86c8..3b5ed839d 100644
--- a/gst/siren/gstsirendec.h
+++ b/gst/siren/gstsirendec.h
@@ -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
diff --git a/gst/siren/gstsirenenc.c b/gst/siren/gstsirenenc.c
index b54f29c5e..2392b93ca 100644
--- a/gst/siren/gstsirenenc.c
+++ b/gst/siren/gstsirenenc.c
@@ -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);
-}
diff --git a/gst/siren/gstsirenenc.h b/gst/siren/gstsirenenc.h
index acfb5e673..3fe1eaaf3 100644
--- a/gst/siren/gstsirenenc.h
+++ b/gst/siren/gstsirenenc.h
@@ -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__ */
diff --git a/gst/smooth/gstsmooth.c b/gst/smooth/gstsmooth.c
index 3bc233ae0..6fab7ac6d 100644
--- a/gst/smooth/gstsmooth.c
+++ b/gst/smooth/gstsmooth.c
@@ -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,
diff --git a/gst/smooth/gstsmooth.h b/gst/smooth/gstsmooth.h
index 3bec38330..13ca1b86c 100644
--- a/gst/smooth/gstsmooth.h
+++ b/gst/smooth/gstsmooth.h
@@ -65,7 +65,7 @@ struct _GstSmoothClass {
};
GType gst_smooth_get_type(void);
-
+GST_ELEMENT_REGISTER_DECLARE (smooth);
#ifdef __cplusplus
}
diff --git a/gst/speed/gstspeed.c b/gst/speed/gstspeed.c
index 8d90518a8..6a536a20e 100644
--- a/gst/speed/gstspeed.c
+++ b/gst/speed/gstspeed.c
@@ -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,
diff --git a/gst/speed/gstspeed.h b/gst/speed/gstspeed.h
index d3a06583b..2485a666c 100644
--- a/gst/speed/gstspeed.h
+++ b/gst/speed/gstspeed.h
@@ -61,6 +61,7 @@ struct _GstSpeedClass {
};
GType gst_speed_get_type(void);
+GST_ELEMENT_REGISTER_DECLARE (speed);
G_END_DECLS
diff --git a/gst/subenc/gstsrtenc.c b/gst/subenc/gstsrtenc.c
index c16e6ed68..e32a70d94 100644
--- a/gst/subenc/gstsrtenc.c
+++ b/gst/subenc/gstsrtenc.c
@@ -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)
diff --git a/gst/subenc/gstsrtenc.h b/gst/subenc/gstsrtenc.h
index 4fe83e0ef..05ff34d88 100644
--- a/gst/subenc/gstsrtenc.h
+++ b/gst/subenc/gstsrtenc.h
@@ -58,6 +58,7 @@ struct _GstSrtEnc
};
GType gst_srt_enc_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (srtenc);
G_END_DECLS
#endif
diff --git a/gst/subenc/gstsubenc.c b/gst/subenc/gstsubenc.c
index 0637c5b7e..0e3b6820d 100644
--- a/gst/subenc/gstsubenc.c
+++ b/gst/subenc/gstsubenc.c
@@ -27,11 +27,12 @@
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,
diff --git a/gst/subenc/gstwebvttenc.c b/gst/subenc/gstwebvttenc.c
index c8a54b6a5..d6cf1090e 100644
--- a/gst/subenc/gstwebvttenc.c
+++ b/gst/subenc/gstwebvttenc.c
@@ -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,
diff --git a/gst/subenc/gstwebvttenc.h b/gst/subenc/gstwebvttenc.h
index ef76a495e..e4f2cdaa7 100644
--- a/gst/subenc/gstwebvttenc.h
+++ b/gst/subenc/gstwebvttenc.h
@@ -60,6 +60,7 @@ struct _GstWebvttEnc
};
GType gst_webvtt_enc_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (webvttenc);
G_END_DECLS
#endif
diff --git a/gst/switchbin/gstswitchbin.c b/gst/switchbin/gstswitchbin.c
index 330d3781e..c3757d7f2 100644
--- a/gst/switchbin/gstswitchbin.c
+++ b/gst/switchbin/gstswitchbin.c
@@ -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);
diff --git a/gst/switchbin/gstswitchbin.h b/gst/switchbin/gstswitchbin.h
index 815106791..68b43457c 100644
--- a/gst/switchbin/gstswitchbin.h
+++ b/gst/switchbin/gstswitchbin.h
@@ -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
diff --git a/gst/switchbin/plugin.c b/gst/switchbin/plugin.c
index a784b2413..37f1340df 100644
--- a/gst/switchbin/plugin.c
+++ b/gst/switchbin/plugin.c
@@ -28,14 +28,9 @@
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,
diff --git a/gst/timecode/gstavwait.c b/gst/timecode/gstavwait.c
index eff57f1dc..7f7305306 100644
--- a/gst/timecode/gstavwait.c
+++ b/gst/timecode/gstavwait.c
@@ -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
{
diff --git a/gst/timecode/gstavwait.h b/gst/timecode/gstavwait.h
index 8e0bc9488..ce892f1ae 100644
--- a/gst/timecode/gstavwait.h
+++ b/gst/timecode/gstavwait.h
@@ -98,6 +98,7 @@ struct _GstAvWaitClass
};
GType gst_avwait_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (avwait);
G_END_DECLS
#endif /* __GST_AVWAIT_H__ */
diff --git a/gst/timecode/gsttimecodestamper.c b/gst/timecode/gsttimecodestamper.c
index ebb2300c2..9a91b3927 100644
--- a/gst/timecode/gsttimecodestamper.c
+++ b/gst/timecode/gsttimecodestamper.c
@@ -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)
diff --git a/gst/timecode/gsttimecodestamper.h b/gst/timecode/gsttimecodestamper.h
index f4387ecb5..7a9922b09 100644
--- a/gst/timecode/gsttimecodestamper.h
+++ b/gst/timecode/gsttimecodestamper.h
@@ -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);
diff --git a/gst/timecode/plugin.c b/gst/timecode/plugin.c
index 245f3aab2..59dc288ac 100644
--- a/gst/timecode/plugin.c
+++ b/gst/timecode/plugin.c
@@ -30,13 +30,10 @@
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;
}
diff --git a/gst/transcode/gsttranscodebin.c b/gst/transcode/gsttranscodebin.c
index e5c041c59..0ceb163ca 100644
--- a/gst/transcode/gsttranscodebin.c
+++ b/gst/transcode/gsttranscodebin.c
@@ -23,13 +23,13 @@
#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
index 000000000..7fae04b1a
--- /dev/null
+++ b/gst/transcode/gsttranscodeelement.c
@@ -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
index 000000000..25d6df366
--- /dev/null
+++ b/gst/transcode/gsttranscodeelements.h
@@ -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
index 000000000..78fb88a95
--- /dev/null
+++ b/gst/transcode/gsttranscodeplugin.c
@@ -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)
diff --git a/gst/transcode/gsturitranscodebin.c b/gst/transcode/gsturitranscodebin.c
index c51ea37ac..8cf13d380 100644
--- a/gst/transcode/gsturitranscodebin.c
+++ b/gst/transcode/gsturitranscodebin.c
@@ -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,
diff --git a/gst/transcode/meson.build b/gst/transcode/meson.build
index a28af9a15..080623e52 100644
--- a/gst/transcode/meson.build
+++ b/gst/transcode/meson.build
@@ -1,4 +1,6 @@
gsttranscoder_plugin = library('gsttranscode',
+ 'gsttranscodeelement.c',
+ 'gsttranscodeplugin.c',
'gsttranscodebin.c',
'gst-cpu-throttling-clock.c',
'gsturitranscodebin.c',
diff --git a/gst/videofilters/gstscenechange.c b/gst/videofilters/gstscenechange.c
index b9be4a7b4..93e761b8b 100644
--- a/gst/videofilters/gstscenechange.c
+++ b/gst/videofilters/gstscenechange.c
@@ -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)
diff --git a/gst/videofilters/gstscenechange.h b/gst/videofilters/gstscenechange.h
index 762c5a8ba..b339824f9 100644
--- a/gst/videofilters/gstscenechange.h
+++ b/gst/videofilters/gstscenechange.h
@@ -53,6 +53,7 @@ struct _GstSceneChangeClass
};
GType gst_scene_change_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (scenechange);
G_END_DECLS
diff --git a/gst/videofilters/gstvideodiff.c b/gst/videofilters/gstvideodiff.c
index a6027590f..9251c4024 100644
--- a/gst/videofilters/gstvideodiff.c
+++ b/gst/videofilters/gstvideodiff.c
@@ -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)
diff --git a/gst/videofilters/gstvideodiff.h b/gst/videofilters/gstvideodiff.h
index 8d76d70e1..3df98e607 100644
--- a/gst/videofilters/gstvideodiff.h
+++ b/gst/videofilters/gstvideodiff.h
@@ -52,6 +52,7 @@ struct _GstVideoDiffClass
};
GType gst_video_diff_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (videodiff);
G_END_DECLS
diff --git a/gst/videofilters/gstvideofiltersbad.c b/gst/videofilters/gstvideofiltersbad.c
index 1f361e498..84c50c296 100644
--- a/gst/videofilters/gstvideofiltersbad.c
+++ b/gst/videofilters/gstvideofiltersbad.c
@@ -31,15 +31,13 @@
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,
diff --git a/gst/videofilters/gstzebrastripe.c b/gst/videofilters/gstzebrastripe.c
index e14ab99d2..b62b6653d 100644
--- a/gst/videofilters/gstzebrastripe.c
+++ b/gst/videofilters/gstzebrastripe.c
@@ -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)
diff --git a/gst/videofilters/gstzebrastripe.h b/gst/videofilters/gstzebrastripe.h
index 479ce5c07..5f2e7bf7b 100644
--- a/gst/videofilters/gstzebrastripe.h
+++ b/gst/videofilters/gstzebrastripe.h
@@ -52,6 +52,7 @@ struct _GstZebraStripeClass
};
GType gst_zebra_stripe_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (zebrastripe);
G_END_DECLS
diff --git a/gst/videoframe_audiolevel/gstvideoframe-audiolevel.c b/gst/videoframe_audiolevel/gstvideoframe-audiolevel.c
index bd5b43db5..cb1390d2d 100644
--- a/gst/videoframe_audiolevel/gstvideoframe-audiolevel.c
+++ b/gst/videoframe_audiolevel/gstvideoframe-audiolevel.c
@@ -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,
diff --git a/gst/videoframe_audiolevel/gstvideoframe-audiolevel.h b/gst/videoframe_audiolevel/gstvideoframe-audiolevel.h
index 83332e521..320132df0 100644
--- a/gst/videoframe_audiolevel/gstvideoframe-audiolevel.h
+++ b/gst/videoframe_audiolevel/gstvideoframe-audiolevel.h
@@ -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__ */
diff --git a/gst/videoparsers/gstav1parse.c b/gst/videoparsers/gstav1parse.c
index 048d65629..a2c0edca8 100644
--- a/gst/videoparsers/gstav1parse.c
+++ b/gst/videoparsers/gstav1parse.c
@@ -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)
diff --git a/gst/videoparsers/gstdiracparse.c b/gst/videoparsers/gstdiracparse.c
index 105f4f499..d7a0c92fd 100644
--- a/gst/videoparsers/gstdiracparse.c
+++ b/gst/videoparsers/gstdiracparse.c
@@ -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)
diff --git a/gst/videoparsers/gsth263parse.c b/gst/videoparsers/gsth263parse.c
index 0f4d42ee7..d2c1e4954 100644
--- a/gst/videoparsers/gsth263parse.c
+++ b/gst/videoparsers/gsth263parse.c
@@ -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);
diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c
index 621b1b000..ef265d3d0 100644
--- a/gst/videoparsers/gsth264parse.c
+++ b/gst/videoparsers/gsth264parse.c
@@ -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);
diff --git a/gst/videoparsers/gsth265parse.c b/gst/videoparsers/gsth265parse.c
index 7f45337f9..977bc9d6c 100644
--- a/gst/videoparsers/gsth265parse.c
+++ b/gst/videoparsers/gsth265parse.c
@@ -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);
diff --git a/gst/videoparsers/gstjpeg2000parse.c b/gst/videoparsers/gstjpeg2000parse.c
index 170b9201d..3ba035831 100644
--- a/gst/videoparsers/gstjpeg2000parse.c
+++ b/gst/videoparsers/gstjpeg2000parse.c
@@ -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,
diff --git a/gst/videoparsers/gstmpeg4videoparse.c b/gst/videoparsers/gstmpeg4videoparse.c
index 53dddd4ae..4b133ada6 100644
--- a/gst/videoparsers/gstmpeg4videoparse.c
+++ b/gst/videoparsers/gstmpeg4videoparse.c
@@ -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);
diff --git a/gst/videoparsers/gstmpegvideoparse.c b/gst/videoparsers/gstmpegvideoparse.c
index 6e27deec2..f8ef31a1b 100644
--- a/gst/videoparsers/gstmpegvideoparse.c
+++ b/gst/videoparsers/gstmpegvideoparse.c
@@ -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);
diff --git a/gst/videoparsers/gstpngparse.c b/gst/videoparsers/gstpngparse.c
index 6df53bd51..81621d993 100644
--- a/gst/videoparsers/gstpngparse.c
+++ b/gst/videoparsers/gstpngparse.c
@@ -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);
diff --git a/gst/videoparsers/gstvc1parse.c b/gst/videoparsers/gstvc1parse.c
index 68033dfd9..74f3b961e 100644
--- a/gst/videoparsers/gstvc1parse.c
+++ b/gst/videoparsers/gstvc1parse.c
@@ -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
index 000000000..d55564165
--- /dev/null
+++ b/gst/videoparsers/gstvideoparserselement.c
@@ -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
index 000000000..a8d40c91f
--- /dev/null
+++ b/gst/videoparsers/gstvideoparserselements.h
@@ -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__ */
diff --git a/gst/videoparsers/gstvp9parse.c b/gst/videoparsers/gstvp9parse.c
index ccf3d8f69..79ca9ffc5 100644
--- a/gst/videoparsers/gstvp9parse.c
+++ b/gst/videoparsers/gstvp9parse.c
@@ -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);
diff --git a/gst/videoparsers/meson.build b/gst/videoparsers/meson.build
index 61f37576e..147a2650e 100644
--- a/gst/videoparsers/meson.build
+++ b/gst/videoparsers/meson.build
@@ -1,5 +1,6 @@
vparse_sources = [
'plugin.c',
+ 'gstvideoparserselement.c',
'h263parse.c',
'gsth263parse.c',
'gstdiracparse.c',
diff --git a/gst/videoparsers/plugin.c b/gst/videoparsers/plugin.c
index 9cf2962ea..069da7070 100644
--- a/gst/videoparsers/plugin.c
+++ b/gst/videoparsers/plugin.c
@@ -22,62 +22,34 @@
#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;
}
diff --git a/gst/videosignal/gstsimplevideomark.c b/gst/videosignal/gstsimplevideomark.c
index 30d9914a1..2b7606a53 100644
--- a/gst/videosignal/gstsimplevideomark.c
+++ b/gst/videosignal/gstsimplevideomark.c
@@ -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)
diff --git a/gst/videosignal/gstsimplevideomark.h b/gst/videosignal/gstsimplevideomark.h
index 63bc31107..e4b8136f1 100644
--- a/gst/videosignal/gstsimplevideomark.h
+++ b/gst/videosignal/gstsimplevideomark.h
@@ -56,6 +56,8 @@ struct _GstSimpleVideoMarkClass
GType gst_video_mark_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (simplevideomark);
+
G_END_DECLS
#endif
diff --git a/gst/videosignal/gstsimplevideomarkdetect.c b/gst/videosignal/gstsimplevideomarkdetect.c
index 112d5d886..5f806bc67 100644
--- a/gst/videosignal/gstsimplevideomarkdetect.c
+++ b/gst/videosignal/gstsimplevideomarkdetect.c
@@ -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)
diff --git a/gst/videosignal/gstsimplevideomarkdetect.h b/gst/videosignal/gstsimplevideomarkdetect.h
index 51386867c..f7628c2cd 100644
--- a/gst/videosignal/gstsimplevideomarkdetect.h
+++ b/gst/videosignal/gstsimplevideomarkdetect.h
@@ -58,6 +58,8 @@ struct _GstSimpleVideoMarkDetectClass
GType gst_video_detect_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (simplevideomarkdetect);
+
G_END_DECLS
#endif
diff --git a/gst/videosignal/gstvideoanalyse.c b/gst/videosignal/gstvideoanalyse.c
index ab51f525f..99f814a24 100644
--- a/gst/videosignal/gstvideoanalyse.c
+++ b/gst/videosignal/gstvideoanalyse.c
@@ -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)
diff --git a/gst/videosignal/gstvideoanalyse.h b/gst/videosignal/gstvideoanalyse.h
index ee61672b2..2490c0866 100644
--- a/gst/videosignal/gstvideoanalyse.h
+++ b/gst/videosignal/gstvideoanalyse.h
@@ -52,6 +52,8 @@ struct _GstVideoAnalyseClass
GType gst_video_analyse_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (videoanalyse);
+
G_END_DECLS
#endif
diff --git a/gst/videosignal/gstvideosignal.c b/gst/videosignal/gstvideosignal.c
index 918dc028a..76ef12f6a 100644
--- a/gst/videosignal/gstvideosignal.c
+++ b/gst/videosignal/gstvideosignal.c
@@ -28,22 +28,16 @@
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,
diff --git a/gst/vmnc/vmncdec.c b/gst/vmnc/vmncdec.c
index cc51c20a0..93c34e707 100644
--- a/gst/vmnc/vmncdec.c
+++ b/gst/vmnc/vmncdec.c
@@ -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,
diff --git a/gst/vmnc/vmncdec.h b/gst/vmnc/vmncdec.h
index d28ef7dbc..7bdd3cb20 100644
--- a/gst/vmnc/vmncdec.h
+++ b/gst/vmnc/vmncdec.h
@@ -104,7 +104,7 @@ typedef struct
} GstVMncDecClass;
GType gst_vmnc_dec_get_type (void);
-
+GST_ELEMENT_REGISTER_DECLARE (vmncdec);
G_END_DECLS
diff --git a/gst/y4m/gsty4mdec.c b/gst/y4m/gsty4mdec.c
index da8ae387d..bae28f425 100644
--- a/gst/y4m/gsty4mdec.c
+++ b/gst/y4m/gsty4mdec.c
@@ -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,
diff --git a/gst/y4m/gsty4mdec.h b/gst/y4m/gsty4mdec.h
index c2eb9b0c6..9e56e2f91 100644
--- a/gst/y4m/gsty4mdec.h
+++ b/gst/y4m/gsty4mdec.h
@@ -62,6 +62,7 @@ struct _GstY4mDecClass
};
GType gst_y4m_dec_get_type (void);
+GST_ELEMENT_REGISTER_DECLARE (y4mdec);
G_END_DECLS