summaryrefslogtreecommitdiff
path: root/omx/gstomx.c
diff options
context:
space:
mode:
Diffstat (limited to 'omx/gstomx.c')
-rw-r--r--omx/gstomx.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/omx/gstomx.c b/omx/gstomx.c
index 8f99f82..cb9b392 100644
--- a/omx/gstomx.c
+++ b/omx/gstomx.c
@@ -418,7 +418,11 @@ gst_omx_component_handle_messages (GstOMXComponent * comp)
port->eos = TRUE;
}
- g_queue_push_tail (&port->pending_buffers, buf);
+ /* If an input port is managed by a pool, the buffer will be ready to be
+ * filled again once it's been released to the pool. */
+ if (port->port_def.eDir == OMX_DirOutput || !port->using_pool) {
+ g_queue_push_tail (&port->pending_buffers, buf);
+ }
break;
}
@@ -1097,6 +1101,7 @@ gst_omx_component_add_port (GstOMXComponent * comp, guint32 index)
port->enabled_pending = FALSE;
port->disabled_pending = FALSE;
port->eos = FALSE;
+ port->using_pool = FALSE;
if (port->port_def.eDir == OMX_DirInput)
comp->n_in_ports++;
@@ -2631,6 +2636,34 @@ gst_omx_port_ensure_buffer_count_actual (GstOMXPort * port, guint extra)
}
gboolean
+gst_omx_port_update_buffer_count_actual (GstOMXPort * port, guint nb)
+{
+ OMX_PARAM_PORTDEFINITIONTYPE port_def;
+
+ gst_omx_port_get_port_definition (port, &port_def);
+
+ if (nb < port_def.nBufferCountMin) {
+ GST_DEBUG_OBJECT (port->comp->parent,
+ "Requested to use %d buffers on port %d but it's minimum is %d", nb,
+ (guint) port->index, (guint) port_def.nBufferCountMin);
+
+ nb = port_def.nBufferCountMin;
+ }
+
+ if (port_def.nBufferCountActual != nb) {
+ port_def.nBufferCountActual = nb;
+
+ GST_DEBUG_OBJECT (port->comp->parent,
+ "set port %d nBufferCountActual to %d", (guint) port->index, nb);
+
+ if (gst_omx_port_update_port_definition (port, &port_def) != OMX_ErrorNone)
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+gboolean
gst_omx_port_set_dmabuf (GstOMXPort * port, gboolean dmabuf)
{
#ifdef USE_OMX_TARGET_ZYNQ_USCALE_PLUS