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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2038>
This commit is contained in:
Stéphane Cerveau 2021-02-18 10:14:38 +01:00 committed by GStreamer Marge Bot
parent 6f8aaf807e
commit bae7151c4d
2 changed files with 11 additions and 1 deletions

View file

@ -106,10 +106,12 @@ static void gst_mpeg2enc_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec); guint prop_id, const GValue * value, GParamSpec * pspec);
static gboolean gst_mpeg2enc_src_activate_mode (GstPad * pad, GstObject * parent, static gboolean gst_mpeg2enc_src_activate_mode (GstPad * pad, GstObject * parent,
GstPadMode mode, gboolean active); GstPadMode mode, gboolean active);
static gboolean mpeg2enc_element_init (GstPlugin * plugin);
#define gst_mpeg2enc_parent_class parent_class #define gst_mpeg2enc_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (GstMpeg2enc, gst_mpeg2enc, GST_TYPE_VIDEO_ENCODER, G_DEFINE_TYPE_WITH_CODE (GstMpeg2enc, gst_mpeg2enc, GST_TYPE_VIDEO_ENCODER,
G_IMPLEMENT_INTERFACE (GST_TYPE_PRESET, NULL)); G_IMPLEMENT_INTERFACE (GST_TYPE_PRESET, NULL));
GST_ELEMENT_REGISTER_DEFINE_CUSTOM (mpeg2enc, mpeg2enc_element_init);
static void static void
gst_mpeg2enc_class_init (GstMpeg2encClass * klass) gst_mpeg2enc_class_init (GstMpeg2encClass * klass)
@ -781,7 +783,7 @@ gst_mpeg2enc_log_callback (log_level_t level, const char *message)
#endif #endif
static gboolean static gboolean
plugin_init (GstPlugin * plugin) mpeg2enc_element_init (GstPlugin * plugin)
{ {
#ifndef GST_DISABLE_GST_DEBUG #ifndef GST_DISABLE_GST_DEBUG
old_handler = mjpeg_log_set_handler (gst_mpeg2enc_log_callback); old_handler = mjpeg_log_set_handler (gst_mpeg2enc_log_callback);
@ -794,6 +796,12 @@ plugin_init (GstPlugin * plugin)
GST_RANK_MARGINAL, GST_TYPE_MPEG2ENC); 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_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR, GST_VERSION_MINOR,
mpeg2enc, mpeg2enc,

View file

@ -100,6 +100,8 @@ typedef struct _GstMpeg2encClass {
GType gst_mpeg2enc_get_type (void); GType gst_mpeg2enc_get_type (void);
GST_ELEMENT_REGISTER_DECLARE (mpeg2enc);
G_END_DECLS G_END_DECLS
#endif /* __GST_MPEG2ENC_H__ */ #endif /* __GST_MPEG2ENC_H__ */