From: Stéphane Cerveau Date: Tue, 16 Feb 2021 16:49:03 +0000 (+0100) Subject: shout2: allow per feature registration X-Git-Tag: 1.19.3~509^2~180 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=31c1e8ca13695d31fe7277d294783168d8639d0f;p=platform%2Fupstream%2Fgstreamer.git shout2: 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: --- diff --git a/ext/shout2/gstshout2.c b/ext/shout2/gstshout2.c index d73e35a..57dfd0a 100644 --- a/ext/shout2/gstshout2.c +++ b/ext/shout2/gstshout2.c @@ -151,6 +151,15 @@ gst_shout2send_protocol_get_type (void) #define gst_shout2send_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstShout2send, gst_shout2send, GST_TYPE_BASE_SINK, G_IMPLEMENT_INTERFACE (GST_TYPE_TAG_SETTER, NULL)); +#ifdef ENABLE_NLS +#define _do_init \ + bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);\ + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); +#else /* ENABLE_NLS */ +#define _do_init +#endif +GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (shout2send, "shout2send", GST_RANK_NONE, + GST_TYPE_SHOUT2SEND, _do_init); static void gst_shout2send_class_init (GstShout2sendClass * klass) @@ -949,13 +958,7 @@ gst_shout2send_setcaps (GstBaseSink * basesink, GstCaps * caps) static gboolean plugin_init (GstPlugin * plugin) { -#ifdef ENABLE_NLS - bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); -#endif /* ENABLE_NLS */ - - return gst_element_register (plugin, "shout2send", GST_RANK_NONE, - GST_TYPE_SHOUT2SEND); + return GST_ELEMENT_REGISTER (shout2send, plugin); } GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, diff --git a/ext/shout2/gstshout2.h b/ext/shout2/gstshout2.h index 92a97a7..904d289 100644 --- a/ext/shout2/gstshout2.h +++ b/ext/shout2/gstshout2.h @@ -74,6 +74,8 @@ struct _GstShout2send { GstTagList* tags; }; +GST_ELEMENT_REGISTER_DECLARE (shout2send); + G_END_DECLS #endif /* __GST_SHOUT2SEND_H__ */