summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2013-03-11 13:45:04 +0100
committerJosep Torra <n770galaxy@gmail.com>2013-03-11 16:57:28 +0100
commitee0c4f331f7b8a87ca06c46cfd35a44aa3c99088 (patch)
treead905103c00db1797ef390fcb4055fa5920978fb
parentf359ab23664c5862d4c387e5a829166485f8254e (diff)
downloadgst-omx-ee0c4f331f7b8a87ca06c46cfd35a44aa3c99088.tar.gz
omxvideoenc: Always allocate output buffers from the loop function
-rw-r--r--omx/gstomxvideoenc.c49
1 files changed, 6 insertions, 43 deletions
diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c
index 2c49750..acd11c8 100644
--- a/omx/gstomxvideoenc.c
+++ b/omx/gstomxvideoenc.c
@@ -1245,27 +1245,7 @@ gst_omx_video_enc_set_format (GstVideoEncoder * encoder,
return FALSE;
if (gst_omx_port_mark_reconfigured (self->enc_in_port) != OMX_ErrorNone)
return FALSE;
-
- /* If the output port is already configured with the new format we can
- * allocate buffers here already */
- if (self->enc_out_port->port_def.format.video.nFrameHeight == info->height
- && self->enc_out_port->port_def.format.video.nFrameWidth ==
- info->width) {
- if (gst_omx_port_set_enabled (self->enc_out_port, TRUE) != OMX_ErrorNone)
- return FALSE;
- if (gst_omx_port_allocate_buffers (self->enc_out_port) != OMX_ErrorNone)
- return FALSE;
- if (gst_omx_port_wait_enabled (self->enc_out_port,
- 3 * GST_SECOND) != OMX_ErrorNone)
- return FALSE;
- if (gst_omx_port_populate (self->enc_out_port) != OMX_ErrorNone)
- return FALSE;
- if (gst_omx_port_mark_reconfigured (self->enc_out_port) != OMX_ErrorNone)
- return FALSE;
- }
} else {
- gboolean have_output_buffers = FALSE;
-
if (gst_omx_component_set_state (self->enc, OMX_StateIdle) != OMX_ErrorNone)
return FALSE;
@@ -1273,23 +1253,13 @@ gst_omx_video_enc_set_format (GstVideoEncoder * encoder,
if (gst_omx_port_allocate_buffers (self->enc_in_port) != OMX_ErrorNone)
return FALSE;
- /* If the output port is already configured with the new format we can
- * allocate buffers here already */
- if (self->enc_out_port->port_def.format.video.nFrameHeight == info->height
- && self->enc_out_port->port_def.format.video.nFrameWidth ==
- info->width) {
- if (gst_omx_port_allocate_buffers (self->enc_out_port) != OMX_ErrorNone)
- return FALSE;
- have_output_buffers = TRUE;
- } else {
- /* And disable output port */
- if (gst_omx_port_set_enabled (self->enc_out_port, FALSE) != OMX_ErrorNone)
- return FALSE;
+ /* And disable output port */
+ if (gst_omx_port_set_enabled (self->enc_out_port, FALSE) != OMX_ErrorNone)
+ return FALSE;
- if (gst_omx_port_wait_enabled (self->enc_out_port,
- 1 * GST_SECOND) != OMX_ErrorNone)
- return FALSE;
- }
+ if (gst_omx_port_wait_enabled (self->enc_out_port,
+ 1 * GST_SECOND) != OMX_ErrorNone)
+ return FALSE;
if (gst_omx_component_get_state (self->enc,
GST_CLOCK_TIME_NONE) != OMX_StateIdle)
@@ -1302,13 +1272,6 @@ gst_omx_video_enc_set_format (GstVideoEncoder * encoder,
if (gst_omx_component_get_state (self->enc,
GST_CLOCK_TIME_NONE) != OMX_StateExecuting)
return FALSE;
-
- if (have_output_buffers) {
- if (gst_omx_port_populate (self->enc_out_port) != OMX_ErrorNone)
- return FALSE;
- if (gst_omx_port_mark_reconfigured (self->enc_out_port) != OMX_ErrorNone)
- return FALSE;
- }
}
/* Unset flushing to allow ports to accept data again */