pad: GST_FLOW_UNEXPECTED -> GST_FLOW_EOS

This commit is contained in:
Wim Taymans 2011-10-10 11:33:51 +02:00
parent 756409b813
commit ea012d3dd7
19 changed files with 100 additions and 104 deletions

View file

@ -122,6 +122,8 @@ The 0.11 porting guide
gst_pad_get_negotiated_caps() -> get_pad_get_current_caps()
GST_FLOW_UNEXPECTED -> GST_FLOW_EOS
* GstPadTemplate
gst_pad_template_get_caps() returns a new reference of the caps
and the return value needs to be unreffed after usage.

View file

@ -811,7 +811,7 @@ default_acquire_buffer (GstBufferPool * pool, GstBuffer ** buffer,
/* check if we need to wait */
if (params && (params->flags & GST_BUFFER_POOL_FLAG_DONTWAIT)) {
GST_LOG_OBJECT (pool, "no more buffers");
result = GST_FLOW_UNEXPECTED;
result = GST_FLOW_EOS;
break;
}

View file

@ -169,7 +169,7 @@ static GstFlowQuarks flow_quarks[] = {
{GST_FLOW_OK, "ok", 0},
{GST_FLOW_NOT_LINKED, "not-linked", 0},
{GST_FLOW_WRONG_STATE, "wrong-state", 0},
{GST_FLOW_UNEXPECTED, "unexpected", 0},
{GST_FLOW_EOS, "eos", 0},
{GST_FLOW_NOT_NEGOTIATED, "not-negotiated", 0},
{GST_FLOW_ERROR, "error", 0},
{GST_FLOW_NOT_SUPPORTED, "not-supported", 0},
@ -3984,7 +3984,7 @@ get_range_failed:
GST_PAD_STREAM_UNLOCK (pad);
*buffer = NULL;
GST_CAT_LEVEL_LOG (GST_CAT_SCHEDULING,
(ret >= GST_FLOW_UNEXPECTED) ? GST_LEVEL_INFO : GST_LEVEL_WARNING,
(ret >= GST_FLOW_EOS) ? GST_LEVEL_INFO : GST_LEVEL_WARNING,
pad, "getrange failed, flow: %s", gst_flow_get_name (ret));
return ret;
}
@ -4133,7 +4133,7 @@ pull_range_failed:
*buffer = NULL;
GST_OBJECT_UNLOCK (pad);
GST_CAT_LEVEL_LOG (GST_CAT_SCHEDULING,
(ret >= GST_FLOW_UNEXPECTED) ? GST_LEVEL_INFO : GST_LEVEL_WARNING,
(ret >= GST_FLOW_EOS) ? GST_LEVEL_INFO : GST_LEVEL_WARNING,
pad, "pullrange failed, flow: %s", gst_flow_get_name (ret));
return ret;
}

View file

