From 020cb8badb10ecaa6003553289cab0fcde913cf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Tue, 19 Jul 2016 19:24:08 +0200 Subject: [PATCH] plugins: check dmabuf-import for sink pad allocator Check earlier if upstream video source has activated the dmabuf-import io-mode (hack to disappear soon), thus we can avoid the re-assignation of a new allocator. --- gst/vaapi/gstvaapipluginbase.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c index e80d203576..7717ec5d0a 100644 --- a/gst/vaapi/gstvaapipluginbase.c +++ b/gst/vaapi/gstvaapipluginbase.c @@ -514,8 +514,14 @@ ensure_sinkpad_allocator (GstVaapiPluginBase * plugin, GstVideoInfo * vinfo) if (!reset_allocator (plugin->sinkpad_allocator, vinfo)) return TRUE; - plugin->sinkpad_allocator = - gst_vaapi_video_allocator_new (plugin->display, vinfo, 0); + if (has_dmabuf_capable_peer (plugin, plugin->sinkpad)) { + plugin->sinkpad_allocator = + gst_vaapi_dmabuf_allocator_new (plugin->display, vinfo, + GST_VAAPI_SURFACE_ALLOC_FLAG_LINEAR_STORAGE); + } else { + plugin->sinkpad_allocator = + gst_vaapi_video_allocator_new (plugin->display, vinfo, 0); + } return plugin->sinkpad_allocator != NULL; }