From f1088ed6478b6d3d8c005569af7f8cf8de2f811e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 10 Oct 2011 11:39:52 +0200 Subject: [PATCH] update for UNEXPECTED -> EOS flowreturn --- ext/gio/gstgiobasesrc.c | 2 +- ext/ogg/gstoggdemux.c | 30 +++++++++++++-------------- ext/ogg/gstoggmux.c | 2 +- ext/pango/gstbasetextoverlay.c | 4 ++-- gst-libs/gst/app/gstappsrc.c | 6 +++--- gst-libs/gst/audio/gstaudiodecoder.c | 4 ++-- gst-libs/gst/audio/gstbaseaudiosink.c | 2 +- gst-libs/gst/cdda/gstcddabasesrc.c | 2 +- gst-libs/gst/riff/riff-read.c | 4 ++-- gst-libs/gst/tag/gsttagdemux.c | 8 +++---- gst/adder/gstadder.c | 2 +- gst/audiotestsrc/gstaudiotestsrc.c | 2 +- gst/subparse/gstsubparse.c | 4 ++-- gst/tcp/gsttcp.c | 4 ++-- gst/videotestsrc/gstvideotestsrc.c | 2 +- 15 files changed, 39 insertions(+), 39 deletions(-) diff --git a/ext/gio/gstgiobasesrc.c b/ext/gio/gstgiobasesrc.c index 7987d99755..d08a5f1032 100644 --- a/ext/gio/gstgiobasesrc.c +++ b/ext/gio/gstgiobasesrc.c @@ -399,7 +399,7 @@ gst_gio_base_src_create (GstBaseSrc * base_src, guint64 offset, guint size, } if (eos) - ret = GST_FLOW_UNEXPECTED; + ret = GST_FLOW_EOS; } *buf_return = buf; diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index f535e60425..a95397c587 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -1073,7 +1073,7 @@ gst_ogg_pad_stream_out (GstOggPad * pad, gint npackets) * collecting headers and that we don't have exposed the pads yet */ if (result == GST_FLOW_NOT_LINKED) break; - else if (result <= GST_FLOW_UNEXPECTED) + else if (result <= GST_FLOW_EOS) goto could_not_submit; break; default: @@ -2077,7 +2077,7 @@ boundary_reached: eos: { GST_LOG_OBJECT (ogg, "reached EOS"); - return GST_FLOW_UNEXPECTED; + return GST_FLOW_EOS; } error: { @@ -2094,7 +2094,7 @@ error: * @offset will contain the offset the next page starts at when this function * returns GST_FLOW_OK. * - * GST_FLOW_UNEXPECTED is returned on EOS. + * GST_FLOW_EOS is returned on EOS. * * GST_FLOW_LIMIT is returned when we did not find a page before the * boundary. If @boundary is -1, this is never returned. @@ -2208,7 +2208,7 @@ gst_ogg_demux_get_prev_page (GstOggDemux * ogg, ogg_page * og, gint64 * offset) break; } /* something went wrong */ - if (ret == GST_FLOW_UNEXPECTED) { + if (ret == GST_FLOW_EOS) { new_offset = 0; GST_LOG_OBJECT (ogg, "got unexpected"); } else if (ret != GST_FLOW_OK) { @@ -3336,7 +3336,7 @@ gst_ogg_demux_bisect_forward_serialno (GstOggDemux * ogg, gst_ogg_demux_seek (ogg, bisect); ret = gst_ogg_demux_get_next_page (ogg, &og, -1, &offset); - if (ret == GST_FLOW_UNEXPECTED) { + if (ret == GST_FLOW_EOS) { endsearched = bisect; } else if (ret == GST_FLOW_OK) { guint32 serial = ogg_page_serialno (&og); @@ -3362,7 +3362,7 @@ gst_ogg_demux_bisect_forward_serialno (GstOggDemux * ogg, gst_ogg_demux_seek (ogg, next); ret = gst_ogg_demux_read_chain (ogg, &nextchain); - if (ret == GST_FLOW_UNEXPECTED) { + if (ret == GST_FLOW_EOS) { nextchain = NULL; ret = GST_FLOW_OK; GST_LOG_OBJECT (ogg, "no next chain"); @@ -3412,7 +3412,7 @@ gst_ogg_demux_read_chain (GstOggDemux * ogg, GstOggChain ** res_chain) ret = gst_ogg_demux_get_next_page (ogg, &og, -1, NULL); if (ret != GST_FLOW_OK) { - if (ret == GST_FLOW_UNEXPECTED) { + if (ret == GST_FLOW_EOS) { GST_DEBUG_OBJECT (ogg, "Reached EOS, done reading end chain"); } else { GST_WARNING_OBJECT (ogg, "problem reading BOS page: ret=%d", ret); @@ -3425,7 +3425,7 @@ gst_ogg_demux_read_chain (GstOggDemux * ogg, GstOggChain ** res_chain) * ignore it */ if (!chain) { GST_WARNING_OBJECT (ogg, "No chain found, no Ogg data in stream ?"); - ret = GST_FLOW_UNEXPECTED; + ret = GST_FLOW_EOS; } break; } @@ -3450,7 +3450,7 @@ gst_ogg_demux_read_chain (GstOggDemux * ogg, GstOggChain ** res_chain) if (ret == GST_FLOW_OK) { GST_WARNING_OBJECT (ogg, "no chain was found"); ret = GST_FLOW_ERROR; - } else if (ret != GST_FLOW_UNEXPECTED) { + } else if (ret != GST_FLOW_EOS) { GST_WARNING_OBJECT (ogg, "failed to read chain"); } else { GST_DEBUG_OBJECT (ogg, "done reading chains"); @@ -4054,7 +4054,7 @@ gst_ogg_demux_loop_forward (GstOggDemux * ogg) if (ogg->offset == ogg->length) { GST_LOG_OBJECT (ogg, "no more data to pull %" G_GINT64_FORMAT " == %" G_GINT64_FORMAT, ogg->offset, ogg->length); - ret = GST_FLOW_UNEXPECTED; + ret = GST_FLOW_EOS; goto done; } @@ -4081,7 +4081,7 @@ gst_ogg_demux_loop_forward (GstOggDemux * ogg) /* check for the end of the segment */ if (gst_ogg_demux_check_eos (ogg)) { GST_LOG_OBJECT (ogg, "got EOS"); - ret = GST_FLOW_UNEXPECTED; + ret = GST_FLOW_EOS; goto done; } done: @@ -4106,7 +4106,7 @@ gst_ogg_demux_loop_reverse (GstOggDemux * ogg) if (ogg->offset == 0) { GST_LOG_OBJECT (ogg, "no more data to pull %" G_GINT64_FORMAT " == 0", ogg->offset); - ret = GST_FLOW_UNEXPECTED; + ret = GST_FLOW_EOS; goto done; } @@ -4129,7 +4129,7 @@ gst_ogg_demux_loop_reverse (GstOggDemux * ogg) /* check for the end of the segment */ if (gst_ogg_demux_check_eos (ogg)) { GST_LOG_OBJECT (ogg, "got EOS"); - ret = GST_FLOW_UNEXPECTED; + ret = GST_FLOW_EOS; goto done; } done: @@ -4251,7 +4251,7 @@ pause: GST_LOG_OBJECT (ogg, "pausing task, reason %s", reason); gst_pad_pause_task (ogg->sinkpad); - if (ret == GST_FLOW_UNEXPECTED) { + if (ret == GST_FLOW_EOS) { /* perform EOS logic */ if (ogg->segment.flags & GST_SEEK_FLAG_SEGMENT) { gint64 stop; @@ -4274,7 +4274,7 @@ pause: GST_LOG_OBJECT (ogg, "Sending EOS, at end of stream"); event = gst_event_new_eos (); } - } else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_UNEXPECTED) { + } else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS) { GST_ELEMENT_ERROR (ogg, STREAM, FAILED, (_("Internal data stream error.")), ("stream stopped, reason %s", reason)); diff --git a/ext/ogg/gstoggmux.c b/ext/ogg/gstoggmux.c index a0ac3cbf31..0a1d3e0eeb 100644 --- a/ext/ogg/gstoggmux.c +++ b/ext/ogg/gstoggmux.c @@ -1885,7 +1885,7 @@ gst_ogg_mux_collected (GstCollectPads * pads, GstOggMux * ogg_mux) if (best->eos && all_pads_eos (pads)) { gst_pad_push_event (ogg_mux->srcpad, gst_event_new_eos ()); - return GST_FLOW_UNEXPECTED; + return GST_FLOW_EOS; } return ret; diff --git a/ext/pango/gstbasetextoverlay.c b/ext/pango/gstbasetextoverlay.c index 936da8d0ab..caffd25393 100644 --- a/ext/pango/gstbasetextoverlay.c +++ b/ext/pango/gstbasetextoverlay.c @@ -2351,7 +2351,7 @@ gst_base_text_overlay_text_chain (GstPad * pad, GstBuffer * buffer) if (overlay->text_eos) { GST_OBJECT_UNLOCK (overlay); - ret = GST_FLOW_UNEXPECTED; + ret = GST_FLOW_EOS; GST_LOG_OBJECT (overlay, "text EOS"); goto beach; } @@ -2718,7 +2718,7 @@ have_eos: GST_OBJECT_UNLOCK (overlay); GST_DEBUG_OBJECT (overlay, "eos, discarding buffer"); gst_buffer_unref (buffer); - return GST_FLOW_UNEXPECTED; + return GST_FLOW_EOS; } out_of_segment: { diff --git a/gst-libs/gst/app/gstappsrc.c b/gst-libs/gst/app/gstappsrc.c index 1a6a0cd4ff..3a829b7b96 100644 --- a/gst-libs/gst/app/gstappsrc.c +++ b/gst-libs/gst/app/gstappsrc.c @@ -1020,7 +1020,7 @@ eos: g_mutex_unlock (priv->mutex); if (caps) gst_caps_unref (caps); - return GST_FLOW_UNEXPECTED; + return GST_FLOW_EOS; } seek_error: { @@ -1474,7 +1474,7 @@ eos: if (steal_ref) gst_buffer_unref (buffer); g_mutex_unlock (priv->mutex); - return GST_FLOW_UNEXPECTED; + return GST_FLOW_EOS; } } @@ -1491,7 +1491,7 @@ eos: * * Returns: #GST_FLOW_OK when the buffer was successfuly queued. * #GST_FLOW_WRONG_STATE when @appsrc is not PAUSED or PLAYING. - * #GST_FLOW_UNEXPECTED when EOS occured. + * #GST_FLOW_EOS when EOS occured. * * Since: 0.10.22 */ diff --git a/gst-libs/gst/audio/gstaudiodecoder.c b/gst-libs/gst/audio/gstaudiodecoder.c index df86dc8cd2..72c55c82a0 100644 --- a/gst-libs/gst/audio/gstaudiodecoder.c +++ b/gst-libs/gst/audio/gstaudiodecoder.c @@ -580,7 +580,7 @@ gst_audio_decoder_setup (GstAudioDecoder * dec) gst_query_unref (query); /* normalize to bool */ - dec->priv->agg = !!res; + dec->priv->agg = ! !res; } /* mini aggregator combining output buffers into fewer larger ones, @@ -971,7 +971,7 @@ gst_audio_decoder_push_buffers (GstAudioDecoder * dec, gboolean force) goto parse_failed; } - if (ret == GST_FLOW_UNEXPECTED) { + if (ret == GST_FLOW_EOS) { GST_LOG_OBJECT (dec, "no frame yet"); ret = GST_FLOW_OK; break; diff --git a/gst-libs/gst/audio/gstbaseaudiosink.c b/gst-libs/gst/audio/gstbaseaudiosink.c index 45b66a602b..deeb8a02cd 100644 --- a/gst-libs/gst/audio/gstbaseaudiosink.c +++ b/gst-libs/gst/audio/gstbaseaudiosink.c @@ -1804,7 +1804,7 @@ gst_base_audio_sink_callback (GstRingBuffer * rbuf, guint8 * data, guint len, &buf); if (ret != GST_FLOW_OK) { - if (ret == GST_FLOW_UNEXPECTED) + if (ret == GST_FLOW_EOS) goto eos; else goto error; diff --git a/gst-libs/gst/cdda/gstcddabasesrc.c b/gst-libs/gst/cdda/gstcddabasesrc.c index e308bbed59..6e09fbd37e 100644 --- a/gst-libs/gst/cdda/gstcddabasesrc.c +++ b/gst-libs/gst/cdda/gstcddabasesrc.c @@ -1579,7 +1579,7 @@ gst_cdda_base_src_create (GstPushSrc * pushsrc, GstBuffer ** buffer) GST_DEBUG_OBJECT (src, "EOS at sector %d, cur_track=%d, mode=%d", src->cur_sector, src->cur_track, src->mode); /* base class will send EOS for us */ - return GST_FLOW_UNEXPECTED; + return GST_FLOW_EOS; } if (src->prev_track != src->cur_track) { diff --git a/gst-libs/gst/riff/riff-read.c b/gst-libs/gst/riff/riff-read.c index ab37e39b06..4ed77a741a 100644 --- a/gst-libs/gst/riff/riff-read.c +++ b/gst-libs/gst/riff/riff-read.c @@ -101,11 +101,11 @@ skip_junk: /* ERRORS */ too_small: { - /* short read, we return UNEXPECTED to mark the EOS case */ + /* short read, we return EOS to mark the EOS case */ GST_DEBUG_OBJECT (element, "not enough data (available=%" G_GSIZE_FORMAT ", needed=%u)", gst_buffer_get_size (buf), size); gst_buffer_unref (buf); - return GST_FLOW_UNEXPECTED; + return GST_FLOW_EOS; } } diff --git a/gst-libs/gst/tag/gsttagdemux.c b/gst-libs/gst/tag/gsttagdemux.c index ab4bbc439d..53ecccd824 100644 --- a/gst-libs/gst/tag/gsttagdemux.c +++ b/gst-libs/gst/tag/gsttagdemux.c @@ -626,7 +626,7 @@ gst_tag_demux_chain (GstPad * pad, GstBuffer * buf) typefind_buf = demux->priv->collect; gst_buffer_ref (typefind_buf); if (!gst_tag_demux_trim_buffer (demux, &typefind_buf, &typefind_size)) - return GST_FLOW_UNEXPECTED; + return GST_FLOW_EOS; if (typefind_buf == NULL) break; /* Still need more data */ @@ -677,7 +677,7 @@ gst_tag_demux_chain (GstPad * pad, GstBuffer * buf) demux->priv->collect = NULL; demux->priv->collect_size = 0; if (!gst_tag_demux_trim_buffer (demux, &outbuf, &outbuf_size)) - return GST_FLOW_UNEXPECTED; + return GST_FLOW_EOS; } if (outbuf) { if (G_UNLIKELY (demux->priv->srcpad == NULL)) { @@ -1305,7 +1305,7 @@ gst_tag_demux_read_range (GstTagDemux * demux, if (in_offset + length >= demux->priv->upstream_size - demux->priv->strip_end) { if (in_offset + demux->priv->strip_end >= demux->priv->upstream_size) - return GST_FLOW_UNEXPECTED; + return GST_FLOW_EOS; in_length = demux->priv->upstream_size - demux->priv->strip_end - in_offset; } else { in_length = length; @@ -1330,7 +1330,7 @@ read_beyond_end: gst_buffer_unref (*buffer); *buffer = NULL; } - return GST_FLOW_UNEXPECTED; + return GST_FLOW_EOS; } } diff --git a/gst/adder/gstadder.c b/gst/adder/gstadder.c index d5f9907745..b51d9e3cf0 100644 --- a/gst/adder/gstadder.c +++ b/gst/adder/gstadder.c @@ -1244,7 +1244,7 @@ eos: { GST_DEBUG_OBJECT (adder, "no data available, must be EOS"); gst_pad_push_event (adder->srcpad, gst_event_new_eos ()); - return GST_FLOW_UNEXPECTED; + return GST_FLOW_EOS; } } diff --git a/gst/audiotestsrc/gstaudiotestsrc.c b/gst/audiotestsrc/gstaudiotestsrc.c index 5e41c0994b..9a3a077018 100644 --- a/gst/audiotestsrc/gstaudiotestsrc.c +++ b/gst/audiotestsrc/gstaudiotestsrc.c @@ -1119,7 +1119,7 @@ gst_audio_test_src_fill (GstBaseSrc * basesrc, guint64 offset, if (src->eos_reached) { GST_INFO_OBJECT (src, "eos"); - return GST_FLOW_UNEXPECTED; + return GST_FLOW_EOS; } samplerate = GST_AUDIO_INFO_RATE (&src->info); diff --git a/gst/subparse/gstsubparse.c b/gst/subparse/gstsubparse.c index 2a12d96ccd..386c527b0c 100644 --- a/gst/subparse/gstsubparse.c +++ b/gst/subparse/gstsubparse.c @@ -1451,11 +1451,11 @@ handle_buffer (GstSubParse * self, GstBuffer * buf) /* make sure we know the format */ if (G_UNLIKELY (self->parser_type == GST_SUB_PARSE_FORMAT_UNKNOWN)) { if (!(caps = gst_sub_parse_format_autodetect (self))) { - return GST_FLOW_UNEXPECTED; + return GST_FLOW_EOS; } if (!gst_pad_set_caps (self->srcpad, caps)) { gst_caps_unref (caps); - return GST_FLOW_UNEXPECTED; + return GST_FLOW_EOS; } gst_caps_unref (caps); diff --git a/gst/tcp/gsttcp.c b/gst/tcp/gsttcp.c index f1b83a41d4..d9f242c554 100644 --- a/gst/tcp/gsttcp.c +++ b/gst/tcp/gsttcp.c @@ -189,7 +189,7 @@ ioctl_error: got_eos: { GST_DEBUG_OBJECT (this, "Got EOS on socket stream"); - return GST_FLOW_UNEXPECTED; + return GST_FLOW_EOS; } read_error: { @@ -288,7 +288,7 @@ ioctl_error: got_eos: { GST_DEBUG_OBJECT (this, "Got EOS on socket stream"); - return GST_FLOW_UNEXPECTED; + return GST_FLOW_EOS; } read_error: { diff --git a/gst/videotestsrc/gstvideotestsrc.c b/gst/videotestsrc/gstvideotestsrc.c index 022eb46b8d..2015f5e211 100644 --- a/gst/videotestsrc/gstvideotestsrc.c +++ b/gst/videotestsrc/gstvideotestsrc.c @@ -829,7 +829,7 @@ not_negotiated: eos: { GST_DEBUG_OBJECT (src, "eos: 0 framerate, frame %d", (gint) src->n_frames); - return GST_FLOW_UNEXPECTED; + return GST_FLOW_EOS; } invalid_frame: {