From 01d1bbd1dadf2992769d351023d624eacb0a92c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Cerveau?= Date: Mon, 8 Mar 2021 10:45:32 +0100 Subject: [PATCH] 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: --- gst/playback/gstdecodebin2.c | 2 +- gst/playback/gstdecodebin3.c | 2 +- gst/playback/gstparsebin.c | 2 +- gst/playback/gstplaybackplugin.c | 1 + gst/playback/gstplaybin2.c | 2 +- gst/playback/gstplaysink.c | 2 +- gst/playback/gststreamsynchronizer.c | 2 +- gst/playback/gstsubtitleoverlay.c | 2 +- gst/playback/gsturidecodebin.c | 2 +- gst/playback/gsturidecodebin3.c | 2 +- gst/playback/gsturisourcebin.c | 2 +- 11 files changed, 11 insertions(+), 10 deletions(-) diff --git a/gst/playback/gstdecodebin2.c b/gst/playback/gstdecodebin2.c index c46ac22c08..b9dc374c18 100644 --- a/gst/playback/gstdecodebin2.c +++ b/gst/playback/gstdecodebin2.c @@ -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); diff --git a/gst/playback/gstdecodebin3.c b/gst/playback/gstdecodebin3.c index 3cf52439ee..423863d4cc 100644 --- a/gst/playback/gstdecodebin3.c +++ b/gst/playback/gstdecodebin3.c @@ -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); diff --git a/gst/playback/gstparsebin.c b/gst/playback/gstparsebin.c index ab3b587652..276e796c8d 100644 --- a/gst/playback/gstparsebin.c +++ b/gst/playback/gstparsebin.c @@ -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); diff --git a/gst/playback/gstplaybackplugin.c b/gst/playback/gstplaybackplugin.c index 95d438dc3d..4adc532728 100644 --- a/gst/playback/gstplaybackplugin.c +++ b/gst/playback/gstplaybackplugin.c @@ -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); diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index c13bfa80cd..ff0912c34a 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -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); diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c index c53a5f1aac..49eecc4394 100644 --- a/gst/playback/gstplaysink.c +++ b/gst/playback/gstplaysink.c @@ -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); diff --git a/gst/playback/gststreamsynchronizer.c b/gst/playback/gststreamsynchronizer.c index 082e8b0bc6..cd7115ef5b 100644 --- a/gst/playback/gststreamsynchronizer.c +++ b/gst/playback/gststreamsynchronizer.c @@ -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); diff --git a/gst/playback/gstsubtitleoverlay.c b/gst/playback/gstsubtitleoverlay.c index 8e19fca719..f57cbd4ca9 100644 --- a/gst/playback/gstsubtitleoverlay.c +++ b/gst/playback/gstsubtitleoverlay.c @@ -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); diff --git a/gst/playback/gsturidecodebin.c b/gst/playback/gsturidecodebin.c index 4807df1928..c9be793c00 100644 --- a/gst/playback/gsturidecodebin.c +++ b/gst/playback/gsturidecodebin.c @@ -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); diff --git a/gst/playback/gsturidecodebin3.c b/gst/playback/gsturidecodebin3.c index 0f64565599..f672ef7034 100644 --- a/gst/playback/gsturidecodebin3.c +++ b/gst/playback/gsturidecodebin3.c @@ -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); diff --git a/gst/playback/gsturisourcebin.c b/gst/playback/gsturisourcebin.c index 89275e5b4b..3dcb7840d5 100644 --- a/gst/playback/gsturisourcebin.c +++ b/gst/playback/gsturisourcebin.c @@ -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);