gst_event_new_eos ());
gst_pad_pause_task (GST_BASE_VIDEO_CODEC_SRC_PAD (self));
self->downstream_flow_ret = GST_FLOW_ERROR;
+ self->started = FALSE;
return;
}
GST_DEBUG_OBJECT (self, "Flushing -- stopping task");
gst_pad_pause_task (GST_BASE_VIDEO_CODEC_SRC_PAD (self));
self->downstream_flow_ret = GST_FLOW_WRONG_STATE;
+ self->started = FALSE;
return;
}
gst_event_new_eos ());
gst_pad_pause_task (GST_BASE_VIDEO_CODEC_SRC_PAD (self));
}
+ self->started = FALSE;
return;
}
gst_event_new_eos ());
gst_pad_pause_task (GST_BASE_VIDEO_CODEC_SRC_PAD (self));
self->downstream_flow_ret = GST_FLOW_ERROR;
+ self->started = FALSE;
return;
}
gst_event_new_eos ());
gst_pad_pause_task (GST_BASE_VIDEO_CODEC_SRC_PAD (self));
self->downstream_flow_ret = GST_FLOW_NOT_NEGOTIATED;
+ self->started = FALSE;
return;
}
gst_event_new_eos ());
gst_pad_pause_task (GST_BASE_VIDEO_CODEC_SRC_PAD (self));
self->downstream_flow_ret = GST_FLOW_NOT_NEGOTIATED;
+ self->started = FALSE;
return;
}
}
self = GST_OMX_VIDEO_DEC (decoder);
+ self->eos = FALSE;
self->downstream_flow_ret = GST_FLOW_OK;
ret =
gst_pad_start_task (GST_BASE_VIDEO_CODEC_SRC_PAD (self),
gst_omx_component_set_state (self->component, OMX_StateIdle);
self->downstream_flow_ret = GST_FLOW_WRONG_STATE;
+ self->started = FALSE;
+ self->eos = FALSE;
g_mutex_lock (self->drain_lock);
self->draining = FALSE;
}
if (needs_disable && is_format_change) {
- if (self->started) {
- gst_omx_video_dec_drain (self);
- self->started = FALSE;
- }
+ gst_omx_video_dec_drain (self);
/* FIXME: Workaround for
* https://bugzilla.gnome.org/show_bug.cgi?id=654529
GST_DEBUG_OBJECT (self, "Resetting decoder");
- if (self->started)
- gst_omx_video_dec_drain (self);
+ gst_omx_video_dec_drain (self);
/* FIXME: Workaround for
* https://bugzilla.gnome.org/show_bug.cgi?id=654529
}
/* Start the srcpad loop again */
+ self->eos = FALSE;
self->downstream_flow_ret = GST_FLOW_OK;
gst_pad_start_task (GST_BASE_VIDEO_CODEC_SRC_PAD (self),
(GstTaskFunction) gst_omx_video_dec_loop, decoder);
GST_DEBUG_OBJECT (self, "Handling frame");
+ if (self->eos) {
+ GST_WARNING_OBJECT (self, "Got frame after EOS");
+ return GST_FLOW_UNEXPECTED;
+ }
+
timestamp = frame->presentation_timestamp;
duration = frame->presentation_duration;
GST_DEBUG_OBJECT (self, "Sending EOS to the component");
+ /* Don't send EOS buffer twice, this doesn't work */
+ if (self->eos)
+ return GST_BASE_VIDEO_DECODER_FLOW_DROPPED;
+ self->eos = TRUE;
+
/* Send an EOS buffer to the component and let the base
* class drop the EOS event. We will send it later when
* the EOS buffer arrives on the output port. */
GST_DEBUG_OBJECT (self, "Draining component");
- g_assert (self->started);
+ if (!self->started)
+ return GST_FLOW_OK;
+ self->started = FALSE;
+
+ /* Don't send EOS buffer twice, this doesn't work */
+ if (self->eos)
+ return GST_FLOW_OK;
/* Send an EOS buffer to the component and let the base
* class drop the EOS event. We will send it later when
g_mutex_unlock (self->drain_lock);
GST_BASE_VIDEO_CODEC_STREAM_LOCK (self);
+ self->started = FALSE;
+
return GST_FLOW_OK;
}