resindvd: 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-19 11:40:40 +01:00 committed by GStreamer Marge Bot
parent c271d2958e
commit 1b0d570ee3
3 changed files with 33 additions and 21 deletions

View file

@ -25,32 +25,12 @@
#include "resindvdbin.h"
#include "gstmpegdemux.h"
#include <gst/gst-i18n-plugin.h>
GST_DEBUG_CATEGORY (resindvd_debug);
#define GST_CAT_DEFAULT resindvd_debug
static gboolean
plugin_init (GstPlugin * plugin)
{
gboolean result = TRUE;
GST_DEBUG_CATEGORY_INIT (resindvd_debug, "resindvd",
0, "DVD playback elements from resindvd");
#ifdef ENABLE_NLS
GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
LOCALEDIR);
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#endif
result &= gst_element_register (plugin, "rsndvdbin",
GST_RANK_PRIMARY, RESIN_TYPE_DVDBIN);
result &= gst_flups_demux_plugin_init (plugin);
return result;
return GST_ELEMENT_REGISTER (rsndvdbin, plugin);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,

View file

@ -28,6 +28,7 @@
#include <gst/pbutils/missing-plugins.h>
#include <gst/video/video.h>
#include <gst/audio/audio.h>
#include <gst/gst-i18n-plugin.h>
#include "resindvdbin.h"
#include "resindvdsrc.h"
@ -84,10 +85,12 @@ GST_STATIC_PAD_TEMPLATE ("subpicture",
static void rsn_dvdbin_finalize (GObject * object);
static void rsn_dvdbin_uri_handler_init (gpointer g_iface, gpointer iface_data);
static gboolean rsndvdbin_element_init (GstPlugin * plugin);
#define rsn_dvdbin_parent_class parent_class
G_DEFINE_TYPE_WITH_CODE (RsnDvdBin, rsn_dvdbin, GST_TYPE_BIN,
G_IMPLEMENT_INTERFACE (GST_TYPE_URI_HANDLER, rsn_dvdbin_uri_handler_init));
GST_ELEMENT_REGISTER_DEFINE_CUSTOM (rsndvdbin, rsndvdbin_element_init);
static void demux_pad_added (GstElement * element, GstPad * pad,
RsnDvdBin * dvdbin);
@ -100,6 +103,10 @@ static GstStateChangeReturn rsn_dvdbin_change_state (GstElement * element,
GstStateChange transition);
static void rsn_dvdbin_no_more_pads (RsnDvdBin * dvdbin);
GST_DEBUG_CATEGORY (resindvd_debug);
#define GST_CAT_DEFAULT resindvd_debug
static void
rsn_dvdbin_class_init (RsnDvdBinClass * klass)
{
@ -1029,3 +1036,26 @@ rsn_dvdbin_change_state (GstElement * element, GstStateChange transition)
return ret;
}
static gboolean
rsndvdbin_element_init (GstPlugin * plugin)
{
gboolean result = TRUE;
GST_DEBUG_CATEGORY_INIT (resindvd_debug, "resindvd",
0, "DVD playback elements from resindvd");
#ifdef ENABLE_NLS
GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
LOCALEDIR);
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#endif
result &= gst_element_register (plugin, "rsndvdbin",
GST_RANK_PRIMARY, RESIN_TYPE_DVDBIN);
result &= gst_flups_demux_plugin_init (plugin);
return result;
}

View file

@ -86,6 +86,8 @@ struct _RsnDvdBinClass
GType rsn_dvdbin_get_type (void);
GST_ELEMENT_REGISTER_DECLARE (rsndvdbin);
G_END_DECLS
#endif /* __RESINDVDBIN_H__ */