diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2018-08-13 15:10:37 +0200 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2018-08-30 10:59:30 +0200 |
commit | 34bc02e397d8db72c06d86f7a8734c0d34d78276 (patch) | |
tree | 99e0ff396abf4cfc81b57ef6ac4f199e713942d9 /omx/gstomx.c | |
parent | c89b54fe7867568f85ccc3b8660bbbd839659fcd (diff) | |
download | gst-omx-34bc02e397d8db72c06d86f7a8734c0d34d78276.tar.gz |
omx: allow gst_omx_port_acquire_buffer() to not wait for buffers
Will be needed to implement GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT.
https://bugzilla.gnome.org/show_bug.cgi?id=796918
Diffstat (limited to 'omx/gstomx.c')
-rw-r--r-- | omx/gstomx.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/omx/gstomx.c b/omx/gstomx.c index 6096806..8f99f82 100644 --- a/omx/gstomx.c +++ b/omx/gstomx.c @@ -1372,7 +1372,8 @@ gst_omx_port_update_port_definition (GstOMXPort * port, /* NOTE: Uses comp->lock and comp->messages_lock */ GstOMXAcquireBufferReturn -gst_omx_port_acquire_buffer (GstOMXPort * port, GstOMXBuffer ** buf) +gst_omx_port_acquire_buffer (GstOMXPort * port, GstOMXBuffer ** buf, + GstOMXWait wait) { GstOMXAcquireBufferReturn ret = GST_OMX_ACQUIRE_BUFFER_ERROR; GstOMXComponent *comp; @@ -1504,11 +1505,17 @@ retry: if (g_queue_is_empty (&port->pending_buffers)) { GST_DEBUG_OBJECT (comp->parent, "Queue of %s port %u is empty", comp->name, port->index); - gst_omx_component_wait_message (comp, - timeout == -2 ? GST_CLOCK_TIME_NONE : timeout); - /* And now check everything again and maybe get a buffer */ - goto retry; + if (wait == GST_OMX_WAIT) { + gst_omx_component_wait_message (comp, + timeout == -2 ? GST_CLOCK_TIME_NONE : timeout); + + /* And now check everything again and maybe get a buffer */ + goto retry; + } else { + ret = GST_OMX_ACQUIRE_BUFFER_NO_AVAILABLE; + goto done; + } } GST_DEBUG_OBJECT (comp->parent, "%s port %u has pending buffers", |