dvdsub: 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-ugly/-/merge_requests/79>
This commit is contained in:
Stéphane Cerveau 2021-03-29 13:23:51 +02:00 committed by GStreamer Marge Bot
parent df2452e8ef
commit f2a9ea9d7b
4 changed files with 22 additions and 11 deletions

View file

@ -26,8 +26,14 @@
#include "gstdvdsubparse.h"
#include <string.h>
GST_DEBUG_CATEGORY_STATIC (gst_dvd_sub_dec_debug);
#define GST_CAT_DEFAULT (gst_dvd_sub_dec_debug)
#define gst_dvd_sub_dec_parent_class parent_class
G_DEFINE_TYPE (GstDvdSubDec, gst_dvd_sub_dec, GST_TYPE_ELEMENT);
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (dvdsubdec, "dvdsubdec", GST_RANK_NONE,
GST_TYPE_DVD_SUB_DEC, GST_DEBUG_CATEGORY_INIT (gst_dvd_sub_dec_debug,
"dvdsubdec", 0, "DVD subtitle decoder"));
static gboolean gst_dvd_sub_dec_src_event (GstPad * srcpad, GstObject * parent,
GstEvent * event);
@ -61,8 +67,6 @@ static GstStaticPadTemplate subtitle_template = GST_STATIC_PAD_TEMPLATE ("sink",
GST_STATIC_CAPS ("subpicture/x-dvd")
);
GST_DEBUG_CATEGORY_STATIC (gst_dvd_sub_dec_debug);
#define GST_CAT_DEFAULT (gst_dvd_sub_dec_debug)
enum
{
@ -1145,17 +1149,12 @@ not_handled:
static gboolean
plugin_init (GstPlugin * plugin)
{
if (!gst_element_register (plugin, "dvdsubdec", GST_RANK_NONE,
GST_TYPE_DVD_SUB_DEC) ||
!gst_element_register (plugin, "dvdsubparse", GST_RANK_NONE,
GST_TYPE_DVD_SUB_PARSE)) {
return FALSE;
}
gboolean ret = FALSE;
GST_DEBUG_CATEGORY_INIT (gst_dvd_sub_dec_debug, "dvdsubdec", 0,
"DVD subtitle decoder");
ret |= GST_ELEMENT_REGISTER (dvdsubdec, plugin);
ret |= GST_ELEMENT_REGISTER (dvdsubparse, plugin);
return TRUE;
return ret;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,

View file

@ -17,10 +17,14 @@
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __GST_DVDSUBDEC_H__
#define __GST_DVDSUBDEC_H__
#include <gst/gst.h>
#include <gst/video/video.h>
G_BEGIN_DECLS
#define GST_TYPE_DVD_SUB_DEC (gst_dvd_sub_dec_get_type())
#define GST_DVD_SUB_DEC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DVD_SUB_DEC,GstDvdSubDec))
#define GST_DVD_SUB_DEC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DVD_SUB_DEC,GstDvdSubDecClass))
@ -100,3 +104,8 @@ struct _GstDvdSubDecClass
};
GType gst_dvd_sub_dec_get_type (void);
GST_ELEMENT_REGISTER_DECLARE (dvdsubdec);
G_END_DECLS
#endif /* __GST_DVDSUBDEC_H__ */

View file

@ -54,6 +54,8 @@ static GstStateChangeReturn gst_dvd_sub_parse_change_state (GstElement *
#define gst_dvd_sub_parse_parent_class parent_class
G_DEFINE_TYPE (GstDvdSubParse, gst_dvd_sub_parse, GST_TYPE_ELEMENT);
GST_ELEMENT_REGISTER_DEFINE (dvdsubparse, "dvdsubparse", GST_RANK_NONE,
GST_TYPE_DVD_SUB_PARSE);
static void
gst_dvd_sub_parse_class_init (GstDvdSubParseClass * klass)

View file

@ -58,6 +58,7 @@ struct _GstDvdSubParseClass {
};
GType gst_dvd_sub_parse_get_type (void);
GST_ELEMENT_REGISTER_DECLARE (dvdsubparse);
G_END_DECLS