summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2020-02-02 18:04:35 +0100
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2020-02-02 18:04:35 +0100
commit7f61ad79389fcd28c82f068701c3fff18bc3e4b6 (patch)
tree7d8b4a7655bbe93797c2602fda8a35f9b7a83243
parent62f3329455b180739492a38a2ac61de22d61eeb6 (diff)
vaapivideobufferpool: dmabuf implies allocator
Some code can be optimized since only if the dmabuf allocator is set, the internal flag of dmabuf is TRUE, thus there's no need to evaluate the allocator address.
-rw-r--r--gst/vaapi/gstvaapivideobufferpool.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/gst/vaapi/gstvaapivideobufferpool.c b/gst/vaapi/gstvaapivideobufferpool.c
index d99f306e..013766d8 100644
--- a/gst/vaapi/gstvaapivideobufferpool.c
+++ b/gst/vaapi/gstvaapivideobufferpool.c
@@ -190,7 +190,7 @@ gst_vaapi_video_buffer_pool_set_config (GstBufferPool * pool,
/* dmabuf allocator can change its parameters: no need to create a
* new one */
- if (allocator && priv->use_dmabuf_memory) {
+ if (priv->use_dmabuf_memory) {
gst_allocator_set_vaapi_video_info (allocator, &new_allocation_vinfo,
surface_alloc_flags);
} else {
@@ -200,14 +200,9 @@ gst_vaapi_video_buffer_pool_set_config (GstBufferPool * pool,
/* create a new allocator if needed */
if (!allocator) {
- if (priv->use_dmabuf_memory) {
- allocator = gst_vaapi_dmabuf_allocator_new (priv->display,
- &new_allocation_vinfo, /* FIXME: */ 0, GST_PAD_SRC);
- } else {
- allocator = gst_vaapi_video_allocator_new (priv->display,
- &new_allocation_vinfo, surface_alloc_flags, 0);
- }
-
+ /* if no allocator set, let's create a VAAPI one */
+ allocator = gst_vaapi_video_allocator_new (priv->display,
+ &new_allocation_vinfo, surface_alloc_flags, 0);
if (!allocator)
goto error_no_allocator;