summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2010-08-26 21:07:51 (GMT)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2010-08-27 14:59:08 (GMT)
commitd7f59ca0c4d14b658331c7a80bc99efcdee05d19 (patch)
tree20184634cd898bf7b52e572d56d0056f8830b354
parent4f3cccc77a19dbd78895420b313ca836f1778306 (diff)
pad: Deprecate GST_FLOW_IS_FATAL() and GST_FLOW_IS_SUCCESS()
The problem with both macros is, that they suggest something that isn't true. If GST_FLOW_IS_FATAL is true, there could still be a problem for many elements and they should stop what they're currently doing and return that value upstream (e.g. not-linked in a parser). If GST_FLOW_IS_SUCCESS is false, it could still be that this is "ok" for the element (e.g. not-linked for a demuxer on a few of its pads but not all). It's better to not have these "convenience" macros but instead let people *think* about the handling of different flow returns, that makes sense for their element. And we should document the expected handling of flow returns for different classes of elements in the plugin writer's guide. Fixes bug #628014.
-rw-r--r--gst/gstpad.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/gst/gstpad.h b/gst/gstpad.h
index 99d4e05..10cb206 100644
--- a/gst/gstpad.h
+++ b/gst/gstpad.h
@@ -158,8 +158,13 @@ typedef enum {
* whether an error message should be posted on the bus. Note that such
* elements may also need to post an error message in the #GST_FLOW_NOT_LINKED
* case which is not caught by this macro.
+ *
+ * Deprecated: This macro is badly named and can't be used in any real
+ * scenarios without additional checks.
*/
+#ifndef GST_DISABLE_DEPRECATED
#define GST_FLOW_IS_FATAL(ret) ((ret) <= GST_FLOW_UNEXPECTED)
+#endif
/**
* GST_FLOW_IS_SUCCESS:
@@ -171,8 +176,13 @@ typedef enum {
* of a buffer was successfull.
*
* Since: 0.10.7
+ *
+ * Deprecated: This macro is badly named and can't be used in any real
+ * scenarios without additional checks.
*/
+#ifndef GST_DISABLE_DEPRECATED
#define GST_FLOW_IS_SUCCESS(ret) ((ret) >= GST_FLOW_OK)
+#endif
G_CONST_RETURN gchar* gst_flow_get_name (GstFlowReturn ret);
GQuark gst_flow_to_quark (GstFlowReturn ret);