lame: 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-good/-/merge_requests/876>
This commit is contained in:
Stéphane Cerveau 2021-02-12 10:27:18 +01:00
parent dd3496c830
commit abd5c40691
3 changed files with 15 additions and 20 deletions

View file

@ -191,7 +191,19 @@ static void gst_lamemp3enc_get_property (GObject * object, guint prop_id,
static gboolean gst_lamemp3enc_setup (GstLameMP3Enc * lame, GstTagList ** tags); static gboolean gst_lamemp3enc_setup (GstLameMP3Enc * lame, GstTagList ** tags);
#define gst_lamemp3enc_parent_class parent_class #define gst_lamemp3enc_parent_class parent_class
G_DEFINE_TYPE (GstLameMP3Enc, gst_lamemp3enc, GST_TYPE_AUDIO_ENCODER); #ifdef ENABLE_NLS
#define _do_init \
GST_DEBUG_CATEGORY_INIT (debug, "lamemp3enc", 0, "lame mp3 encoder");\
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);\
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#else /* ENABLE_NLS */
#define _do_init \
GST_DEBUG_CATEGORY_INIT (debug, "lamemp3enc", 0, "lame mp3 encoder");
#endif
G_DEFINE_TYPE_WITH_CODE (GstLameMP3Enc, gst_lamemp3enc, GST_TYPE_AUDIO_ENCODER,
_do_init);
GST_ELEMENT_REGISTER_DEFINE (lamemp3enc, "lamemp3enc", GST_RANK_PRIMARY,
GST_TYPE_LAMEMP3ENC);
static void static void
gst_lamemp3enc_release_memory (GstLameMP3Enc * lame) gst_lamemp3enc_release_memory (GstLameMP3Enc * lame)
@ -920,15 +932,3 @@ gst_lamemp3enc_setup (GstLameMP3Enc * lame, GstTagList ** tags)
return res; return res;
#undef CHECK_ERROR #undef CHECK_ERROR
} }
gboolean
gst_lamemp3enc_register (GstPlugin * plugin)
{
GST_DEBUG_CATEGORY_INIT (debug, "lamemp3enc", 0, "lame mp3 encoder");
if (!gst_element_register (plugin, "lamemp3enc", GST_RANK_PRIMARY,
GST_TYPE_LAMEMP3ENC))
return FALSE;
return TRUE;
}

View file

@ -61,7 +61,7 @@ struct _GstLameMP3Enc {
GstAdapter *adapter; GstAdapter *adapter;
}; };
gboolean gst_lamemp3enc_register (GstPlugin * plugin); GST_ELEMENT_REGISTER_DECLARE (lamemp3enc);
G_END_DECLS G_END_DECLS

View file

@ -29,12 +29,7 @@
static gboolean static gboolean
plugin_init (GstPlugin * plugin) plugin_init (GstPlugin * plugin)
{ {
#ifdef ENABLE_NLS return GST_ELEMENT_REGISTER (lamemp3enc, plugin);
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#endif /* ENABLE_NLS */
return gst_lamemp3enc_register (plugin);
} }
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,