@ -114,7 +114,7 @@ typedef enum {
* @GST_FLOW_OK: Data passing was ok.
* @GST_FLOW_NOT_LINKED: Pad is not linked.
* @GST_FLOW_WRONG_STATE: Pad is in wrong state.
* @GST_FLOW_UNEXPECTED: Did not expect anything, like after EOS.
* @GST_FLOW_EOS: Pad is EOS.
* @GST_FLOW_NOT_NEGOTIATED: Pad is not negotiated.
* @GST_FLOW_ERROR: Some (fatal) error occured. Element generating
* this error should post an error message with more
@ -154,7 +154,7 @@ typedef enum {
GST_FLOW_NOT_LINKED = -1,
GST_FLOW_WRONG_STATE = -2,
/* error cases */
GST_FLOW_UNEXPECTED = -3,
GST_FLOW_EOS = -3,
GST_FLOW_NOT_NEGOTIATED = -4,
GST_FLOW_ERROR = -5,
GST_FLOW_NOT_SUPPORTED = -6,

View file

@ -1924,7 +1924,7 @@ gst_base_parse_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
GST_BUFFER_TIMESTAMP (buffer) >
parse->segment.stop + parse->priv->lead_out_ts) {
GST_LOG_OBJECT (parse, "Dropped frame, after segment");
ret = GST_FLOW_UNEXPECTED;
ret = GST_FLOW_EOS;
} else if (GST_BUFFER_TIMESTAMP_IS_VALID (buffer) &&
GST_BUFFER_DURATION_IS_VALID (buffer) &&
GST_CLOCK_TIME_IS_VALID (parse->segment.start) &&
@ -1964,7 +1964,7 @@ gst_base_parse_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
size, gst_flow_get_name (ret));
gst_buffer_unref (buffer);
/* if we are not sufficiently in control, let upstream decide on EOS */
if (ret == GST_FLOW_UNEXPECTED &&
if (ret == GST_FLOW_EOS &&
(parse->priv->passthrough ||
(parse->priv->pad_mode == GST_ACTIVATE_PUSH &&
!parse->priv->upstream_seekable)))
@ -2492,7 +2492,7 @@ gst_base_parse_handle_previous_fragment (GstBaseParse * parse)
if (!parse->priv->last_offset || parse->priv->last_ts <= parse->segment.start) {
GST_DEBUG_OBJECT (parse, "past start of segment %" GST_TIME_FORMAT,
GST_TIME_ARGS (parse->segment.start));
ret = GST_FLOW_UNEXPECTED;
ret = GST_FLOW_EOS;
goto exit;
}
@ -2642,7 +2642,7 @@ gst_base_parse_scan_frame (GstBaseParse * parse, GstBaseParseClass * klass,
goto done;
if (gst_buffer_get_size (outbuf) < fsize) {
gst_buffer_unref (outbuf);
ret = GST_FLOW_UNEXPECTED;
ret = GST_FLOW_EOS;
}
}
@ -2696,7 +2696,7 @@ gst_base_parse_loop (GstPad * pad)
ret = gst_base_parse_handle_and_push_frame (parse, klass, &frame);
/* eat expected eos signalling past segment in reverse playback */
if (parse->segment.rate < 0.0 && ret == GST_FLOW_UNEXPECTED &&
if (parse->segment.rate < 0.0 && ret == GST_FLOW_EOS &&
parse->segment.position >= parse->segment.stop) {
GST_DEBUG_OBJECT (parse, "downstream has reached end of segment");
/* push what was accumulated during loop run */
@ -2707,7 +2707,7 @@ gst_base_parse_loop (GstPad * pad)
}
done:
if (ret == GST_FLOW_UNEXPECTED)
if (ret == GST_FLOW_EOS)
goto eos;
else if (ret != GST_FLOW_OK)
goto pause;
@ -2718,7 +2718,7 @@ done:
/* ERRORS */
eos:
{
ret = GST_FLOW_UNEXPECTED;
ret = GST_FLOW_EOS;
GST_DEBUG_OBJECT (parse, "eos");
/* fall-through */
}
@ -2730,7 +2730,7 @@ pause:
gst_flow_get_name (ret));
gst_pad_pause_task (parse->sinkpad);
if (ret == GST_FLOW_UNEXPECTED) {
if (ret == GST_FLOW_EOS) {
/* handle end-of-stream/segment */
if (parse->segment.flags & GST_SEEK_FLAG_SEGMENT) {
gint64 stop;
@ -2752,7 +2752,7 @@ pause:
}
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, wrong-state is
* not fatal because it happens due to flushes and only means
* that we should stop now. */
@ -3470,7 +3470,7 @@ gst_base_parse_locate_time (GstBaseParse * parse, GstClockTime * _time,
GST_TIME_ARGS (time), newpos);
ret = gst_base_parse_find_frame (parse, &newpos, &newtime, &dur);
if (ret == GST_FLOW_UNEXPECTED) {
if (ret == GST_FLOW_EOS) {
/* heuristic HACK */
hpos = MAX (lpos, hpos - chunk);
continue;

View file

@ -2057,8 +2057,8 @@ gst_base_sink_wait_clock (GstBaseSink * sink, GstClockTime time,
/* FIXME: Casting to GstClockEntry only works because the types
* are the same */
if (G_LIKELY (sink->priv->cached_clock_id != NULL
&& GST_CLOCK_ENTRY_CLOCK ((GstClockEntry *) sink->priv->
cached_clock_id) == clock)) {
&& GST_CLOCK_ENTRY_CLOCK ((GstClockEntry *) sink->
priv->cached_clock_id) == clock)) {
if (!gst_clock_single_shot_id_reinit (clock, sink->priv->cached_clock_id,
time)) {
gst_clock_id_unref (sink->priv->cached_clock_id);
@ -3238,11 +3238,10 @@ flushing:
}
was_eos:
{
GST_DEBUG_OBJECT (basesink,
"we are EOS, dropping object, return UNEXPECTED");
GST_DEBUG_OBJECT (basesink, "we are EOS, dropping object, return EOS");
GST_BASE_SINK_PREROLL_UNLOCK (basesink);
gst_mini_object_unref (obj);
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
}
@ -3587,10 +3586,9 @@ flushing:
}
was_eos:
{
GST_DEBUG_OBJECT (basesink,
"we are EOS, dropping object, return UNEXPECTED");
GST_DEBUG_OBJECT (basesink, "we are EOS, dropping object, return EOS");
gst_mini_object_unref (GST_MINI_OBJECT_CAST (obj));
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
out_of_segment:
{
@ -3629,7 +3627,7 @@ wrong_mode:
gst_mini_object_unref (GST_MINI_OBJECT_CAST (obj));
/* we don't post an error message this will signal to the peer
* pushing that EOS is reached. */
result = GST_FLOW_UNEXPECTED;
result = GST_FLOW_EOS;
goto done;
}
}
@ -4024,7 +4022,7 @@ paused:
GST_LOG_OBJECT (basesink, "pausing task, reason %s",
gst_flow_get_name (result));
gst_pad_pause_task (pad);
if (result == GST_FLOW_UNEXPECTED) {
if (result == GST_FLOW_EOS) {
/* perform EOS logic */
if (basesink->segment.flags & GST_SEEK_FLAG_SEGMENT) {
gst_element_post_message (GST_ELEMENT_CAST (basesink),
@ -4033,7 +4031,7 @@ paused:
} else {
gst_base_sink_event (pad, gst_event_new_eos ());
}
} else if (result == GST_FLOW_NOT_LINKED || result <= GST_FLOW_UNEXPECTED) {
} else if (result == GST_FLOW_NOT_LINKED || result <= GST_FLOW_EOS) {
/* for fatal errors we post an error message, post the error
* first so the app knows about the error first.
* wrong-state is not a fatal error because it happens due to

View file

@ -2327,12 +2327,12 @@ unexpected_length:
{
GST_DEBUG_OBJECT (src, "unexpected length %u (offset=%" G_GUINT64_FORMAT
", size=%" G_GINT64_FORMAT ")", length, offset, src->segment.duration);
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
reached_num_buffers:
{
GST_DEBUG_OBJECT (src, "sent all buffers");
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
flushing:
{
@ -2344,7 +2344,7 @@ flushing:
eos:
{
GST_DEBUG_OBJECT (src, "we are EOS");
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
}
@ -2558,7 +2558,7 @@ gst_base_src_loop (GstPad * pad)
if (G_UNLIKELY (eos)) {
GST_INFO_OBJECT (src, "pausing after end of segment");
ret = GST_FLOW_UNEXPECTED;
ret = GST_FLOW_EOS;
goto pause;
}
@ -2581,7 +2581,7 @@ pause:
GST_DEBUG_OBJECT (src, "pausing task, reason %s", reason);
src->running = FALSE;
gst_pad_pause_task (pad);
if (ret == GST_FLOW_UNEXPECTED) {
if (ret == GST_FLOW_EOS) {
gboolean flag_segment;
GstFormat format;
gint64 position;
@ -2603,7 +2603,7 @@ pause:
gst_event_set_seqnum (event, src->priv->seqnum);
gst_pad_push_event (pad, event);
}
} else if (ret == GST_FLOW_NOT_LINKED || ret <= GST_FLOW_UNEXPECTED) {
} else if (ret == GST_FLOW_NOT_LINKED || ret <= GST_FLOW_EOS) {
event = gst_event_new_eos ();
gst_event_set_seqnum (event, src->priv->seqnum);
/* for fatal errors we post an error message, post the error

View file

@ -1395,7 +1395,7 @@ unexpected:
/* we should not post an error for this, just inform upstream that
* we don't expect anything anymore */
GST_DEBUG ("pad %s:%s is eos", GST_DEBUG_PAD_NAME (pad));
ret = GST_FLOW_UNEXPECTED;
ret = GST_FLOW_EOS;
goto unlock_done;
}
clipped:

View file

@ -460,7 +460,7 @@ gst_fake_sink_preroll (GstBaseSink * bsink, GstBuffer * buffer)
eos:
{
GST_DEBUG_OBJECT (sink, "we are EOS");
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
}
@ -548,7 +548,7 @@ gst_fake_sink_render (GstBaseSink * bsink, GstBuffer * buf)
eos:
{
GST_DEBUG_OBJECT (sink, "we are EOS");
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
}

View file

@ -496,7 +496,7 @@ eos:
{
GST_DEBUG_OBJECT (psrc, "Read 0 bytes. EOS.");
gst_buffer_unref (buf);
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
read_error:
{

View file

@ -395,7 +395,7 @@ eos:
{
GST_DEBUG ("non-regular file hits EOS");
gst_buffer_unmap (buf, data, 0);
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
}

View file

@ -659,7 +659,7 @@ gst_identity_transform_ip (GstBaseTransform * trans, GstBuffer * buf)
identity->clock_id = NULL;
}
if (cret == GST_CLOCK_UNSCHEDULED)
ret = GST_FLOW_UNEXPECTED;
ret = GST_FLOW_EOS;
}
GST_OBJECT_UNLOCK (identity);
}

View file

@ -1072,7 +1072,7 @@ gst_single_queue_push_one (GstMultiQueue * mq, GstSingleQueue * sq,
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_EOS:
result = GST_FLOW_UNEXPECTED;
result = GST_FLOW_EOS;
break;
case GST_EVENT_SEGMENT:
apply_segment (mq, sq, event, &sq->src_segment);
@ -1300,7 +1300,7 @@ gst_multi_queue_loop (GstPad * pad)
object = NULL;
if (result != GST_FLOW_OK && result != GST_FLOW_NOT_LINKED
&& result != GST_FLOW_UNEXPECTED)
&& result != GST_FLOW_EOS)
goto out_flushing;
GST_LOG_OBJECT (mq, "AFTER PUSHING sq->srcresult: %s",
@ -1325,7 +1325,7 @@ out_flushing:
* but might be stuck in one of our other full queues;
* so empty this one and trigger dynamic queue growth. At
* this point the srcresult is not OK, NOT_LINKED
* or UNEXPECTED, i.e. a real failure */
* or EOS, i.e. a real failure */
gst_data_queue_flush (sq->queue);
single_queue_underrun_cb (sq->queue, sq);
gst_data_queue_set_flushing (sq->queue, TRUE);
@ -1391,9 +1391,9 @@ flushing:
}
was_eos:
{
GST_DEBUG_OBJECT (mq, "we are EOS, dropping buffer, return UNEXPECTED");
GST_DEBUG_OBJECT (mq, "we are EOS, dropping buffer, return EOS");
gst_buffer_unref (buffer);
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
}
@ -1664,10 +1664,10 @@ compute_high_id (GstMultiQueue * mq)
if (sq->nextid < lowest)
lowest = sq->nextid;
} else if (sq->srcresult != GST_FLOW_UNEXPECTED) {
} else if (sq->srcresult != GST_FLOW_EOS) {
/* If we don't have a global highid, or the global highid is lower than
* this single queue's last outputted id, store the queue's one,
* unless the singlequeue is at EOS (srcresult = UNEXPECTED) */
* unless the singlequeue is at EOS (srcresult = EOS) */
if ((highid == G_MAXUINT32) || (sq->oldid > highid))
highid = sq->oldid;
}
@ -1709,10 +1709,10 @@ compute_high_time (GstMultiQueue * mq)
if (lowest == GST_CLOCK_TIME_NONE || sq->next_time < lowest)
lowest = sq->next_time;
} else if (sq->srcresult != GST_FLOW_UNEXPECTED) {
} else if (sq->srcresult != GST_FLOW_EOS) {
/* If we don't have a global highid, or the global highid is lower than
* this single queue's last outputted id, store the queue's one,
* unless the singlequeue is at EOS (srcresult = UNEXPECTED) */
* unless the singlequeue is at EOS (srcresult = EOS) */
if (highest == GST_CLOCK_TIME_NONE || sq->last_time > highest)
highest = sq->last_time;
}

View file

@ -690,7 +690,7 @@ gst_queue_locked_enqueue_event (GstQueue * queue, gpointer item)
apply_segment (queue, event, &queue->src_segment, FALSE);
queue->newseg_applied_to_src = TRUE;
}
/* a new segment allows us to accept more buffers if we got UNEXPECTED
/* a new segment allows us to accept more buffers if we got EOS
* from downstream */
queue->unexpected = FALSE;
break;
@ -1033,17 +1033,16 @@ out_eos:
gst_buffer_unref (buffer);
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
out_unexpected:
{
GST_CAT_LOG_OBJECT (queue_dataflow, queue,
"exit because we received UNEXPECTED");
GST_CAT_LOG_OBJECT (queue_dataflow, queue, "exit because we received EOS");
GST_QUEUE_MUTEX_UNLOCK (queue);
gst_buffer_unref (buffer);
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
}
@ -1113,17 +1112,16 @@ next:
/* need to check for srcresult here as well */
GST_QUEUE_MUTEX_LOCK_CHECK (queue, out_flushing);
if (result == GST_FLOW_UNEXPECTED) {
GST_CAT_LOG_OBJECT (queue_dataflow, queue,
"got UNEXPECTED from downstream");
if (result == GST_FLOW_EOS) {
GST_CAT_LOG_OBJECT (queue_dataflow, queue, "got EOS from downstream");
/* stop pushing buffers, we dequeue all items until we see an item that we
* can push again, which is EOS or SEGMENT. If there is nothing in the
* queue we can push, we set a flag to make the sinkpad refuse more
* buffers with an UNEXPECTED return value. */
* buffers with an EOS return value. */
while ((data = gst_queue_locked_dequeue (queue, &is_buffer))) {
if (is_buffer) {
GST_CAT_LOG_OBJECT (queue_dataflow, queue,
"dropping UNEXPECTED buffer %p", data);
"dropping EOS buffer %p", data);
gst_buffer_unref (GST_BUFFER_CAST (data));
} else {
GstEvent *event = GST_EVENT_CAST (data);
@ -1132,12 +1130,12 @@ next:
if (type == GST_EVENT_EOS || type == GST_EVENT_SEGMENT) {
/* we found a pushable item in the queue, push it out */
GST_CAT_LOG_OBJECT (queue_dataflow, queue,
"pushing pushable event %s after UNEXPECTED",
"pushing pushable event %s after EOS",
GST_EVENT_TYPE_NAME (event));
goto next;
}
GST_CAT_LOG_OBJECT (queue_dataflow, queue,
"dropping UNEXPECTED event %p", event);
"dropping EOS event %p", event);
gst_event_unref (event);
}
}
@ -1160,11 +1158,11 @@ next:
gst_pad_push_event (queue->srcpad, event);
GST_QUEUE_MUTEX_LOCK_CHECK (queue, out_flushing);
/* if we're EOS, return UNEXPECTED so that the task pauses. */
/* if we're EOS, return EOS so that the task pauses. */
if (type == GST_EVENT_EOS) {
GST_CAT_LOG_OBJECT (queue_dataflow, queue,
"pushed EOS event %p, return UNEXPECTED", event);
result = GST_FLOW_UNEXPECTED;
"pushed EOS event %p, return EOS", event);
result = GST_FLOW_EOS;
}
}
return result;
@ -1238,8 +1236,8 @@ out_flushing:
GST_QUEUE_SIGNAL_DEL (queue);
GST_QUEUE_MUTEX_UNLOCK (queue);
/* let app know about us giving up if upstream is not expected to do so */
/* UNEXPECTED is already taken care of elsewhere */
if (eos && (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_UNEXPECTED)) {
/* EOS is already taken care of elsewhere */
if (eos && (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS)) {
GST_ELEMENT_ERROR (queue, STREAM, FAILED,
(_("Internal data flow error.")),
("streaming task paused, reason %s (%d)",

View file

@ -1122,7 +1122,7 @@ could_not_read:
eos:
{
GST_DEBUG ("non-regular file hits EOS");
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
}
@ -1265,7 +1265,7 @@ hit_eos:
{
GST_DEBUG_OBJECT (queue, "EOS hit and we don't have any requested data");
gst_buffer_unref (buf);
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
out_flushing:
{
@ -1306,7 +1306,7 @@ gst_queue2_read_item_from_file (GstQueue2 * queue)
case GST_FLOW_OK:
item = GST_MINI_OBJECT_CAST (buffer);
break;
case GST_FLOW_UNEXPECTED:
case GST_FLOW_EOS:
item = GST_MINI_OBJECT_CAST (gst_event_new_eos ());
break;
default:
@ -1751,7 +1751,7 @@ out_flushing:
{
GST_DEBUG_OBJECT (queue, "we are flushing");
gst_buffer_unmap (buffer, odata, osize);
/* FIXME - GST_FLOW_UNEXPECTED ? */
/* FIXME - GST_FLOW_EOS ? */
return FALSE;
}
seek_failed:
@ -1831,7 +1831,7 @@ gst_queue2_locked_enqueue (GstQueue2 * queue, gpointer item, gboolean isbuffer)
queue->starting_segment = event;
item = NULL;
}
/* a new segment allows us to accept more buffers if we got UNEXPECTED
/* a new segment allows us to accept more buffers if we got EOS
* from downstream */
queue->unexpected = FALSE;
break;
@ -2165,16 +2165,15 @@ out_eos:
GST_QUEUE2_MUTEX_UNLOCK (queue);
gst_buffer_unref (buffer);
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
out_unexpected:
{
GST_CAT_LOG_OBJECT (queue_dataflow, queue,
"exit because we received UNEXPECTED");
GST_CAT_LOG_OBJECT (queue_dataflow, queue, "exit because we received EOS");
GST_QUEUE2_MUTEX_UNLOCK (queue);
gst_buffer_unref (buffer);
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
}
@ -2216,18 +2215,17 @@ next:
/* need to check for srcresult here as well */
GST_QUEUE2_MUTEX_LOCK_CHECK (queue, queue->srcresult, out_flushing);
if (result == GST_FLOW_UNEXPECTED) {
GST_CAT_LOG_OBJECT (queue_dataflow, queue,
"got UNEXPECTED from downstream");
if (result == GST_FLOW_EOS) {
GST_CAT_LOG_OBJECT (queue_dataflow, queue, "got EOS from downstream");
/* stop pushing buffers, we dequeue all items until we see an item that we
* can push again, which is EOS or SEGMENT. If there is nothing in the
* queue we can push, we set a flag to make the sinkpad refuse more
* buffers with an UNEXPECTED return value until we receive something
* buffers with an EOS return value until we receive something
* pushable again or we get flushed. */
while ((data = gst_queue2_locked_dequeue (queue, &is_buffer))) {
if (is_buffer) {
GST_CAT_LOG_OBJECT (queue_dataflow, queue,
"dropping UNEXPECTED buffer %p", data);
"dropping EOS buffer %p", data);
gst_buffer_unref (GST_BUFFER_CAST (data));
} else if (GST_IS_EVENT (data)) {
GstEvent *event = GST_EVENT_CAST (data);
@ -2236,12 +2234,12 @@ next:
if (type == GST_EVENT_EOS || type == GST_EVENT_SEGMENT) {
/* we found a pushable item in the queue, push it out */
GST_CAT_LOG_OBJECT (queue_dataflow, queue,
"pushing pushable event %s after UNEXPECTED",
"pushing pushable event %s after EOS",
GST_EVENT_TYPE_NAME (event));
goto next;
}
GST_CAT_LOG_OBJECT (queue_dataflow, queue,
"dropping UNEXPECTED event %p", event);
"dropping EOS event %p", event);
gst_event_unref (event);
}
}
@ -2258,11 +2256,11 @@ next:
gst_pad_push_event (queue->srcpad, event);
/* if we're EOS, return UNEXPECTED so that the task pauses. */
/* if we're EOS, return EOS so that the task pauses. */
if (type == GST_EVENT_EOS) {
GST_CAT_LOG_OBJECT (queue_dataflow, queue,
"pushed EOS event %p, return UNEXPECTED", event);
result = GST_FLOW_UNEXPECTED;
"pushed EOS event %p, return EOS", event);
result = GST_FLOW_EOS;
}
GST_QUEUE2_MUTEX_LOCK_CHECK (queue, queue->srcresult, out_flushing);
@ -2337,8 +2335,8 @@ out_flushing:
GST_CAT_LOG_OBJECT (queue_dataflow, queue,
"pause task, reason: %s", gst_flow_get_name (queue->srcresult));
/* let app know about us giving up if upstream is not expected to do so */
/* UNEXPECTED is already taken care of elsewhere */
if (eos && (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_UNEXPECTED)) {
/* EOS is already taken care of elsewhere */
if (eos && (ret == GST_FLOW_NOT_LINKED || ret < GST_FLOW_EOS)) {
GST_ELEMENT_ERROR (queue, STREAM, FAILED,
(_("Internal data flow error.")),
("streaming task paused, reason %s (%d)",
@ -2700,7 +2698,7 @@ out_unexpected:
GST_DEBUG_OBJECT (queue, "read beyond end of file");
GST_QUEUE2_MUTEX_UNLOCK (queue);
gst_object_unref (queue);
return GST_FLOW_UNEXPECTED;
return GST_FLOW_EOS;
}
}

View file

@ -924,7 +924,7 @@ gst_tee_src_get_range (GstPad * pad, guint64 offset, guint length,
if (ret == GST_FLOW_OK)
ret = gst_tee_handle_data (tee, gst_buffer_ref (*buf), FALSE);
else if (ret == GST_FLOW_UNEXPECTED)
else if (ret == GST_FLOW_EOS)
gst_tee_pull_eos (tee);
gst_object_unref (tee);

View file

@ -453,9 +453,9 @@ GST_START_TEST (test_eos)
GST_DEBUG ("sending buffer");
/* buffer after EOS is not UNEXPECTED */
/* buffer after EOS is not EOS */
fret = gst_pad_chain (sinkpad, buffer);
fail_unless (fret == GST_FLOW_UNEXPECTED);
fail_unless (fret == GST_FLOW_EOS);
}
/* flush, EOS state is flushed again. */
@ -556,7 +556,7 @@ GST_START_TEST (test_eos2)
fail_if (eret == FALSE);
}
/* send buffer that should return UNEXPECTED */
/* send buffer that should return EOS */
{
GstBuffer *buffer;
GstFlowReturn fret;
@ -567,12 +567,12 @@ GST_START_TEST (test_eos2)
GST_DEBUG ("sending buffer");
/* this buffer will generate UNEXPECTED */
/* this buffer will generate EOS */
fret = gst_pad_chain (sinkpad, buffer);
fail_unless (fret == GST_FLOW_UNEXPECTED);
fail_unless (fret == GST_FLOW_EOS);
}
/* send buffer that should return UNEXPECTED */
/* send buffer that should return EOS */
{
GstBuffer *buffer;
GstFlowReturn fret;
@ -584,7 +584,7 @@ GST_START_TEST (test_eos2)
GST_DEBUG ("sending buffer");
fret = gst_pad_chain (sinkpad, buffer);
fail_unless (fret == GST_FLOW_UNEXPECTED);
fail_unless (fret == GST_FLOW_EOS);
}
gst_element_set_state (pipeline, GST_STATE_NULL);
@ -815,7 +815,7 @@ GST_START_TEST (test_position)
fail_if (eret == FALSE);
}
/* send buffer that should return UNEXPECTED */
/* send buffer that should return EOS */
buffer = gst_buffer_new ();
GST_BUFFER_TIMESTAMP (buffer) = 3 * GST_SECOND;
GST_BUFFER_DURATION (buffer) = 1 * GST_SECOND;
@ -831,7 +831,7 @@ GST_START_TEST (test_position)
/* preroll buffer is rendered, we expect no more buffer after this one */
fret = chain_async_return (data);
fail_unless (fret == GST_FLOW_UNEXPECTED);
fail_unless (fret == GST_FLOW_EOS);
/* do position query, this should succeed with the stream time of the buffer
* against the clock. Since the buffer is synced against the clock, the time

View file

@ -270,19 +270,19 @@ GST_START_TEST (test_pull)
/* read 0 bytes at end should EOS */
ret = gst_pad_get_range (pad, stop, 0, &buffer1);
fail_unless (ret == GST_FLOW_UNEXPECTED);
fail_unless (ret == GST_FLOW_EOS);
/* read 10 bytes before end should EOS */
ret = gst_pad_get_range (pad, stop, 10, &buffer1);
fail_unless (ret == GST_FLOW_UNEXPECTED);
fail_unless (ret == GST_FLOW_EOS);
/* read 0 bytes after end should EOS */
ret = gst_pad_get_range (pad, stop + 10, 0, &buffer1);
fail_unless (ret == GST_FLOW_UNEXPECTED);
fail_unless (ret == GST_FLOW_EOS);
/* read 10 bytes after end should EOS too */
ret = gst_pad_get_range (pad, stop + 10, 10, &buffer1);
fail_unless (ret == GST_FLOW_UNEXPECTED);
fail_unless (ret == GST_FLOW_EOS);
fail_unless (gst_element_set_state (src,
GST_STATE_NULL) == GST_STATE_CHANGE_SUCCESS, "could not set to null");

View file

@ -524,10 +524,10 @@ GST_START_TEST (test_flowreturn)
GQuark quark;
/* test some of the macros */
ret = GST_FLOW_UNEXPECTED;
fail_if (strcmp (gst_flow_get_name (ret), "unexpected"));
ret = GST_FLOW_EOS;
fail_if (strcmp (gst_flow_get_name (ret), "eos"));
quark = gst_flow_to_quark (ret);
fail_if (strcmp (g_quark_to_string (quark), "unexpected"));
fail_if (strcmp (g_quark_to_string (quark), "eos"));
ret = GST_FLOW_RESEND;
fail_if (strcmp (gst_flow_get_name (ret), "resend"));