mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
vaapivideobufferpool: add video meta to config when needed
In cases where we know the video meta must be present, add it to the pool configuration. Signed-off-by: Scott D Phillips <scott.d.phillips@intel.com> https://bugzilla.gnome.org/show_bug.cgi?id=766184
This commit is contained in:
parent
2e5367a23c
commit
b5bf2e83f7
1 changed files with 18 additions and 1 deletions
|
@ -139,6 +139,7 @@ gst_vaapi_video_buffer_pool_set_config (GstBufferPool * pool,
|
|||
const GstVideoInfo *alloc_vip;
|
||||
GstVideoAlignment align;
|
||||
GstAllocator *allocator;
|
||||
gboolean ret, updated = FALSE;
|
||||
|
||||
GST_DEBUG_OBJECT (pool, "config %" GST_PTR_FORMAT, config);
|
||||
|
||||
|
@ -184,6 +185,21 @@ gst_vaapi_video_buffer_pool_set_config (GstBufferPool * pool,
|
|||
if (gst_buffer_pool_config_has_option (config,
|
||||
GST_BUFFER_POOL_OPTION_VIDEO_META))
|
||||
priv->options |= GST_VAAPI_VIDEO_BUFFER_POOL_OPTION_VIDEO_META;
|
||||
else {
|
||||
gint i;
|
||||
for (i = 0; i < GST_VIDEO_INFO_N_PLANES (&priv->video_info); i++) {
|
||||
if (GST_VIDEO_INFO_PLANE_OFFSET (&priv->video_info, i) !=
|
||||
GST_VIDEO_INFO_PLANE_OFFSET (&priv->alloc_info, i) ||
|
||||
GST_VIDEO_INFO_PLANE_STRIDE (&priv->video_info, i) !=
|
||||
GST_VIDEO_INFO_PLANE_STRIDE (&priv->alloc_info, i)) {
|
||||
priv->options |= GST_VAAPI_VIDEO_BUFFER_POOL_OPTION_VIDEO_META;
|
||||
gst_buffer_pool_config_add_option (config,
|
||||
GST_BUFFER_POOL_OPTION_VIDEO_META);
|
||||
updated = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (gst_buffer_pool_config_has_option (config,
|
||||
GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT)) {
|
||||
|
@ -195,9 +211,10 @@ gst_vaapi_video_buffer_pool_set_config (GstBufferPool * pool,
|
|||
GST_BUFFER_POOL_OPTION_VIDEO_GL_TEXTURE_UPLOAD_META))
|
||||
priv->options |= GST_VAAPI_VIDEO_BUFFER_POOL_OPTION_GL_TEXTURE_UPLOAD;
|
||||
|
||||
return
|
||||
ret =
|
||||
GST_BUFFER_POOL_CLASS
|
||||
(gst_vaapi_video_buffer_pool_parent_class)->set_config (pool, config);
|
||||
return !updated && ret;
|
||||
|
||||
/* ERRORS */
|
||||
error_invalid_config:
|
||||
|
|
Loading…
Reference in a new issue