mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
plugins: check if the pool config is already set
In commit 97b768, a regression for GStreamer 1.2 was introduced: GStreamer 1.2 doesn't check, in gst_buffer_pool_set_config() if the config option is already set. This patch adds an inline function to first verify if the option is not in the pool config berfore add it.
This commit is contained in:
parent
28b4fc4dd9
commit
188d8fe442
1 changed files with 22 additions and 12 deletions
|
@ -587,6 +587,22 @@ error_pool_config:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* XXXX: GStreamer 1.2 doesn't check, in gst_buffer_pool_set_config()
|
||||||
|
if the config option is already set */
|
||||||
|
static inline gboolean
|
||||||
|
gst_vaapi_plugin_base_set_pool_config (GstBufferPool * pool,
|
||||||
|
const gchar * option)
|
||||||
|
{
|
||||||
|
GstStructure *config;
|
||||||
|
|
||||||
|
config = gst_buffer_pool_get_config (pool);
|
||||||
|
if (!gst_buffer_pool_config_has_option (config, option)) {
|
||||||
|
gst_buffer_pool_config_add_option (config, option);
|
||||||
|
return gst_buffer_pool_set_config (pool, config);
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_vaapi_plugin_base_decide_allocation:
|
* gst_vaapi_plugin_base_decide_allocation:
|
||||||
* @plugin: a #GstVaapiPluginBase
|
* @plugin: a #GstVaapiPluginBase
|
||||||
|
@ -706,26 +722,20 @@ gst_vaapi_plugin_base_decide_allocation (GstVaapiPluginBase * plugin,
|
||||||
|
|
||||||
/* Check whether GstVideoMeta, or GstVideoAlignment, is needed (raw video) */
|
/* Check whether GstVideoMeta, or GstVideoAlignment, is needed (raw video) */
|
||||||
if (has_video_meta) {
|
if (has_video_meta) {
|
||||||
config = gst_buffer_pool_get_config (pool);
|
if (!gst_vaapi_plugin_base_set_pool_config (pool,
|
||||||
gst_buffer_pool_config_add_option (config,
|
GST_BUFFER_POOL_OPTION_VIDEO_META))
|
||||||
GST_BUFFER_POOL_OPTION_VIDEO_META);
|
|
||||||
if (!gst_buffer_pool_set_config (pool, config))
|
|
||||||
goto config_failed;
|
goto config_failed;
|
||||||
} else if (has_video_alignment) {
|
} else if (has_video_alignment) {
|
||||||
config = gst_buffer_pool_get_config (pool);
|
if (!gst_vaapi_plugin_base_set_pool_config (pool,
|
||||||
gst_buffer_pool_config_add_option (config,
|
GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT))
|
||||||
GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT);
|
|
||||||
if (!gst_buffer_pool_set_config (pool, config))
|
|
||||||
goto config_failed;
|
goto config_failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GstVideoGLTextureUploadMeta (OpenGL) */
|
/* GstVideoGLTextureUploadMeta (OpenGL) */
|
||||||
#if (USE_GLX || USE_EGL)
|
#if (USE_GLX || USE_EGL)
|
||||||
if (has_texture_upload_meta) {
|
if (has_texture_upload_meta) {
|
||||||
config = gst_buffer_pool_get_config (pool);
|
if (!gst_vaapi_plugin_base_set_pool_config (pool,
|
||||||
gst_buffer_pool_config_add_option (config,
|
GST_BUFFER_POOL_OPTION_VIDEO_GL_TEXTURE_UPLOAD_META))
|
||||||
GST_BUFFER_POOL_OPTION_VIDEO_GL_TEXTURE_UPLOAD_META);
|
|
||||||
if (!gst_buffer_pool_set_config (pool, config))
|
|
||||||
goto config_failed;
|
goto config_failed;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue