plugins: avoid to get/set pool config twice

This patch is a bit of optimization, since the bufferpool configuration is get
when the pool is created. Hence, we only need to request it when the pool from
the allocation query is reused.
This commit is contained in:
Víctor Manuel Jáquez Leal 2016-05-24 13:39:25 +02:00
parent 9667f0e472
commit c9f6006865

View file

@ -734,6 +734,7 @@ gst_vaapi_plugin_base_decide_allocation (GstVaapiPluginBase * plugin,
min = max = 0;
}
config = NULL;
if (!pool) {
pool = gst_vaapi_video_buffer_pool_new (plugin->display);
if (!pool)
@ -743,11 +744,10 @@ gst_vaapi_plugin_base_decide_allocation (GstVaapiPluginBase * plugin,
gst_buffer_pool_config_set_params (config, caps, size, min, max);
gst_buffer_pool_config_add_option (config,
GST_BUFFER_POOL_OPTION_VAAPI_VIDEO_META);
if (!gst_buffer_pool_set_config (pool, config))
goto error_config_failed;
}
config = gst_buffer_pool_get_config (pool);
if (!config)
config = gst_buffer_pool_get_config (pool);
/* Check whether GstVideoMeta, or GstVideoAlignment, is needed (raw video) */
if (has_video_meta) {