element: remove useless ret test

The ret test is unrelevant and confusing.
We dont want the code to fail and the register
to succeed by example.
In the case of a conditional element_init,
the element should be defined with
GST_ELEMENT_REGISTER_DEFINE_CUSTOM instead
of GST_ELEMENT_REGISTER_DEFINE_WITH_CODE.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/768>
This commit is contained in:
Stéphane Cerveau 2021-03-08 10:27:15 +01:00
parent d093b2894b
commit 0da1721364

View file

@ -35,7 +35,6 @@ G_BEGIN_DECLS
G_BEGIN_DECLS \ G_BEGIN_DECLS \
gboolean G_PASTE (gst_element_register_, element) (GstPlugin * plugin) \ gboolean G_PASTE (gst_element_register_, element) (GstPlugin * plugin) \
{ \ { \
gboolean ret = FALSE; \
{ {
/** /**
@ -43,8 +42,7 @@ gboolean G_PASTE (gst_element_register_, element) (GstPlugin * plugin) \
*/ */
#define _GST_ELEMENT_REGISTER_DEFINE_END(element_name, rank, type) \ #define _GST_ELEMENT_REGISTER_DEFINE_END(element_name, rank, type) \
} \ } \
ret |= gst_element_register (plugin, element_name, rank, type); \ return gst_element_register (plugin, element_name, rank, type); \
return ret; \
} \ } \
G_END_DECLS G_END_DECLS
@ -113,7 +111,7 @@ G_END_DECLS
* *
* ``` * ```
* #define _pre_register_init \ * #define _pre_register_init \
* ret |= my_stream_filter_pre_register (plugin); * my_stream_filter_pre_register (plugin);
* GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (stream_filter, "stream-filter", GST_RANK_PRIMARY, MY_TYPE_STREAM_FILTER, _pre_register_init) * GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (stream_filter, "stream-filter", GST_RANK_PRIMARY, MY_TYPE_STREAM_FILTER, _pre_register_init)
* ``` * ```
* *