summaryrefslogtreecommitdiff
path: root/gst/audiovisualizers
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 /gst/audiovisualizers
parent7f60138ef68e2a1fef8ccd4ff3710dfccd243314 (diff)
downloadgstreamer-plugins-bad-891be511057dbcdf1f38740e55cbd376c4b25894.tar.gz
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>
Diffstat (limited to 'gst/audiovisualizers')
-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
9 files changed, 35 insertions, 51 deletions
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,