theora: 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-base/-/merge_requests/1029>
This commit is contained in:
Stéphane Cerveau 2020-12-11 18:46:20 +01:00 committed by GStreamer Marge Bot
parent 2a8adec5f2
commit d41e8c68bf
7 changed files with 20 additions and 14 deletions

View file

@ -23,26 +23,20 @@
#include <gst/gst.h> #include <gst/gst.h>
extern GType gst_theora_dec_get_type (void); #include "gsttheoradec.h"
extern GType gst_theora_enc_get_type (void); #include "gsttheoraenc.h"
extern GType gst_theora_parse_get_type (void); #include "gsttheoraparse.h"
static gboolean static gboolean
plugin_init (GstPlugin * plugin) plugin_init (GstPlugin * plugin)
{ {
if (!gst_element_register (plugin, "theoradec", GST_RANK_PRIMARY, gboolean ret = FALSE;
gst_theora_dec_get_type ()))
return FALSE;
if (!gst_element_register (plugin, "theoraenc", GST_RANK_PRIMARY, ret |= GST_ELEMENT_REGISTER (theoradec, plugin);
gst_theora_enc_get_type ())) ret |= GST_ELEMENT_REGISTER (theoraenc, plugin);
return FALSE; ret |= GST_ELEMENT_REGISTER (theoraparse, plugin);
if (!gst_element_register (plugin, "theoraparse", GST_RANK_NONE, return ret;
gst_theora_parse_get_type ()))
return FALSE;
return TRUE;
} }
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,

View file

@ -91,6 +91,8 @@ GST_STATIC_PAD_TEMPLATE ("sink",
#define gst_theora_dec_parent_class parent_class #define gst_theora_dec_parent_class parent_class
G_DEFINE_TYPE (GstTheoraDec, gst_theora_dec, GST_TYPE_VIDEO_DECODER); G_DEFINE_TYPE (GstTheoraDec, gst_theora_dec, GST_TYPE_VIDEO_DECODER);
GST_ELEMENT_REGISTER_DEFINE (theoradec, "theoradec",
GST_RANK_PRIMARY, GST_TYPE_THEORA_DEC);
static void theora_dec_get_property (GObject * object, guint prop_id, static void theora_dec_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec); GValue * value, GParamSpec * pspec);

View file

@ -87,6 +87,8 @@ struct _GstTheoraDecClass
GType gst_theora_dec_get_type (void); GType gst_theora_dec_get_type (void);
GST_ELEMENT_REGISTER_DECLARE (theoradec);
G_END_DECLS G_END_DECLS
#endif /* __GST_THEORADEC_H__ */ #endif /* __GST_THEORADEC_H__ */

View file

@ -176,6 +176,8 @@ GST_STATIC_PAD_TEMPLATE ("src",
#define gst_theora_enc_parent_class parent_class #define gst_theora_enc_parent_class parent_class
G_DEFINE_TYPE (GstTheoraEnc, gst_theora_enc, GST_TYPE_VIDEO_ENCODER); G_DEFINE_TYPE (GstTheoraEnc, gst_theora_enc, GST_TYPE_VIDEO_ENCODER);
GST_ELEMENT_REGISTER_DEFINE (theoraenc, "theoraenc",
GST_RANK_PRIMARY, GST_TYPE_THEORA_ENC);
static gboolean theora_enc_start (GstVideoEncoder * enc); static gboolean theora_enc_start (GstVideoEncoder * enc);
static gboolean theora_enc_stop (GstVideoEncoder * enc); static gboolean theora_enc_stop (GstVideoEncoder * enc);

View file

@ -113,6 +113,8 @@ struct _GstTheoraEncClass
GType gst_theora_enc_get_type (void); GType gst_theora_enc_get_type (void);
GST_ELEMENT_REGISTER_DECLARE (theoraenc);
G_END_DECLS G_END_DECLS
#endif /* __GST_THEORAENC_H__ */ #endif /* __GST_THEORAENC_H__ */

View file

@ -91,6 +91,8 @@ enum
#define gst_theora_parse_parent_class parent_class #define gst_theora_parse_parent_class parent_class
G_DEFINE_TYPE (GstTheoraParse, gst_theora_parse, GST_TYPE_ELEMENT); G_DEFINE_TYPE (GstTheoraParse, gst_theora_parse, GST_TYPE_ELEMENT);
GST_ELEMENT_REGISTER_DEFINE (theoraparse, "theoraparse",
GST_RANK_NONE, GST_TYPE_THEORA_PARSE);
static void theora_parse_dispose (GObject * object); static void theora_parse_dispose (GObject * object);

View file

@ -82,6 +82,8 @@ struct _GstTheoraParseClass {
GType gst_theora_parse_get_type(void); GType gst_theora_parse_get_type(void);
GST_ELEMENT_REGISTER_DECLARE (theoraparse);
G_END_DECLS G_END_DECLS
#endif /* __GST_THEORA_PARSE_H__ */ #endif /* __GST_THEORA_PARSE_H__ */