From bae7151c4d99c40d13657c4275340aac26451cd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Cerveau?= Date: Thu, 18 Feb 2021 10:14:38 +0100 Subject: [PATCH] mpeg2enc: 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: --- ext/mpeg2enc/gstmpeg2enc.cc | 10 +++++++++- ext/mpeg2enc/gstmpeg2enc.hh | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ext/mpeg2enc/gstmpeg2enc.cc b/ext/mpeg2enc/gstmpeg2enc.cc index 5ad5415aba..1eaa5b3911 100644 --- a/ext/mpeg2enc/gstmpeg2enc.cc +++ b/ext/mpeg2enc/gstmpeg2enc.cc @@ -106,10 +106,12 @@ static void gst_mpeg2enc_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static gboolean gst_mpeg2enc_src_activate_mode (GstPad * pad, GstObject * parent, GstPadMode mode, gboolean active); +static gboolean mpeg2enc_element_init (GstPlugin * plugin); #define gst_mpeg2enc_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstMpeg2enc, gst_mpeg2enc, GST_TYPE_VIDEO_ENCODER, G_IMPLEMENT_INTERFACE (GST_TYPE_PRESET, NULL)); +GST_ELEMENT_REGISTER_DEFINE_CUSTOM (mpeg2enc, mpeg2enc_element_init); static void gst_mpeg2enc_class_init (GstMpeg2encClass * klass) @@ -781,7 +783,7 @@ gst_mpeg2enc_log_callback (log_level_t level, const char *message) #endif static gboolean -plugin_init (GstPlugin * plugin) +mpeg2enc_element_init (GstPlugin * plugin) { #ifndef GST_DISABLE_GST_DEBUG old_handler = mjpeg_log_set_handler (gst_mpeg2enc_log_callback); @@ -794,6 +796,12 @@ plugin_init (GstPlugin * plugin) GST_RANK_MARGINAL, GST_TYPE_MPEG2ENC); } +static gboolean +plugin_init (GstPlugin * plugin) +{ + return GST_ELEMENT_REGISTER (mpeg2enc, plugin); +} + GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, mpeg2enc, diff --git a/ext/mpeg2enc/gstmpeg2enc.hh b/ext/mpeg2enc/gstmpeg2enc.hh index ab02aedddd..fcc3fb933a 100644 --- a/ext/mpeg2enc/gstmpeg2enc.hh +++ b/ext/mpeg2enc/gstmpeg2enc.hh @@ -100,6 +100,8 @@ typedef struct _GstMpeg2encClass { GType gst_mpeg2enc_get_type (void); +GST_ELEMENT_REGISTER_DECLARE (mpeg2enc); + G_END_DECLS #endif /* __GST_MPEG2ENC_H__ */