diff --git a/ext/resindvd/plugin.c b/ext/resindvd/plugin.c index 15bca9db42..da9dcfc6d3 100644 --- a/ext/resindvd/plugin.c +++ b/ext/resindvd/plugin.c @@ -25,32 +25,12 @@ #include "resindvdbin.h" #include "gstmpegdemux.h" -#include -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, diff --git a/ext/resindvd/resindvdbin.c b/ext/resindvd/resindvdbin.c index ce2bd1ccff..76727f2e5a 100644 --- a/ext/resindvd/resindvdbin.c +++ b/ext/resindvd/resindvdbin.c @@ -28,6 +28,7 @@ #include #include #include +#include #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; +} diff --git a/ext/resindvd/resindvdbin.h b/ext/resindvd/resindvdbin.h index 2eab5162f9..d92e1b4baa 100644 --- a/ext/resindvd/resindvdbin.h +++ b/ext/resindvd/resindvdbin.h @@ -86,6 +86,8 @@ struct _RsnDvdBinClass GType rsn_dvdbin_get_type (void); +GST_ELEMENT_REGISTER_DECLARE (rsndvdbin); + G_END_DECLS #endif /* __RESINDVDBIN_H__ */