GST_DEBUG_OBJECT (dec, "failed to alloc buffer, reason %s", reason);
/* Reset for next time */
jpeg_abort_decompress (&dec->cinfo);
- if (ret != GST_FLOW_UNEXPECTED && ret != GST_FLOW_WRONG_STATE &&
+ if (ret != GST_FLOW_EOS && ret != GST_FLOW_WRONG_STATE &&
ret != GST_FLOW_NOT_LINKED) {
gst_jpeg_dec_set_error (dec, GST_FUNCTION, __LINE__,
"Buffer allocation failed, reason: %s", reason);
return;
}
GST_DEBUG_OBJECT (src, "got body");
- src->ret = GST_FLOW_UNEXPECTED;
+ src->ret = GST_FLOW_EOS;
if (src->loop)
g_main_loop_quit (src->loop);
gst_soup_http_src_session_pause_message (src);
return;
}
GST_DEBUG_OBJECT (src, "finished");
- src->ret = GST_FLOW_UNEXPECTED;
+ src->ret = GST_FLOW_EOS;
if (src->session_io_status == GST_SOUP_HTTP_SRC_SESSION_IO_STATUS_CANCELLED) {
/* gst_soup_http_src_cancel_message() triggered this; probably a seek
* that occurred in the QUEUEING state; i.e. before the connection setup
if (src->msg && (src->request_position != src->read_position)) {
if (src->content_size != 0 && src->request_position >= src->content_size) {
GST_WARNING_OBJECT (src, "Seeking behind the end of file -- EOS");
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
} else if (src->session_io_status ==
GST_SOUP_HTTP_SRC_SESSION_IO_STATUS_IDLE) {
gst_soup_http_src_add_range_header (src, src->request_position);
} while (src->ret == GST_FLOW_CUSTOM_ERROR);
if (src->ret == GST_FLOW_CUSTOM_ERROR)
- src->ret = GST_FLOW_UNEXPECTED;
+ src->ret = GST_FLOW_EOS;
return src->ret;
}
guint next_key;
/* Because we don't know the frame order we need to push from the prev keyframe
* to the next keyframe. If there is a smart decoder downstream he will notice
- * that there are too many encoded frames send and return UNEXPECTED when there
+ * that there are too many encoded frames send and return EOS when there
* are enough decoded frames to fill the segment. */
next_key = gst_avi_demux_index_next (avi, stream, index, TRUE);
stream->last_flow = ret;
/* any other error that is not-linked or eos can be returned right away */
- if (G_LIKELY (ret != GST_FLOW_UNEXPECTED && ret != GST_FLOW_NOT_LINKED))
+ if (G_LIKELY (ret != GST_FLOW_EOS && ret != GST_FLOW_NOT_LINKED))
goto done;
/* only return NOT_LINKED if all other pads returned NOT_LINKED */
ret = ostream->last_flow;
/* no unexpected or unlinked, return */
- if (G_LIKELY (ret != GST_FLOW_UNEXPECTED && ret != GST_FLOW_NOT_LINKED))
+ if (G_LIKELY (ret != GST_FLOW_EOS && ret != GST_FLOW_NOT_LINKED))
goto done;
/* we check to see if we have at least 1 unexpected or all unlinked */
- unexpected |= (ret == GST_FLOW_UNEXPECTED);
+ unexpected |= (ret == GST_FLOW_EOS);
not_linked &= (ret == GST_FLOW_NOT_LINKED);
}
/* when we get here, we all have unlinked or unexpected */
if (not_linked)
ret = GST_FLOW_NOT_LINKED;
else if (unexpected)
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
done:
GST_LOG_OBJECT (avi, "combined %s to return %s",
gst_flow_get_name (stream->last_flow), gst_flow_get_name (ret));
GST_DEBUG_OBJECT (avi, "we are EOS");
/* setting current_timestamp to -1 marks EOS */
stream->current_timestamp = -1;
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
}
}
stream = &avi->stream[i];
/* ignore streams that finished */
- if (stream->last_flow == GST_FLOW_UNEXPECTED)
+ if (stream->last_flow == GST_FLOW_EOS)
continue;
position = stream->current_timestamp;
processed = TRUE;
if (avi->segment.rate < 0) {
- if (timestamp > avi->segment.stop && ret == GST_FLOW_UNEXPECTED) {
- /* In reverse playback we can get a GST_FLOW_UNEXPECTED when
+ if (timestamp > avi->segment.stop && ret == GST_FLOW_EOS) {
+ /* In reverse playback we can get a GST_FLOW_EOS when
* we are at the end of the segment, so we just need to jump
* back to the previous section. */
GST_DEBUG_OBJECT (avi, "downstream has reached end of segment");
eos:
{
GST_DEBUG_OBJECT (avi, "No samples left for any streams - EOS");
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
goto beach;
}
eos_stop:
GST_LOG_OBJECT (avi, "Found keyframe after segment,"
" setting EOS (%" GST_TIME_FORMAT " > %" GST_TIME_FORMAT ")",
GST_TIME_ARGS (timestamp), GST_TIME_ARGS (avi->segment.stop));
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
/* move to next stream */
goto next;
}
", only got %" G_GSIZE_FORMAT "/%" G_GUINT64_FORMAT
" bytes (truncated file?)", offset, gst_buffer_get_size (buf), size);
gst_buffer_unref (buf);
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
goto beach;
}
}
if (G_UNLIKELY (avi->have_eos)) {
/* Clean adapter, we're done */
gst_adapter_clear (avi->adapter);
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
}
if (G_UNLIKELY (avi->todrop)) {
} else {
GST_DEBUG ("No more stream chunks, send EOS");
avi->have_eos = TRUE;
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
}
if (G_UNLIKELY (!gst_avi_demux_peek_chunk (avi, &tag, &size))) {
GST_LOG_OBJECT (avi, "pausing task, reason %s", gst_flow_get_name (res));
gst_pad_pause_task (avi->sinkpad);
- if (res == GST_FLOW_UNEXPECTED) {
+ if (res == GST_FLOW_EOS) {
/* handle end-of-stream/segment */
/* so align our position with the end of it, if there is one
* this ensures a subsequent will arrive at correct base/acc time */
} else {
push_eos = TRUE;
}
- } else if (res == GST_FLOW_NOT_LINKED || res < GST_FLOW_UNEXPECTED) {
+ } else if (res == GST_FLOW_NOT_LINKED || res < GST_FLOW_EOS) {
/* for fatal errors we post an error message, wrong-state is
* not fatal because it happens due to flushes and only means
* that we should stop now. */
if (push_eos) {
GST_INFO_OBJECT (avi, "sending eos");
if (!gst_avi_demux_push_event (avi, gst_event_new_eos ()) &&
- (res == GST_FLOW_UNEXPECTED)) {
+ (res == GST_FLOW_EOS)) {
GST_ELEMENT_ERROR (avi, STREAM, DEMUX,
(NULL), ("got eos but no streams (yet)"));
}
/* simply finish off the file and send EOS */
gst_avi_mux_stop_file (avimux);
gst_pad_push_event (avimux->srcpad, gst_event_new_eos ());
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
}
/* ERRORS */
if (sub->subfile != NULL) {
GST_WARNING_OBJECT (sub, "Got more buffers than expected, dropping");
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
goto done;
}
pull_failed:
{
- if (ret == GST_FLOW_UNEXPECTED) {
+ if (ret == GST_FLOW_EOS) {
GST_DEBUG_OBJECT (self, "eos");
gst_pad_push_event (self->srcpad, gst_event_new_eos ());
} else {
push_failed:
{
GST_DEBUG_OBJECT (self, "push flow: %s", gst_flow_get_name (ret));
- if (ret == GST_FLOW_UNEXPECTED) {
+ if (ret == GST_FLOW_EOS) {
GST_DEBUG_OBJECT (self, "eos");
gst_pad_push_event (self->srcpad, gst_event_new_eos ());
- } else if (ret < GST_FLOW_UNEXPECTED || ret == GST_FLOW_NOT_LINKED) {
+ } else if (ret < GST_FLOW_EOS || ret == GST_FLOW_NOT_LINKED) {
GST_ELEMENT_ERROR (self, STREAM, FAILED,
("Internal data stream error."),
("streaming stopped, reason: %s", gst_flow_get_name (ret)));
/* Push downstream */
ret = gst_pad_push (demux->audio_pad, outbuf);
if (G_UNLIKELY (ret != GST_FLOW_OK)) {
- if (demux->segment.rate < 0.0 && ret == GST_FLOW_UNEXPECTED &&
+ if (demux->segment.rate < 0.0 && ret == GST_FLOW_EOS &&
demux->segment.position > demux->segment.stop) {
- /* In reverse playback we can get a GST_FLOW_UNEXPECTED when
+ /* In reverse playback we can get a GST_FLOW_EOS when
* we are at the end of the segment, so we just need to jump
* back to the previous section. */
GST_DEBUG_OBJECT (demux, "downstream has reached end of segment");
ret = gst_pad_push (demux->video_pad, outbuf);
if (G_UNLIKELY (ret != GST_FLOW_OK)) {
- if (demux->segment.rate < 0.0 && ret == GST_FLOW_UNEXPECTED &&
+ if (demux->segment.rate < 0.0 && ret == GST_FLOW_EOS &&
demux->segment.position > demux->segment.stop) {
- /* In reverse playback we can get a GST_FLOW_UNEXPECTED when
+ /* In reverse playback we can get a GST_FLOW_EOS when
* we are at the end of the segment, so we just need to jump
* back to the previous section. */
GST_DEBUG_OBJECT (demux, "downstream has reached end of segment");
} else {
if (G_UNLIKELY (demux->strict)) {
GST_WARNING_OBJECT (demux, "invalid header tag detected");
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
goto beach;
}
}
"partial pull got %" G_GSIZE_FORMAT " when expecting %d from offset %"
G_GUINT64_FORMAT, gst_buffer_get_size (*buffer), size, offset);
gst_buffer_unref (*buffer);
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
*buffer = NULL;
return ret;
}
static GstFlowReturn
gst_flv_demux_seek_to_prev_keyframe (GstFlvDemux * demux)
{
- GstFlowReturn ret = GST_FLOW_UNEXPECTED;
+ GstFlowReturn ret = GST_FLOW_EOS;
GstIndexEntry *entry = NULL;
GST_DEBUG_OBJECT (demux,
demux->offset += tag_size;
}
- if (ret == GST_FLOW_UNEXPECTED) {
+ if (ret == GST_FLOW_EOS) {
/* file ran out, so mark we have complete index */
demux->indexed = TRUE;
ret = GST_FLOW_OK;
demux->file_size = gst_flv_demux_get_metadata (demux);
break;
case FLV_STATE_DONE:
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
break;
case FLV_STATE_SEEK:
/* seek issued with insufficient index;
/* check EOS condition */
if ((demux->segment.stop != -1) &&
(demux->segment.position >= demux->segment.stop)) {
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
}
}
GST_LOG_OBJECT (demux, "pausing task, reason %s", reason);
gst_pad_pause_task (pad);
- if (ret == GST_FLOW_UNEXPECTED) {
+ if (ret == GST_FLOW_EOS) {
/* handle end-of-stream/segment */
/* so align our position with the end of it, if there is one
* this ensures a subsequent will arrive at correct base/acc time */
if (!gst_flv_demux_push_src_event (demux, gst_event_new_eos ()))
GST_WARNING_OBJECT (demux, "failed pushing EOS on streams");
}
- } 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 (demux, STREAM, FAILED,
("Internal data stream error."),
("stream stopped, reason %s", reason));
} else if (eos) {
gst_flv_mux_rewrite_header (mux);
gst_pad_push_event (mux->srcpad, gst_event_new_eos ());
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
} else {
return GST_FLOW_OK;
}
}
if (G_UNLIKELY (qtmux->state == GST_QT_MUX_STATE_EOS))
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
/* select the best buffer */
walk = qtmux->collect->data;
if (ret == GST_FLOW_OK) {
GST_DEBUG_OBJECT (qtmux, "Pushing eos");
gst_pad_push_event (qtmux->srcpad, gst_event_new_eos ());
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
} else {
GST_WARNING_OBJECT (qtmux, "Failed to stop file: %s",
gst_flow_get_name (ret));
* so never mind the rest (e.g. tags) (that much) */
GST_WARNING_OBJECT (qtdemux, "atom has bogus size %" G_GUINT64_FORMAT,
size);
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
} else {
GST_ELEMENT_ERROR (qtdemux, STREAM, DEMUX,
(_("This file is invalid and cannot be played.")),
"short read: %" G_GSIZE_FORMAT " < %" G_GUINT64_FORMAT, bsize, size);
gst_buffer_unref (*buf);
*buf = NULL;
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
}
return flow;
(_("Invalid atom size.")),
("Header atom '%" GST_FOURCC_FORMAT "' has empty length",
GST_FOURCC_ARGS (fourcc)));
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
goto beach;
}
}
beach:
- if (ret == GST_FLOW_UNEXPECTED && qtdemux->got_moov) {
+ if (ret == GST_FLOW_EOS && qtdemux->got_moov) {
/* digested all data, show what we have */
ret = qtdemux_expose_streams (qtdemux);
return GST_FLOW_OK;
eos:
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
}
/* activate the given segment number @seg_idx of @stream at time @offset.
}
}
-/* UNEXPECTED and NOT_LINKED need to be combined. This means that we return:
+/* EOS and NOT_LINKED need to be combined. This means that we return:
*
* GST_FLOW_NOT_LINKED: when all pads NOT_LINKED.
- * GST_FLOW_UNEXPECTED: when all pads UNEXPECTED or NOT_LINKED.
+ * GST_FLOW_EOS: when all pads EOS or NOT_LINKED.
*/
static GstFlowReturn
gst_qtdemux_combine_flows (GstQTDemux * demux, QtDemuxStream * stream,
stream->last_ret = ret;
/* any other error that is not-linked or eos can be returned right away */
- if (G_LIKELY (ret != GST_FLOW_UNEXPECTED && ret != GST_FLOW_NOT_LINKED))
+ if (G_LIKELY (ret != GST_FLOW_EOS && ret != GST_FLOW_NOT_LINKED))
goto done;
/* only return NOT_LINKED if all other pads returned NOT_LINKED */
ret = ostream->last_ret;
/* no unexpected or unlinked, return */
- if (G_LIKELY (ret != GST_FLOW_UNEXPECTED && ret != GST_FLOW_NOT_LINKED))
+ if (G_LIKELY (ret != GST_FLOW_EOS && ret != GST_FLOW_NOT_LINKED))
goto done;
/* we check to see if we have at least 1 unexpected or all unlinked */
- unexpected |= (ret == GST_FLOW_UNEXPECTED);
+ unexpected |= (ret == GST_FLOW_EOS);
not_linked &= (ret == GST_FLOW_NOT_LINKED);
}
if (not_linked)
ret = GST_FLOW_NOT_LINKED;
else if (unexpected)
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
done:
GST_LOG_OBJECT (demux, "combined flow return: %s", gst_flow_get_name (ret));
return ret;
goto next;
/* last pushed sample was out of boundary, goto next sample */
- if (G_UNLIKELY (stream->last_ret == GST_FLOW_UNEXPECTED))
+ if (G_UNLIKELY (stream->last_ret == GST_FLOW_EOS))
goto next;
GST_LOG_OBJECT (qtdemux, "reading %d bytes @ %" G_GUINT64_FORMAT, size,
ret = gst_qtdemux_combine_flows (qtdemux, stream, ret);
/* ignore unlinked, we will not push on the pad anymore and we will EOS when
* we have no more data for the pad to push */
- if (ret == GST_FLOW_UNEXPECTED)
+ if (ret == GST_FLOW_EOS)
ret = GST_FLOW_OK;
next:
eos:
{
GST_DEBUG_OBJECT (qtdemux, "No samples left for any streams - EOS");
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
goto beach;
}
eos_stream:
break;
case QTDEMUX_STATE_MOVIE:
ret = gst_qtdemux_loop_state_movie (qtdemux);
- if (qtdemux->segment.rate < 0 && ret == GST_FLOW_UNEXPECTED) {
+ if (qtdemux->segment.rate < 0 && ret == GST_FLOW_EOS) {
ret = gst_qtdemux_seek_to_previous_keyframe (qtdemux);
}
break;
/* fatal errors need special actions */
/* check EOS */
- if (ret == GST_FLOW_UNEXPECTED) {
+ if (ret == GST_FLOW_EOS) {
if (qtdemux->n_streams == 0) {
/* we have no streams, post an error */
gst_qtdemux_post_no_playable_stream_error (qtdemux);
GST_LOG_OBJECT (qtdemux, "Sending EOS at end of segment");
gst_qtdemux_push_event (qtdemux, 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 (qtdemux, STREAM, FAILED,
(NULL), ("streaming stopped, reason %s", reason));
gst_qtdemux_push_event (qtdemux, gst_event_new_eos ());
eos:
{
GST_DEBUG_OBJECT (demux, "no next entry, EOS");
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
goto done;
}
invalid_state:
goto locate_failed;
if (G_UNLIKELY (gst_buffer_get_size (buf) != 16)) {
/* likely EOF */
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
gst_buffer_unref (buf);
goto locate_failed;
}
if (!offset) {
GST_DEBUG_OBJECT (qtdemux, "no next moof");
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
}
/* best not do pull etc with lock held */
/* Peeks following element id and element length in datastream provided
* by @peek with @ctx as user data.
- * Returns GST_FLOW_UNEXPECTED if not enough data to read id and length.
+ * Returns GST_FLOW_EOS if not enough data to read id and length.
* Otherwise, @needed provides the prefix length (id + length), and
* @length provides element length.
*
if (G_LIKELY (gst_byte_reader_peek_data (br, peek, data)))
return GST_FLOW_OK;
else
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
}
static GstFlowReturn
}
if (context->type == 0 || context->codec_id == NULL || (ret != GST_FLOW_OK
- && ret != GST_FLOW_UNEXPECTED)) {
- if (ret == GST_FLOW_OK || ret == GST_FLOW_UNEXPECTED)
+ && ret != GST_FLOW_EOS)) {
+ if (ret == GST_FLOW_OK || ret == GST_FLOW_EOS)
GST_WARNING_OBJECT (ebml, "Unknown stream/codec in track entry header");
demux->common.num_streams--;
while (1) {
ret = gst_matroska_demux_search_cluster (demux, &newpos);
- if (ret == GST_FLOW_UNEXPECTED) {
+ if (ret == GST_FLOW_EOS) {
/* heuristic HACK */
newpos = startpos * 80 / 100;
GST_DEBUG_OBJECT (demux, "EOS; "
continue;
error:
- if (ret == GST_FLOW_UNEXPECTED) {
+ if (ret == GST_FLOW_EOS) {
if (prev_cluster_time != GST_CLOCK_TIME_NONE)
break;
}
static GstFlowReturn
gst_matroska_demux_seek_to_previous_keyframe (GstMatroskaDemux * demux)
{
- GstFlowReturn ret = GST_FLOW_UNEXPECTED;
+ GstFlowReturn ret = GST_FLOW_EOS;
gboolean done = TRUE;
gint i;
- g_return_val_if_fail (demux->seek_index, GST_FLOW_UNEXPECTED);
+ g_return_val_if_fail (demux->seek_index, GST_FLOW_EOS);
g_return_val_if_fail (demux->seek_entry < demux->seek_index->len,
- GST_FLOW_UNEXPECTED);
+ GST_FLOW_EOS);
GST_DEBUG_OBJECT (demux, "locating previous keyframe");
ret = gst_pad_push (stream->pad, sub);
if (demux->common.segment.rate < 0) {
- if (lace_time > demux->common.segment.stop
- && ret == GST_FLOW_UNEXPECTED) {
- /* In reverse playback we can get a GST_FLOW_UNEXPECTED when
+ if (lace_time > demux->common.segment.stop && ret == GST_FLOW_EOS) {
+ /* In reverse playback we can get a GST_FLOW_EOS when
* we are at the end of the segment, so we just need to jump
* back to the previous section. */
GST_DEBUG_OBJECT (demux, "downstream has reached end of segment");
}
}
- if (ret != GST_FLOW_OK && ret != GST_FLOW_UNEXPECTED)
+ if (ret != GST_FLOW_OK && ret != GST_FLOW_EOS)
return ret;
if (!seek_id || seek_pos == (guint64) - 1) {
if (flush <= gst_adapter_available (demux->common.adapter))
gst_adapter_flush (demux->common.adapter, flush);
else
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
}
return GST_FLOW_OK;
}
/* initializes @ebml with @bytes from input stream at current offset.
- * Returns UNEXPECTED if insufficient available,
+ * Returns EOS if insufficient available,
* ERROR if too much was attempted to read. */
static inline GstFlowReturn
gst_matroska_demux_take (GstMatroskaDemux * demux, guint64 bytes,
if (gst_adapter_available (demux->common.adapter) >= bytes)
buffer = gst_adapter_take_buffer (demux->common.adapter, bytes);
else
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
} else
ret = gst_matroska_read_common_peek_bytes (&demux->common,
demux->common.offset, bytes, &buffer, NULL);
ret = gst_matroska_read_common_peek_id_length_pull (&demux->common,
GST_ELEMENT_CAST (demux), &id, &length, &needed);
- if (ret == GST_FLOW_UNEXPECTED)
+ if (ret == GST_FLOW_EOS)
goto eos;
if (ret != GST_FLOW_OK) {
if (gst_matroska_demux_check_parse_error (demux))
length, needed);
ret = gst_matroska_demux_parse_id (demux, id, length, needed);
- if (ret == GST_FLOW_UNEXPECTED)
+ if (ret == GST_FLOW_EOS)
goto eos;
if (ret != GST_FLOW_OK)
goto pause;
}
GST_INFO_OBJECT (demux, "All streams are EOS");
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
goto eos;
}
if (G_UNLIKELY (demux->common.offset ==
gst_matroska_read_common_get_length (&demux->common))) {
GST_LOG_OBJECT (demux, "Reached end of stream");
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
goto eos;
}
demux->segment_running = FALSE;
gst_pad_pause_task (demux->common.sinkpad);
- if (ret == GST_FLOW_UNEXPECTED) {
+ if (ret == GST_FLOW_EOS) {
/* perform EOS logic */
/* If we were in the headers, make sure we send no-more-pads.
} else {
push_eos = TRUE;
}
- } else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_UNEXPECTED) {
+ } else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS) {
/* for fatal errors we post an error message */
GST_ELEMENT_ERROR (demux, STREAM, FAILED, (NULL),
("stream stopped, reason %s", reason));
/* send EOS, and prevent hanging if no streams yet */
GST_LOG_OBJECT (demux, "Sending EOS, at end of stream");
if (!gst_matroska_demux_send_event (demux, gst_event_new_eos ()) &&
- (ret == GST_FLOW_UNEXPECTED)) {
+ (ret == GST_FLOW_EOS)) {
GST_ELEMENT_ERROR (demux, STREAM, DEMUX,
(NULL), ("got eos but no streams (yet)"));
}
ret = gst_matroska_read_common_peek_id_length_push (&demux->common,
GST_ELEMENT_CAST (demux), &id, &length, &needed);
- if (G_UNLIKELY (ret != GST_FLOW_OK && ret != GST_FLOW_UNEXPECTED))
+ if (G_UNLIKELY (ret != GST_FLOW_OK && ret != GST_FLOW_EOS))
return ret;
GST_LOG_OBJECT (demux, "Offset %" G_GUINT64_FORMAT ", Element id 0x%x, "
return GST_FLOW_OK;
ret = gst_matroska_demux_parse_id (demux, id, length, needed);
- if (ret == GST_FLOW_UNEXPECTED) {
+ if (ret == GST_FLOW_EOS) {
/* need more data */
return GST_FLOW_OK;
} else if (ret != GST_FLOW_OK) {
GST_DEBUG_OBJECT (mux, "... but streamable, nothing to finish");
}
gst_pad_push_event (mux->srcpad, gst_event_new_eos ());
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
break;
}
GST_DEBUG_OBJECT (best->collect.pad, "best pad - buffer ts %"
}
if (context->type == 0 || context->codec_id == NULL || (ret != GST_FLOW_OK
- && ret != GST_FLOW_UNEXPECTED)) {
- if (ret == GST_FLOW_OK || ret == GST_FLOW_UNEXPECTED)
+ && ret != GST_FLOW_EOS)) {
+ if (ret == GST_FLOW_OK || ret == GST_FLOW_EOS)
GST_WARNING_OBJECT (ebml, "Unknown stream/codec in track entry header");
parse->common.num_streams--;
ret = gst_pad_push (stream->pad, sub);
if (parse->segment.rate < 0) {
- if (lace_time > parse->segment.stop && ret == GST_FLOW_UNEXPECTED) {
- /* In reverse playback we can get a GST_FLOW_UNEXPECTED when
+ if (lace_time > parse->segment.stop && ret == GST_FLOW_EOS) {
+ /* In reverse playback we can get a GST_FLOW_EOS when
* we are at the end of the segment, so we just need to jump
* back to the previous section. */
GST_DEBUG_OBJECT (parse, "downstream has reached end of segment");
}
}
- if (ret != GST_FLOW_OK && ret != GST_FLOW_UNEXPECTED)
+ if (ret != GST_FLOW_OK && ret != GST_FLOW_EOS)
return ret;
if (!seek_id || seek_pos == (guint64) - 1) {
}
/* initializes @ebml with @bytes from input stream at current offset.
- * Returns UNEXPECTED if insufficient available,
+ * Returns EOS if insufficient available,
* ERROR if too much was attempted to read. */
static inline GstFlowReturn
gst_matroska_parse_take (GstMatroskaParse * parse, guint64 bytes,
if (gst_adapter_available (parse->common.adapter) >= bytes)
buffer = gst_adapter_take_buffer (parse->common.adapter, bytes);
else
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
if (G_LIKELY (buffer)) {
gst_ebml_read_init (ebml, GST_ELEMENT_CAST (parse), buffer,
parse->common.offset);
buffer = gst_adapter_take_buffer (parse->adapter, length + needed);
gst_pad_push (parse->srcpad, buffer);
} else {
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
}
//GST_READ_CHECK (gst_matroska_parse_take (parse, read, &ebml));
ret = gst_matroska_read_common_peek_id_length_pull (&parse->common,
GST_ELEMENT_CAST (parse), &id, &length, &needed);
- if (ret == GST_FLOW_UNEXPECTED)
+ if (ret == GST_FLOW_EOS)
goto eos;
if (ret != GST_FLOW_OK) {
if (gst_matroska_parse_check_parse_error (parse))
length, needed);
ret = gst_matroska_parse_parse_id (parse, id, length, needed);
- if (ret == GST_FLOW_UNEXPECTED)
+ if (ret == GST_FLOW_EOS)
goto eos;
if (ret != GST_FLOW_OK)
goto pause;
}
GST_INFO_OBJECT (parse, "All streams are EOS");
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
goto eos;
}
if (G_UNLIKELY (parse->offset ==
gst_matroska_read_common_get_length (&parse->common))) {
GST_LOG_OBJECT (parse, "Reached end of stream");
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
goto eos;
}
parse->segment_running = FALSE;
gst_pad_pause_task (parse->common.sinkpad);
- if (ret == GST_FLOW_UNEXPECTED) {
+ if (ret == GST_FLOW_EOS) {
/* perform EOS logic */
/* Close the segment, i.e. update segment stop with the duration
} else {
push_eos = TRUE;
}
- } else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_UNEXPECTED) {
+ } else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS) {
/* for fatal errors we post an error message */
GST_ELEMENT_ERROR (parse, STREAM, FAILED, (NULL),
("stream stopped, reason %s", reason));
/* send EOS, and prevent hanging if no streams yet */
GST_LOG_OBJECT (parse, "Sending EOS, at end of stream");
if (!gst_matroska_parse_send_event (parse, gst_event_new_eos ()) &&
- (ret == GST_FLOW_UNEXPECTED)) {
+ (ret == GST_FLOW_EOS)) {
GST_ELEMENT_ERROR (parse, STREAM, DEMUX,
(NULL), ("got eos but no streams (yet)"));
}
ret = gst_matroska_read_common_peek_id_length_push (&parse->common,
GST_ELEMENT_CAST (parse), &id, &length, &needed);
- if (G_UNLIKELY (ret != GST_FLOW_OK && ret != GST_FLOW_UNEXPECTED))
+ if (G_UNLIKELY (ret != GST_FLOW_OK && ret != GST_FLOW_EOS))
return ret;
GST_LOG_OBJECT (parse, "Offset %" G_GUINT64_FORMAT ", Element id 0x%x, "
return GST_FLOW_OK;
ret = gst_matroska_parse_parse_id (parse, id, length, needed);
- if (ret == GST_FLOW_UNEXPECTED) {
+ if (ret == GST_FLOW_EOS) {
/* need more data */
return GST_FLOW_OK;
} else if (ret != GST_FLOW_OK) {
DEBUG_ELEMENT_STOP (common, ebml, "CueTrackPositions", ret);
- if ((ret == GST_FLOW_OK || ret == GST_FLOW_UNEXPECTED)
+ if ((ret == GST_FLOW_OK || ret == GST_FLOW_EOS)
&& idx.pos != (guint64) - 1 && idx.track > 0) {
g_array_append_val (common->index, idx);
(*nentries)++;
- } else if (ret == GST_FLOW_OK || ret == GST_FLOW_UNEXPECTED) {
+ } else if (ret == GST_FLOW_OK || ret == GST_FLOW_EOS) {
GST_DEBUG_OBJECT (common, "CueTrackPositions without valid content");
}
/* Caller needs to gst_adapter_unmap. */
*data = gst_adapter_map (common->adapter, peek);
if (*data == NULL)
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
return GST_FLOW_OK;
}
*p_buf = NULL;
if (bytes)
*bytes = NULL;
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
}
if (p_buf)
}
DEBUG_ELEMENT_STOP (common, ebml, "ContentEncoding", ret);
- if (ret != GST_FLOW_OK && ret != GST_FLOW_UNEXPECTED)
+ if (ret != GST_FLOW_OK && ret != GST_FLOW_EOS)
return ret;
/* TODO: Check if the combination of values is valid */
}
DEBUG_ELEMENT_STOP (common, ebml, "ContentEncodings", ret);
- if (ret != GST_FLOW_OK && ret != GST_FLOW_UNEXPECTED)
+ if (ret != GST_FLOW_OK && ret != GST_FLOW_EOS)
return ret;
/* Sort encodings according to their order */
if (error != NULL)
g_error_free (error);
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
}
} else {
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
}
} else {
goto handle_error;
cur_part = src->parts[src->cur_part];
if (offset < cur_part.start || offset > cur_part.stop) {
if (!gst_split_file_src_find_part_for_offset (src, offset, &src->cur_part))
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
cur_part = src->parts[src->cur_part];
}
if (G_UNLIKELY (size == MULTIPART_DATA_ERROR))
return GST_FLOW_ERROR;
if (G_UNLIKELY (size == MULTIPART_DATA_EOS))
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
return res;
}
{
GST_DEBUG_OBJECT (mux, "Pushing EOS");
gst_pad_push_event (mux->srcpad, gst_event_new_eos ());
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
goto beach;
}
nego_error:
}
have_eos:
{
- ret = GST_FLOW_UNEXPECTED;
+ ret = GST_FLOW_EOS;
GST_WARNING_OBJECT (jitterbuffer, "we are EOS, refusing buffer");
gst_buffer_unref (buffer);
goto finished;
{
/* store result, we are flushing now */
GST_DEBUG_OBJECT (jitterbuffer, "We are EOS, pushing EOS downstream");
- priv->srcresult = GST_FLOW_UNEXPECTED;
+ priv->srcresult = GST_FLOW_EOS;
gst_pad_pause_task (priv->srcpad);
JBUF_UNLOCK (priv);
gst_pad_push_event (priv->srcpad, gst_event_new_eos ());
("The server closed the connection."));
src->conninfo.connected = FALSE;
gst_rtsp_message_unset (&message);
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
}
interrupt:
{
("The server closed the connection."));
src->conninfo.connected = FALSE;
gst_rtsp_message_unset (&message);
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
}
}
GST_DEBUG_OBJECT (src, "pausing task, reason %s", reason);
src->running = FALSE;
- if (ret == GST_FLOW_UNEXPECTED) {
+ if (ret == GST_FLOW_EOS) {
/* perform EOS logic */
if (src->segment.flags & GST_SEEK_FLAG_SEGMENT) {
gst_element_post_message (GST_ELEMENT_CAST (src),
} else {
gst_rtspsrc_push_event (src, gst_event_new_eos (), FALSE);
}
- } else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_UNEXPECTED) {
+ } else if (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS) {
/* for fatal errors we post an error message, post the error before the
* EOS so the app knows about the error first. */
GST_ELEMENT_ERROR (src, STREAM, FAILED,
found_eos:
{
GST_DEBUG_OBJECT (wav, "found EOS");
- return GST_FLOW_UNEXPECTED;
+ return GST_FLOW_EOS;
}
pull_error:
{
/* check if we got EOS */
- if (res == GST_FLOW_UNEXPECTED)
+ if (res == GST_FLOW_EOS)
goto found_eos;
GST_WARNING_OBJECT (wav,
GST_DEBUG_OBJECT (wav, "pausing task, reason %s", reason);
gst_pad_pause_task (pad);
- if (ret == GST_FLOW_UNEXPECTED) {
+ if (ret == GST_FLOW_EOS) {
/* handle end-of-stream/segment */
/* so align our position with the end of it, if there is one
* this ensures a subsequent will arrive at correct base/acc time */
} else {
gst_pad_push_event (wav->srcpad, 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) {
/* for fatal errors we post an error message, post the error
* first so the app knows about the error first. */
GST_ELEMENT_ERROR (wav, STREAM, FAILED,