mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
plugins: destroy pool earlier if non-vaapi
If the offered pool in decide_allocation() vmethod doesn't have the VAAPI_VIDEO_META option, it is destroyed immediatly and the pointer cleared, so it could be created later.
This commit is contained in:
parent
21b184284b
commit
9667f0e472
1 changed files with 9 additions and 7 deletions
|
@ -719,6 +719,14 @@ gst_vaapi_plugin_base_decide_allocation (GstVaapiPluginBase * plugin,
|
||||||
not provide a correct propose_allocation() implementation */
|
not provide a correct propose_allocation() implementation */
|
||||||
has_video_alignment = gst_buffer_pool_has_option (pool,
|
has_video_alignment = gst_buffer_pool_has_option (pool,
|
||||||
GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT);
|
GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT);
|
||||||
|
|
||||||
|
/* GstVaapiVideoMeta is mandatory, and this implies VA surface memory */
|
||||||
|
if (!gst_buffer_pool_has_option (pool,
|
||||||
|
GST_BUFFER_POOL_OPTION_VAAPI_VIDEO_META)) {
|
||||||
|
GST_INFO_OBJECT (plugin, "ignoring non-VAAPI pool: %" GST_PTR_FORMAT,
|
||||||
|
pool);
|
||||||
|
g_clear_object (&pool);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pool = NULL;
|
pool = NULL;
|
||||||
|
@ -726,13 +734,7 @@ gst_vaapi_plugin_base_decide_allocation (GstVaapiPluginBase * plugin,
|
||||||
min = max = 0;
|
min = max = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GstVaapiVideoMeta is mandatory, and this implies VA surface memory */
|
if (!pool) {
|
||||||
if (!pool || !gst_buffer_pool_has_option (pool,
|
|
||||||
GST_BUFFER_POOL_OPTION_VAAPI_VIDEO_META)) {
|
|
||||||
GST_INFO_OBJECT (plugin, "%s. Making a new pool", pool == NULL ? "No pool" :
|
|
||||||
"Pool hasn't GstVaapiVideoMeta");
|
|
||||||
if (pool)
|
|
||||||
gst_object_unref (pool);
|
|
||||||
pool = gst_vaapi_video_buffer_pool_new (plugin->display);
|
pool = gst_vaapi_video_buffer_pool_new (plugin->display);
|
||||||
if (!pool)
|
if (!pool)
|
||||||
goto error_create_pool;
|
goto error_create_pool;
|
||||||
|
|
Loading…
Reference in a new issue