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.
This commit is contained in:
Víctor Manuel Jáquez Leal 2016-07-19 19:24:08 +02:00
parent 773eea0db0
commit 020cb8badb

View file

@ -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;
}