playback: remove useless ret test
authorStéphane Cerveau <scerveau@collabora.com>
Mon, 8 Mar 2021 09:45:32 +0000 (10:45 +0100)
committerStéphane Cerveau <scerveau@collabora.com>
Wed, 10 Mar 2021 19:06:20 +0000 (20:06 +0100)
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>

gst/playback/gstdecodebin2.c
gst/playback/gstdecodebin3.c
gst/playback/gstparsebin.c
gst/playback/gstplaybackplugin.c
gst/playback/gstplaybin2.c
gst/playback/gstplaysink.c
gst/playback/gststreamsynchronizer.c
gst/playback/gstsubtitleoverlay.c
gst/playback/gsturidecodebin.c
gst/playback/gsturidecodebin3.c
gst/playback/gsturisourcebin.c

index c46ac22..b9dc374 100644 (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);
index 3cf5243..423863d 100644 (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);
 
index ab3b587..276e796 100644 (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);
 
index 95d438d..4adc532 100644 (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);
index c13bfa8..ff0912c 100644 (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);
 
index c53a5f1..49eecc4 100644 (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);
 
index 082e8b0..cd7115e 100644 (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);
 
index 8e19fca..f57cbd4 100644 (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);
index 4807df1..c9be793 100644 (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);
 
index 0f64565..f672ef7 100644 (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);
 
index 89275e5..3dcb784 100644 (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);