Commit 150edef8 authored by Thibault Saunier's avatar Thibault Saunier Committed by Thibault Saunier

Use the new API to post flow ERROR messages on the bus

https://bugzilla.gnome.org/show_bug.cgi?id=770158
parent d40f007d
...@@ -1892,8 +1892,7 @@ pause: ...@@ -1892,8 +1892,7 @@ pause:
} else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS) { } else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS) {
GstEvent *event = gst_event_new_eos (); GstEvent *event = gst_event_new_eos ();
/* for fatal errors or not-linked we post an error message */ /* for fatal errors or not-linked we post an error message */
GST_ELEMENT_ERROR (dvdemux, STREAM, FAILED, GST_ELEMENT_FLOW_ERROR (dvdemux, ret);
(NULL), ("streaming stopped, reason %s", gst_flow_get_name (ret)));
if (dvdemux->segment_seqnum) if (dvdemux->segment_seqnum)
gst_event_set_seqnum (event, dvdemux->segment_seqnum); gst_event_set_seqnum (event, dvdemux->segment_seqnum);
gst_dvdemux_push_event (dvdemux, event); gst_dvdemux_push_event (dvdemux, event);
......
...@@ -417,8 +417,7 @@ gst_gdk_pixbuf_dec_sink_event (GstPad * pad, GstObject * parent, ...@@ -417,8 +417,7 @@ gst_gdk_pixbuf_dec_sink_event (GstPad * pad, GstObject * parent,
* things failed */ * things failed */
if (res != GST_FLOW_OK && res != GST_FLOW_FLUSHING if (res != GST_FLOW_OK && res != GST_FLOW_FLUSHING
&& res != GST_FLOW_EOS && res != GST_FLOW_NOT_LINKED) { && res != GST_FLOW_EOS && res != GST_FLOW_NOT_LINKED) {
GST_ELEMENT_ERROR (pixbuf, STREAM, FAILED, (NULL), ("Flow: %s", GST_ELEMENT_FLOW_ERROR (pixbuf, res);
gst_flow_get_name (res)));
forward = FALSE; forward = FALSE;
ret = FALSE; ret = FALSE;
} }
......
...@@ -5695,9 +5695,7 @@ pause:{ ...@@ -5695,9 +5695,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 (avi, STREAM, FAILED, GST_ELEMENT_FLOW_ERROR (avi, res);
(_("Internal data stream error.")),
("streaming stopped, reason %s", gst_flow_get_name (res)));
push_eos = TRUE; push_eos = TRUE;
} }
if (push_eos) { if (push_eos) {
......
...@@ -515,9 +515,7 @@ push_failed: ...@@ -515,9 +515,7 @@ push_failed:
GST_DEBUG_OBJECT (self, "eos"); GST_DEBUG_OBJECT (self, "eos");
gst_pad_push_event (self->srcpad, gst_event_new_eos ()); gst_pad_push_event (self->srcpad, gst_event_new_eos ());
} else if (ret < GST_FLOW_EOS || ret == GST_FLOW_NOT_LINKED) { } else if (ret < GST_FLOW_EOS || ret == GST_FLOW_NOT_LINKED) {
GST_ELEMENT_ERROR (self, STREAM, FAILED, GST_ELEMENT_FLOW_ERROR (self, ret);
("Internal data stream error."),
("streaming stopped, reason: %s", gst_flow_get_name (ret)));
} }
goto pause_task; goto pause_task;
} }
......
...@@ -2729,9 +2729,7 @@ pause: ...@@ -2729,9 +2729,7 @@ pause:
GST_WARNING_OBJECT (demux, "failed pushing EOS on streams"); GST_WARNING_OBJECT (demux, "failed pushing EOS on streams");
} }
} 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 (demux, STREAM, FAILED, GST_ELEMENT_FLOW_ERROR (demux, ret);
("Internal data stream error."),
("stream stopped, reason %s", reason));
gst_flv_demux_push_src_event (demux, gst_event_new_eos ()); gst_flv_demux_push_src_event (demux, gst_event_new_eos ());
} }
gst_object_unref (demux); gst_object_unref (demux);
......
...@@ -846,9 +846,7 @@ pause_task: ...@@ -846,9 +846,7 @@ pause_task:
} else if (flow_ret == GST_FLOW_NOT_LINKED || flow_ret < GST_FLOW_EOS) { } else if (flow_ret == GST_FLOW_NOT_LINKED || flow_ret < GST_FLOW_EOS) {
GstEvent *e = gst_event_new_eos (); GstEvent *e = gst_event_new_eos ();
GST_ELEMENT_ERROR (self, STREAM, FAILED, GST_ELEMENT_FLOW_ERROR (self, flow_ret);
("Internal data stream error."),
("stream stopped, reason %s", reason));
if (self->seqnum) if (self->seqnum)
gst_event_set_seqnum (e, self->seqnum); gst_event_set_seqnum (e, self->seqnum);
......
...@@ -5766,8 +5766,7 @@ pause: ...@@ -5766,8 +5766,7 @@ pause:
gst_qtdemux_push_event (qtdemux, event); gst_qtdemux_push_event (qtdemux, event);
} }
} 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 (qtdemux, STREAM, FAILED, GST_ELEMENT_FLOW_ERROR (qtdemux, ret);
(NULL), ("streaming stopped, reason %s", reason));
gst_qtdemux_push_event (qtdemux, gst_event_new_eos ()); gst_qtdemux_push_event (qtdemux, gst_event_new_eos ());
} }
goto done; goto done;
......
...@@ -4756,8 +4756,7 @@ pause: ...@@ -4756,8 +4756,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 (demux, STREAM, FAILED, (NULL), GST_ELEMENT_FLOW_ERROR (demux, ret);
("stream stopped, reason %s", reason));
push_eos = TRUE; push_eos = TRUE;
} }
if (push_eos) { if (push_eos) {
......
...@@ -2920,8 +2920,7 @@ pause: ...@@ -2920,8 +2920,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 (parse, STREAM, FAILED, (NULL), GST_ELEMENT_FLOW_ERROR (parse, ret);
("stream stopped, reason %s", reason));
push_eos = TRUE; push_eos = TRUE;
} }
if (push_eos) { if (push_eos) {
......
...@@ -549,10 +549,7 @@ gst_splitmux_pad_loop (GstPad * pad) ...@@ -549,10 +549,7 @@ gst_splitmux_pad_loop (GstPad * pad)
GST_INFO_OBJECT (splitpad, "Stopping due to pad_push() result %d", ret); GST_INFO_OBJECT (splitpad, "Stopping due to pad_push() result %d", ret);
gst_pad_pause_task (pad); gst_pad_pause_task (pad);
if (ret < GST_FLOW_EOS) { if (ret < GST_FLOW_EOS) {
const gchar *reason = gst_flow_get_name (ret); GST_ELEMENT_FLOW_ERROR (splitmux, ret);
GST_ELEMENT_ERROR (splitmux, STREAM, FAILED,
(_("Internal data flow error.")),
("streaming task paused, reason %s (%d)", reason, ret));
} }
} }
} }
......
...@@ -5119,9 +5119,7 @@ pause: ...@@ -5119,9 +5119,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, post the error before the /* for fatal errors we post an error message, post the error before the
* EOS so the app knows about the error first. */ * EOS so the app knows about the error first. */
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_rtspsrc_push_event (src, gst_event_new_eos ()); gst_rtspsrc_push_event (src, gst_event_new_eos ());
} }
gst_rtspsrc_loop_send_cmd (src, CMD_WAIT, CMD_LOOP); gst_rtspsrc_loop_send_cmd (src, CMD_WAIT, CMD_LOOP);
......
...@@ -2246,9 +2246,7 @@ pause: ...@@ -2246,9 +2246,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, post the error /* for fatal errors we post an error message, post the error
* first so the app knows about the error first. */ * first so the app knows about the error first. */
GST_ELEMENT_ERROR (wav, STREAM, FAILED, GST_ELEMENT_FLOW_ERROR (wav, ret);
(_("Internal data flow error.")),
("streaming task paused, reason %s (%d)", reason, ret));
gst_pad_push_event (wav->srcpad, gst_event_new_eos ()); gst_pad_push_event (wav->srcpad, gst_event_new_eos ());
} }
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment