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

https://bugzilla.gnome.org/show_bug.cgi?id=770158
This commit is contained in:
Thibault Saunier 2016-08-19 11:12:10 -07:00 committed by Thibault Saunier
parent 268c18054d
commit 2fb716409c
17 changed files with 24 additions and 54 deletions

View file

@ -353,9 +353,7 @@ gst_gme_play (GstPad * pad)
if (flow_return == GST_FLOW_EOS) {
gst_pad_push_event (pad, gst_event_new_eos ());
} else if (flow_return < GST_FLOW_EOS || flow_return == GST_FLOW_NOT_LINKED) {
GST_ELEMENT_ERROR (gme, STREAM, FAILED, ("Internal data stream error."),
("stream stopped, reason %s", gst_flow_get_name (flow_return)));
GST_ELEMENT_FLOW_ERROR (gme, flow_return);
gst_pad_push_event (pad, gst_event_new_eos ());
}
}

View file

@ -433,9 +433,7 @@ paused:
if (result == GST_FLOW_UNEXPECTED) {
gst_pad_send_event (pad, gst_event_new_eos ());
} else if (result < GST_FLOW_UNEXPECTED || result == GST_FLOW_NOT_LINKED) {
GST_ELEMENT_ERROR (basesink, STREAM, FAILED,
(_("Internal data stream error.")),
("stream stopped, reason %s", gst_flow_get_name (result)));
GST_ELEMENT_FLOW_ERROR (basesink, result);
gst_pad_send_event (pad, gst_event_new_eos ());
}
gst_object_unref (this);

View file

@ -743,9 +743,7 @@ error:
{
if (ret != GST_FLOW_OK && ret != GST_FLOW_NOT_LINKED
&& ret != GST_FLOW_FLUSHING) {
GST_ELEMENT_ERROR (teletext, STREAM, FAILED,
("Internal data stream error."), ("stream stopped, reason %s",
gst_flow_get_name (ret)));
GST_ELEMENT_FLOW_ERROR (teletext, ret);
return GST_FLOW_ERROR;
}
return ret;

View file

@ -743,9 +743,7 @@ eos:
}
error:
{
GST_ELEMENT_ERROR (timidity, STREAM, FAILED,
("Internal data stream error"),
("Streaming stopped, reason %s", gst_flow_get_name (ret)));
GST_ELEMENT_FLOW_ERROR (timidity, ret);
gst_pad_push_event (timidity->srcpad, gst_event_new_eos ());
goto paused;
}

View file

@ -898,9 +898,7 @@ pause:
event = gst_event_new_eos ();
/* for fatal errors we post an error message, post the error
* first so the app knows about the error first. */
GST_ELEMENT_ERROR (wildmidi, STREAM, FAILED,
("Internal data flow error."),
("streaming task paused, reason %s (%d)", reason, ret));
GST_ELEMENT_FLOW_ERROR (wildmidi, ret);
gst_pad_push_event (wildmidi->srcpad, event);
}
}

View file

@ -2230,8 +2230,7 @@ _src_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
gboolean finished = FALSE;
if (ret < GST_FLOW_EOS) {
GST_ELEMENT_ERROR (demux, STREAM, FAILED, (NULL),
("stream stopped, reason %s", gst_flow_get_name (ret)));
GST_ELEMENT_FLOW_ERROR (demux, ret);
/* TODO push this on all pads */
gst_pad_push_event (stream->pad, gst_event_new_eos ());
@ -3285,13 +3284,15 @@ gst_adaptive_demux_stream_download_loop (GstAdaptiveDemuxStream * stream)
break;
case GST_FLOW_NOT_LINKED:
{
GstFlowReturn ret;
gst_task_stop (stream->download_task);
if (gst_adaptive_demux_combine_flows (demux)
== GST_FLOW_NOT_LINKED) {
GST_ELEMENT_ERROR (demux, STREAM, FAILED,
(_("Internal data stream error.")), ("stream stopped, reason %s",
gst_flow_get_name (GST_FLOW_NOT_LINKED)));
ret = gst_adaptive_demux_combine_flows (demux);
if (ret == GST_FLOW_NOT_LINKED) {
GST_ELEMENT_FLOW_ERROR (demux, ret);
}
}
break;
case GST_FLOW_FLUSHING:{

View file

@ -1527,9 +1527,7 @@ pause:
} else if (ret < GST_FLOW_EOS || ret == GST_FLOW_NOT_LINKED) {
/* for fatal errors we post an error message, post the error
* first so the app knows about the error first. */
GST_ELEMENT_ERROR (aiff, STREAM, FAILED,
(_("Internal data flow error.")),
("streaming task paused, reason %s (%d)", reason, ret));
GST_ELEMENT_FLOW_ERROR (aiff, ret);
gst_pad_push_event (aiff->srcpad, gst_event_new_eos ());
}
return;

View file

@ -1282,9 +1282,7 @@ pause:
event = gst_event_new_eos ();
/* for fatal errors we post an error message, post the error
* first so the app knows about the error first. */
GST_ELEMENT_ERROR (midiparse, STREAM, FAILED,
("Internal data flow error."),
("streaming task paused, reason %s (%d)", reason, ret));
GST_ELEMENT_FLOW_ERROR (midiparse, ret);
gst_pad_push_event (midiparse->srcpad, event);
}
}

