libpng: 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:33:50 +01:00
parent abd5c40691
commit fb29c4b07f
5 changed files with 12 additions and 7 deletions

View file

@ -29,15 +29,12 @@
static gboolean
plugin_init (GstPlugin * plugin)
{
if (!gst_element_register (plugin, "pngdec", GST_RANK_PRIMARY,
GST_TYPE_PNGDEC))
return FALSE;
gboolean ret = FALSE;
if (!gst_element_register (plugin, "pngenc", GST_RANK_PRIMARY,
GST_TYPE_PNGENC))
return FALSE;
ret |= GST_ELEMENT_REGISTER (pngdec, plugin);
ret |= GST_ELEMENT_REGISTER (pngenc, plugin);
return TRUE;
return ret;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,

View file

@ -62,6 +62,8 @@ static gboolean gst_pngdec_sink_event (GstVideoDecoder * bdec,
#define parent_class gst_pngdec_parent_class
G_DEFINE_TYPE (GstPngDec, gst_pngdec, GST_TYPE_VIDEO_DECODER);
GST_ELEMENT_REGISTER_DEFINE (pngdec, "pngdec", GST_RANK_PRIMARY,
GST_TYPE_PNGDEC);
static GstStaticPadTemplate gst_pngdec_src_pad_template =
GST_STATIC_PAD_TEMPLATE ("src",

View file

@ -53,6 +53,8 @@ struct _GstPngDec
gsize read_data;
};
GST_ELEMENT_REGISTER_DECLARE (pngdec);
G_END_DECLS
#endif /* __GST_PNGDEC_H__ */

View file

@ -74,6 +74,8 @@ GST_STATIC_PAD_TEMPLATE ("sink",
#define parent_class gst_pngenc_parent_class
G_DEFINE_TYPE (GstPngEnc, gst_pngenc, GST_TYPE_VIDEO_ENCODER);
GST_ELEMENT_REGISTER_DEFINE (pngenc, "pngenc", GST_RANK_PRIMARY,
GST_TYPE_PNGENC);
static void gst_pngenc_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec);

View file

@ -50,6 +50,8 @@ struct _GstPngEnc
gboolean newmedia;
};
GST_ELEMENT_REGISTER_DECLARE (pngenc);
G_END_DECLS
#endif /* __GST_PNGENC_H__ */