openjpeg: 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 15:30:06 +01:00 committed by GStreamer Marge Bot
parent 8fa3dd4bf3
commit c4a1de5510
5 changed files with 13 additions and 7 deletions

View file

@ -30,14 +30,12 @@
static gboolean static gboolean
plugin_init (GstPlugin * plugin) plugin_init (GstPlugin * plugin)
{ {
if (!gst_element_register (plugin, "openjpegdec", GST_RANK_PRIMARY, gboolean ret = FALSE;
GST_TYPE_OPENJPEG_DEC))
return FALSE;
if (!gst_element_register (plugin, "openjpegenc", GST_RANK_PRIMARY,
GST_TYPE_OPENJPEG_ENC))
return FALSE;
return TRUE; ret |= GST_ELEMENT_REGISTER (openjpegdec, plugin);
ret |= GST_ELEMENT_REGISTER (openjpegenc, plugin);
return ret;
} }
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,

View file

@ -83,6 +83,8 @@ GST_STATIC_PAD_TEMPLATE ("src",
#define parent_class gst_openjpeg_dec_parent_class #define parent_class gst_openjpeg_dec_parent_class
G_DEFINE_TYPE (GstOpenJPEGDec, gst_openjpeg_dec, GST_TYPE_VIDEO_DECODER); G_DEFINE_TYPE (GstOpenJPEGDec, gst_openjpeg_dec, GST_TYPE_VIDEO_DECODER);
GST_ELEMENT_REGISTER_DEFINE (openjpegdec, "openjpegdec",
GST_RANK_PRIMARY, GST_TYPE_OPENJPEG_DEC);
static void static void
gst_openjpeg_dec_class_init (GstOpenJPEGDecClass * klass) gst_openjpeg_dec_class_init (GstOpenJPEGDecClass * klass)

View file

@ -72,6 +72,8 @@ struct _GstOpenJPEGDecClass
GType gst_openjpeg_dec_get_type (void); GType gst_openjpeg_dec_get_type (void);
GST_ELEMENT_REGISTER_DECLARE (openjpegdec);
G_END_DECLS G_END_DECLS
#endif /* __GST_OPENJPEG_DEC_H__ */ #endif /* __GST_OPENJPEG_DEC_H__ */

View file

@ -134,6 +134,8 @@ static GstStaticPadTemplate gst_openjpeg_enc_src_template =
#define parent_class gst_openjpeg_enc_parent_class #define parent_class gst_openjpeg_enc_parent_class
G_DEFINE_TYPE (GstOpenJPEGEnc, gst_openjpeg_enc, GST_TYPE_VIDEO_ENCODER); G_DEFINE_TYPE (GstOpenJPEGEnc, gst_openjpeg_enc, GST_TYPE_VIDEO_ENCODER);
GST_ELEMENT_REGISTER_DEFINE (openjpegenc, "openjpegenc",
GST_RANK_PRIMARY, GST_TYPE_OPENJPEG_ENC);
static void static void
gst_openjpeg_enc_class_init (GstOpenJPEGEncClass * klass) gst_openjpeg_enc_class_init (GstOpenJPEGEncClass * klass)

View file

@ -67,6 +67,8 @@ struct _GstOpenJPEGEncClass
GType gst_openjpeg_enc_get_type (void); GType gst_openjpeg_enc_get_type (void);
GST_ELEMENT_REGISTER_DECLARE (openjpegenc);
G_END_DECLS G_END_DECLS
#endif /* __GST_OPENJPEG_ENC_H__ */ #endif /* __GST_OPENJPEG_ENC_H__ */