View file

@ -3005,9 +3005,7 @@ pause:
}
}
} else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS) {
GST_ELEMENT_ERROR (demux, STREAM, FAILED,
("Internal data stream error."),
("stream stopped, reason %s", reason));
GST_ELEMENT_FLOW_ERROR (demux, ret);
gst_ps_demux_send_event (demux, gst_event_new_eos ());
}

View file

@ -1382,9 +1382,7 @@ error:
(_("Internal data stream error.")),
("No program activated before EOS"));
} else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS) {
GST_ELEMENT_ERROR (base, STREAM, FAILED,
(_("Internal data stream error.")),
("stream stopped, reason %s", reason));
GST_ELEMENT_FLOW_ERROR (base, ret);
GST_MPEGTS_BASE_GET_CLASS (base)->push_event (base, gst_event_new_eos ());
}
gst_pad_pause_task (base->sinkpad);

View file

@ -3098,9 +3098,7 @@ pause:
} else if (flow == GST_FLOW_NOT_LINKED || flow < GST_FLOW_EOS) {
GstEvent *e;
GST_ELEMENT_ERROR (demux, STREAM, FAILED,
("Internal data stream error."),
("stream stopped, reason %s", reason));
GST_ELEMENT_FLOW_ERROR (demux, flow);
e = gst_event_new_eos ();
gst_event_set_seqnum (e, demux->seqnum);
gst_mxf_demux_push_src_event (demux, e);

View file

@ -729,9 +729,7 @@ pause:
if (res == GST_FLOW_UNEXPECTED) {
gst_nuv_demux_send_eos (nuv);
} else if (res == GST_FLOW_NOT_LINKED || res < GST_FLOW_UNEXPECTED) {
GST_ELEMENT_ERROR (nuv, STREAM, FAILED,
(_("Internal data stream error.")),
("streaming stopped, reason %s", gst_flow_get_name (res)));
GST_ELEMENT_FLOW_ERROR (nuv, res);
gst_nuv_demux_send_eos (nuv);
}

View file

@ -468,9 +468,7 @@ pause:
if (ret == GST_FLOW_UNEXPECTED) {
gst_pad_push_event (ttaparse->srcpad, gst_event_new_eos ());
} else if (ret < GST_FLOW_UNEXPECTED || ret == GST_FLOW_NOT_LINKED) {
GST_ELEMENT_ERROR (ttaparse, STREAM, FAILED,
("Internal data stream error."),
("streaming stopped, reason %s", gst_flow_get_name (ret)));
GST_ELEMENT_FLOW_ERROR (ttaparse, ret);
gst_pad_push_event (ttaparse->srcpad, gst_event_new_eos ());
}
}

View file

@ -670,9 +670,7 @@ flow_error:
gst_event_new_eos ());
gst_pad_pause_task (GST_AUDIO_DECODER_SRC_PAD (self));
} else if (flow_ret < GST_FLOW_EOS) {
GST_ELEMENT_ERROR (self, STREAM, FAILED,
("Internal data stream error."), ("stream stopped, reason %s",
gst_flow_get_name (flow_ret)));
GST_ELEMENT_FLOW_ERROR (self, flow_ret);
gst_pad_push_event (GST_AUDIO_DECODER_SRC_PAD (self),
gst_event_new_eos ());
gst_pad_pause_task (GST_AUDIO_DECODER_SRC_PAD (self));

View file

@ -1590,9 +1590,7 @@ flow_error:
gst_event_new_eos ());
gst_pad_pause_task (GST_VIDEO_DECODER_SRC_PAD (self));
} else if (flow_ret < GST_FLOW_EOS) {
GST_ELEMENT_ERROR (self, STREAM, FAILED,
("Internal data stream error."), ("stream stopped, reason %s",
gst_flow_get_name (flow_ret)));
GST_ELEMENT_FLOW_ERROR (self, flow_ret);
gst_pad_push_event (GST_VIDEO_DECODER_SRC_PAD (self),
gst_event_new_eos ());
gst_pad_pause_task (GST_VIDEO_DECODER_SRC_PAD (self));

View file

@ -1129,9 +1129,7 @@ flow_error:
gst_event_new_eos ());
gst_pad_pause_task (GST_VIDEO_ENCODER_SRC_PAD (self));
} else if (flow_ret == GST_FLOW_NOT_LINKED || flow_ret < GST_FLOW_EOS) {
GST_ELEMENT_ERROR (self, STREAM, FAILED,
("Internal data stream error."), ("stream stopped, reason %s",
gst_flow_get_name (flow_ret)));
GST_ELEMENT_FLOW_ERROR (self, flow_ret);
gst_pad_push_event (GST_VIDEO_ENCODER_SRC_PAD (self),
gst_event_new_eos ());
gst_pad_pause_task (GST_VIDEO_ENCODER_SRC_PAD (self));

View file

@ -535,8 +535,7 @@ gst_avf_asset_src_read_data (GstAVFAssetSrc *self, GstPad *pad,
}
if (combined_ret != GST_FLOW_OK) {
GST_ELEMENT_ERROR (self, STREAM, FAILED, ("Internal data stream error."),
("stream stopped reason %s", gst_flow_get_name (ret)));
GST_ELEMENT_FLOW_ERROR (self, ret);
}
gst_pad_pause_task (pad);