diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2013-03-14 14:51:32 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2013-03-14 14:51:32 +0100 |
commit | bda1e97abd3f7d81addf3d4e6aa7ff65ac9ce83b (patch) | |
tree | 240fe69db6be830c47e598fd435ae1f7ddace75c | |
parent | 9128ba5018242dfae84136a56ff15b7bc6fdca82 (diff) |
omxvideodec: Simplify bufferpool implementation
-rw-r--r-- | omx/gstomxvideodec.c | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c index 0b0fb69395..b26c657fc5 100644 --- a/omx/gstomxvideodec.c +++ b/omx/gstomxvideodec.c @@ -486,34 +486,13 @@ gst_omx_buffer_pool_acquire_buffer (GstBufferPool * bpool, if (pool->port->port_def.eDir == OMX_DirOutput) { GstBuffer *buf; - GstBufferPoolAcquireParams int_params = *params; - GList *free_buffers = NULL; - - int_params.flags |= GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT; g_return_val_if_fail (pool->current_buffer_index != -1, GST_FLOW_ERROR); buf = g_ptr_array_index (pool->buffers, pool->current_buffer_index); g_return_val_if_fail (buf != NULL, GST_FLOW_ERROR); - - /* FIXME: Add API to GstBufferPool for this */ - while ((ret = - GST_BUFFER_POOL_CLASS - (gst_omx_buffer_pool_parent_class)->acquire_buffer (bpool, buffer, - &int_params)) != GST_FLOW_EOS) { - if (ret != GST_FLOW_OK) { - g_list_free_full (free_buffers, (GDestroyNotify) gst_buffer_unref); - return ret; - } - if (*buffer == buf) - break; - gst_object_replace ((GstObject **) & (*buffer)->pool, (GstObject *) pool); - free_buffers = g_list_prepend (free_buffers, *buffer); - *buffer = NULL; - } - g_list_free_full (free_buffers, (GDestroyNotify) gst_buffer_unref); - - g_return_val_if_fail (*buffer != NULL, GST_FLOW_ERROR); + *buffer = buf; + ret = GST_FLOW_OK; /* If it's our own memory we have to set the sizes */ if (!pool->other_pool) { @@ -571,11 +550,10 @@ gst_omx_buffer_pool_release_buffer (GstBufferPool * bpool, GstBuffer * buffer) * would ensure that the buffer is always unused when this is called. */ g_assert_not_reached (); + GST_BUFFER_POOL_CLASS (gst_omx_buffer_pool_parent_class)->release_buffer + (bpool, buffer); } } - - GST_BUFFER_POOL_CLASS (gst_omx_buffer_pool_parent_class)->release_buffer - (bpool, buffer); } static void |