playback: remove useless ret test

Use GST_ELEMENT_REGISTER_DEFINE_CUSTOM instead
of GST_ELEMENT_REGISTER_DEFINE_WITH_CODE if a specific
init needs to be tested before registering the element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1060>
This commit is contained in:
Stéphane Cerveau 2021-03-08 10:45:32 +01:00
parent 20da00f057
commit 01d1bbd1da
11 changed files with 11 additions and 10 deletions

View file

@ -603,7 +603,7 @@ G_DEFINE_TYPE (GstDecodeBin, gst_decode_bin, GST_TYPE_BIN);
topology_next = g_quark_from_static_string ("next");\
topology_pad = g_quark_from_static_string ("pad");\
topology_element_srcpad = g_quark_from_static_string ("element-srcpad");\
ret |= playback_element_init (plugin);\
playback_element_init (plugin);\
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (decodebin, "decodebin", GST_RANK_NONE,
GST_TYPE_DECODE_BIN, _do_init);

View file

@ -427,7 +427,7 @@ GType gst_decodebin3_get_type (void);
G_DEFINE_TYPE (GstDecodebin3, gst_decodebin3, GST_TYPE_BIN);
#define _do_init \
GST_DEBUG_CATEGORY_INIT (decodebin3_debug, "decodebin3", 0, "decoder bin");\
ret |= playback_element_init (plugin);
playback_element_init (plugin);
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (decodebin3, "decodebin3", GST_RANK_NONE,
GST_TYPE_DECODEBIN3, _do_init);

View file

@ -502,7 +502,7 @@ static GType gst_parse_bin_get_type (void);
G_DEFINE_TYPE (GstParseBin, gst_parse_bin, GST_TYPE_BIN);
#define _do_init \
GST_DEBUG_CATEGORY_INIT (gst_parse_bin_debug, "parsebin", 0, "parser bin");\
ret |= playback_element_init (plugin);
playback_element_init (plugin);
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (parsebin, "parsebin", GST_RANK_NONE,
GST_TYPE_PARSE_BIN, _do_init);

View file

@ -41,6 +41,7 @@ plugin_init (GstPlugin * plugin)
gboolean res = FALSE;
if (!g_getenv ("USE_PLAYBIN3"))
res |= GST_ELEMENT_REGISTER (playbin, plugin);
res |= GST_ELEMENT_REGISTER (playbin3, plugin);
res |= GST_ELEMENT_REGISTER (playsink, plugin);
res |= GST_ELEMENT_REGISTER (subtitleoverlay, plugin);

View file

@ -685,7 +685,7 @@ G_DEFINE_TYPE_WITH_CODE (GstPlayBin, gst_play_bin, GST_TYPE_PIPELINE,
_do_init_type (g_define_type_id));
#define _do_init \
GST_DEBUG_CATEGORY_INIT (gst_play_bin_debug, "playbin", 0, "play bin");\
ret |= playback_element_init (plugin);
playback_element_init (plugin);
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (playbin, "playbin", GST_RANK_NONE,
GST_TYPE_PLAY_BIN, _do_init);

View file

@ -441,7 +441,7 @@ G_DEFINE_TYPE_WITH_CODE (GstPlaySink, gst_play_sink, GST_TYPE_BIN,
_do_init_type (g_define_type_id));
#define _do_init \
GST_DEBUG_CATEGORY_INIT (gst_play_sink_debug, "playsink", 0, "play sink");\
ret |= playback_element_init (plugin);
playback_element_init (plugin);
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (playsink, "playsink", GST_RANK_NONE,
GST_TYPE_PLAY_SINK, _do_init);

View file

@ -57,7 +57,7 @@ static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink_%u",
G_DEFINE_TYPE (GstStreamSynchronizer, gst_stream_synchronizer,
GST_TYPE_ELEMENT);
#define _do_init \
ret |= playback_element_init (plugin);
playback_element_init (plugin);
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (streamsynchronizer, "streamsynchronizer",
GST_RANK_NONE, GST_TYPE_STREAM_SYNCHRONIZER, _do_init);

View file

@ -88,7 +88,7 @@ static GQuark _subtitle_overlay_event_marker_id = 0;
#define _do_init \
GST_DEBUG_CATEGORY_INIT (subtitle_overlay_debug, "subtitleoverlay", 0, "Subtitle Overlay"); \
ret |= playback_element_init (plugin); \
playback_element_init (plugin); \
_subtitle_overlay_event_marker_id = g_quark_from_static_string ("gst-subtitle-overlay-event-marker")
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (subtitleoverlay, "subtitleoverlay",
GST_RANK_NONE, GST_TYPE_SUBTITLE_OVERLAY, _do_init);

View file

@ -210,7 +210,7 @@ G_DEFINE_TYPE (GstURIDecodeBin, gst_uri_decode_bin, GST_TYPE_BIN);
#define _do_init \
GST_DEBUG_CATEGORY_INIT (gst_uri_decode_bin_debug, "uridecodebin", 0, "URI decoder element"); \
ret |= playback_element_init (plugin);
playback_element_init (plugin);
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (uridecodebin, "uridecodebin",
GST_RANK_NONE, GST_TYPE_URI_DECODE_BIN, _do_init);

View file

@ -331,7 +331,7 @@ G_DEFINE_TYPE (GstURIDecodeBin3, gst_uri_decode_bin3, GST_TYPE_BIN);
#define _do_init \
GST_DEBUG_CATEGORY_INIT (gst_uri_decode_bin3_debug, "uridecodebin3", 0, "URI decoder element 3"); \
ret |= playback_element_init (plugin);
playback_element_init (plugin);
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (uridecodebin3, "uridecodebin3",
GST_RANK_NONE, GST_TYPE_URI_DECODE_BIN3, _do_init);

View file

@ -258,7 +258,7 @@ G_DEFINE_TYPE (GstURISourceBin, gst_uri_source_bin, GST_TYPE_BIN);
#define _do_init \
GST_DEBUG_CATEGORY_INIT (gst_uri_source_bin_debug, "urisourcebin", 0, "URI source element"); \
ret |= playback_element_init (plugin);
playback_element_init (plugin);
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (urisourcebin, "urisourcebin",
GST_RANK_NONE, GST_TYPE_URI_SOURCE_BIN, _do_init);