From 51dbc82ef4f24a61b704400d257501b08b945227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 14 Jul 2011 10:34:09 +0200 Subject: [PATCH] omx: Provide all buffers to output ports after enabling them --- omx/gstomx.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/omx/gstomx.c b/omx/gstomx.c index 8ba0ab5540..b271a30a81 100644 --- a/omx/gstomx.c +++ b/omx/gstomx.c @@ -1380,6 +1380,26 @@ gst_omx_port_set_enabled_unlocked (GstOMXPort * port, gboolean enabled) port->index, (enabled ? "enabled" : "disabled"), gst_omx_error_to_string (err), err); err = last_error; + } else { + /* If everything went fine and we have an output port we + * should provide all newly allocated buffers to the port + */ + if (enabled && port->port_def.eDir == OMX_DirOutput) { + GstOMXBuffer *buf; + + /* Enqueue all buffers for the component to fill */ + while ((buf = g_queue_pop_head (port->pending_buffers))) { + g_assert (!buf->used); + + err = OMX_FillThisBuffer (comp->handle, buf->omx_buf); + if (err != OMX_ErrorNone) { + GST_ERROR_OBJECT (comp->parent, + "Failed to pass buffer %p to port %u: %s (0x%08x)", buf, + port->index, gst_omx_error_to_string (err), err); + goto error; + } + } + } } done: