Make use of the new GST_ELEMENT_FLOW_ERROR API all around.

https://bugzilla.gnome.org/show_bug.cgi?id=770158
This commit is contained in:
Thibault Saunier 2016-08-23 13:27:58 -03:00
parent da73b89200
commit 4714ef2f8e
8 changed files with 11 additions and 37 deletions

View file

@ -3605,8 +3605,7 @@ pause:
/* for fatal errors we post an error message, wrong-state is /* for fatal errors we post an error message, wrong-state is
* not fatal because it happens due to flushes and only means * not fatal because it happens due to flushes and only means
* that we should stop now. */ * that we should stop now. */
GST_ELEMENT_ERROR (parse, STREAM, FAILED, (NULL), GST_ELEMENT_FLOW_ERROR (parse, ret);
("streaming stopped, reason %s", gst_flow_get_name (ret)));
push_eos = TRUE; push_eos = TRUE;
} }
if (push_eos) { if (push_eos) {

View file

@ -4090,9 +4090,7 @@ paused:
* flushing and posting an error message in that case is the * flushing and posting an error message in that case is the
* wrong thing to do, e.g. when basesrc is doing a flushing * wrong thing to do, e.g. when basesrc is doing a flushing
* seek. */ * seek. */
GST_ELEMENT_ERROR (basesink, STREAM, FAILED, GST_ELEMENT_FLOW_ERROR (basesink, result);
(_("Internal data stream error.")),
("stream stopped, reason %s", gst_flow_get_name (result)));
gst_base_sink_event (pad, parent, gst_event_new_eos ()); gst_base_sink_event (pad, parent, gst_event_new_eos ());
} }
return; return;

View file

@ -2947,9 +2947,7 @@ pause:
* due to flushing and posting an error message because of * due to flushing and posting an error message because of
* that is the wrong thing to do, e.g. when we're doing * that is the wrong thing to do, e.g. when we're doing
* a flushing seek. */ * a flushing seek. */
GST_ELEMENT_ERROR (src, STREAM, FAILED, GST_ELEMENT_FLOW_ERROR (src, ret);
(_("Internal data flow error.")),
("streaming task paused, reason %s (%d)", reason, ret));
gst_pad_push_event (pad, event); gst_pad_push_event (pad, event);
} }
goto done; goto done;

View file

@ -1345,10 +1345,7 @@ out_flushing:
* file. */ * file. */
gst_pad_push_event (dlbuf->srcpad, gst_event_new_eos ()); gst_pad_push_event (dlbuf->srcpad, gst_event_new_eos ());
} else if ((ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS)) { } else if ((ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS)) {
GST_ELEMENT_ERROR (dlbuf, STREAM, FAILED, GST_ELEMENT_FLOW_ERROR (dlbuf, ret);
(_("Internal data flow error.")),
("streaming task paused, reason %s (%d)",
gst_flow_get_name (ret), ret));
gst_pad_push_event (dlbuf->srcpad, gst_event_new_eos ()); gst_pad_push_event (dlbuf->srcpad, gst_event_new_eos ());
} }
return; return;

View file

@ -1921,9 +1921,7 @@ out_flushing:
* error upstream */ * error upstream */
if (sq->is_eos && sq->srcresult < GST_FLOW_EOS) { if (sq->is_eos && sq->srcresult < GST_FLOW_EOS) {
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq); GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
GST_ELEMENT_ERROR (mq, STREAM, FAILED, GST_ELEMENT_FLOW_ERROR (mq, sq->srcresult);
("Internal data stream error."),
("streaming stopped, reason %s", gst_flow_get_name (sq->srcresult)));
} else { } else {
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq); GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
} }
@ -2204,10 +2202,7 @@ gst_multi_queue_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
* error upstream */ * error upstream */
if (sq->srcresult < GST_FLOW_EOS) { if (sq->srcresult < GST_FLOW_EOS) {
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq); GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
GST_ELEMENT_ERROR (mq, STREAM, FAILED, GST_ELEMENT_FLOW_ERROR (mq, sq->srcresult);
("Internal data stream error."),
("streaming stopped, reason %s",
gst_flow_get_name (sq->srcresult)));
} else { } else {
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq); GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
} }

