gst_omx_port_set_flushing (self->in_port, FALSE);
if (self->out_port)
gst_omx_port_set_flushing (self->out_port, FALSE);
+ self->downstream_flow_ret = GST_FLOW_OK;
break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break;
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
+ self->downstream_flow_ret = GST_FLOW_WRONG_STATE;
break;
case GST_STATE_CHANGE_READY_TO_NULL:
if (!gst_omx_audio_enc_close (self))
gst_omx_port_release_buffer (port, buf);
+ self->downstream_flow_ret = flow_ret;
+
if (flow_ret != GST_FLOW_OK)
goto flow_error;
gst_pad_push_event (GST_BASE_AUDIO_ENCODER_SRC_PAD (self),
gst_event_new_eos ());
gst_pad_pause_task (GST_BASE_AUDIO_ENCODER_SRC_PAD (self));
+ self->downstream_flow_ret = GST_FLOW_ERROR;
return;
}
flushing:
{
GST_DEBUG_OBJECT (self, "Flushing -- stopping task");
gst_pad_pause_task (GST_BASE_AUDIO_ENCODER_SRC_PAD (self));
+ self->downstream_flow_ret = GST_FLOW_WRONG_STATE;
return;
}
flow_error:
gst_pad_push_event (GST_BASE_AUDIO_ENCODER_SRC_PAD (self),
gst_event_new_eos ());
gst_pad_pause_task (GST_BASE_AUDIO_ENCODER_SRC_PAD (self));
+ self->downstream_flow_ret = GST_FLOW_NOT_NEGOTIATED;
return;
}
caps_failed:
gst_pad_push_event (GST_BASE_AUDIO_ENCODER_SRC_PAD (self),
gst_event_new_eos ());
gst_pad_pause_task (GST_BASE_AUDIO_ENCODER_SRC_PAD (self));
+ self->downstream_flow_ret = GST_FLOW_NOT_NEGOTIATED;
return;
}
}
self = GST_OMX_AUDIO_ENC (encoder);
+ self->downstream_flow_ret = GST_FLOW_OK;
ret =
gst_pad_start_task (GST_BASE_AUDIO_ENCODER_SRC_PAD (self),
(GstTaskFunction) gst_omx_audio_enc_loop, self);
if (gst_omx_component_get_state (self->component, 0) > OMX_StateIdle)
gst_omx_component_set_state (self->component, OMX_StateIdle);
+ self->downstream_flow_ret = GST_FLOW_WRONG_STATE;
gst_omx_port_set_flushing (self->in_port, TRUE);
gst_omx_port_set_flushing (self->out_port, TRUE);
}
/* Start the srcpad loop again */
+ self->downstream_flow_ret = GST_FLOW_OK;
gst_pad_start_task (GST_BASE_AUDIO_ENCODER_SRC_PAD (self),
(GstTaskFunction) gst_omx_audio_enc_loop, encoder);
}
/* Start the srcpad loop again */
+ self->downstream_flow_ret = GST_FLOW_OK;
gst_pad_start_task (GST_BASE_AUDIO_ENCODER_SRC_PAD (self),
(GstTaskFunction) gst_omx_audio_enc_loop, encoder);
}
self = GST_OMX_AUDIO_ENC (encoder);
+ if (self->downstream_flow_ret != GST_FLOW_OK) {
+ GST_ERROR_OBJECT (self, "Downstream returned %s",
+ gst_flow_get_name (self->downstream_flow_ret));
+
+ return self->downstream_flow_ret;
+ }
+
if (inbuf == NULL)
return GST_FLOW_OK;
g_assert (acq_ret == GST_OMX_ACQUIRE_BUFFER_OK && buf != NULL);
+ if (self->downstream_flow_ret != GST_FLOW_OK) {
+ GST_ERROR_OBJECT (self, "Downstream returned %s",
+ gst_flow_get_name (self->downstream_flow_ret));
+
+ gst_omx_port_release_buffer (self->in_port, buf);
+ return self->downstream_flow_ret;
+ }
+
if (buf->omx_buf->nAllocLen - buf->omx_buf->nOffset <= 0)
goto full_buffer;
gst_omx_port_release_buffer (self->in_port, buf);
}
- return GST_FLOW_OK;
+ return self->downstream_flow_ret;
full_buffer:
{