View file

@ -986,10 +986,7 @@ gst_queue_handle_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
if (queue->srcresult == GST_FLOW_NOT_LINKED if (queue->srcresult == GST_FLOW_NOT_LINKED
|| queue->srcresult < GST_FLOW_EOS) { || queue->srcresult < GST_FLOW_EOS) {
GST_QUEUE_MUTEX_UNLOCK (queue); GST_QUEUE_MUTEX_UNLOCK (queue);
GST_ELEMENT_ERROR (queue, STREAM, FAILED, GST_ELEMENT_FLOW_ERROR (queue, queue->srcresult);
(_("Internal data flow error.")),
("streaming task paused, reason %s (%d)",
gst_flow_get_name (queue->srcresult), queue->srcresult));
} else { } else {
GST_QUEUE_MUTEX_UNLOCK (queue); GST_QUEUE_MUTEX_UNLOCK (queue);
} }
@ -1535,10 +1532,7 @@ out_flushing:
/* let app know about us giving up if upstream is not expected to do so */ /* let app know about us giving up if upstream is not expected to do so */
/* EOS is already taken care of elsewhere */ /* EOS is already taken care of elsewhere */
if (eos && (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS)) { if (eos && (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS)) {
GST_ELEMENT_ERROR (queue, STREAM, FAILED, GST_ELEMENT_FLOW_ERROR (queue, ret);
(_("Internal data flow error.")),
("streaming task paused, reason %s (%d)",
gst_flow_get_name (ret), ret));
gst_pad_push_event (queue->srcpad, gst_event_new_eos ()); gst_pad_push_event (queue->srcpad, gst_event_new_eos ());
} }
return; return;

View file

@ -2567,10 +2567,7 @@ gst_queue2_handle_sink_event (GstPad * pad, GstObject * parent,
} else if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) { } else if (GST_EVENT_TYPE (event) == GST_EVENT_EOS) {
if (queue->srcresult == GST_FLOW_NOT_LINKED if (queue->srcresult == GST_FLOW_NOT_LINKED
|| queue->srcresult < GST_FLOW_EOS) { || queue->srcresult < GST_FLOW_EOS) {
GST_ELEMENT_ERROR (queue, STREAM, FAILED, GST_ELEMENT_FLOW_ERROR (queue, queue->srcresult);
(_("Internal data flow error.")),
("streaming task paused, reason %s (%d)",
gst_flow_get_name (queue->srcresult), queue->srcresult));
} }
goto out_flow_error; goto out_flow_error;
} }
@ -3059,10 +3056,7 @@ out_flushing:
/* let app know about us giving up if upstream is not expected to do so */ /* let app know about us giving up if upstream is not expected to do so */
/* EOS is already taken care of elsewhere */ /* EOS is already taken care of elsewhere */
if (eos && (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS)) { if (eos && (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS)) {
GST_ELEMENT_ERROR (queue, STREAM, FAILED, GST_ELEMENT_FLOW_ERROR (queue, ret);
(_("Internal data flow error.")),
("streaming task paused, reason %s (%d)",
gst_flow_get_name (ret), ret));
gst_pad_push_event (queue->srcpad, gst_event_new_eos ()); gst_pad_push_event (queue->srcpad, gst_event_new_eos ());
} }
return; return;

View file

@ -1216,8 +1216,7 @@ pause:
} }
} else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS) { } else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS) {
/* for fatal errors we post an error message */ /* for fatal errors we post an error message */
GST_ELEMENT_ERROR (typefind, STREAM, FAILED, (NULL), GST_ELEMENT_FLOW_ERROR (typefind, ret);
("stream stopped, reason %s", reason));
push_eos = TRUE; push_eos = TRUE;
} }
if (push_eos) { if (push_eos) {