vaapivideopool: Set pooled flag to added metas.

So this could hint filters how to use these metas.

Had to change the return value for texutre upload meta in order
to flag it.

Part-of: <!326>
parent ab475c22
Pipeline #147837 waiting for manual action with stages
in 18 seconds
......@@ -385,6 +385,7 @@ gst_vaapi_video_buffer_pool_alloc_buffer (GstBufferPool * pool,
goto error_create_meta;
buffer = gst_vaapi_video_buffer_new (meta);
GST_META_FLAG_SET (meta, GST_META_FLAG_POOLED);
if (!buffer)
goto error_create_buffer;
......@@ -428,10 +429,15 @@ gst_vaapi_video_buffer_pool_alloc_buffer (GstBufferPool * pool,
vmeta->map = gst_video_meta_map_vaapi_memory;
vmeta->unmap = gst_video_meta_unmap_vaapi_memory;
}
GST_META_FLAG_SET (vmeta, GST_META_FLAG_POOLED);
}
#if (USE_GLX || USE_EGL)
if (priv->options & GST_VAAPI_VIDEO_BUFFER_POOL_OPTION_GL_TEXTURE_UPLOAD)
gst_buffer_add_texture_upload_meta (buffer);
if (priv->options & GST_VAAPI_VIDEO_BUFFER_POOL_OPTION_GL_TEXTURE_UPLOAD) {
GstMeta *tex_meta = gst_buffer_add_texture_upload_meta (buffer);
if (tex_meta)
GST_META_FLAG_SET (tex_meta, GST_META_FLAG_POOLED);
}
#endif
*out_buffer_ptr = buffer;
......
......@@ -218,10 +218,9 @@ gst_vaapi_texture_upload (GstVideoGLTextureUploadMeta * meta,
gst_vaapi_video_meta_get_render_flags (vmeta));
}
gboolean
GstMeta *
gst_buffer_add_texture_upload_meta (GstBuffer * buffer)
{
GstVideoGLTextureUploadMeta *meta = NULL;
GstVaapiVideoMetaTexture *meta_texture;
if (!buffer)
......@@ -234,20 +233,16 @@ gst_buffer_add_texture_upload_meta (GstBuffer * buffer)
if (!meta_texture_ensure_info_from_buffer (meta_texture, buffer))
goto error;
meta = gst_buffer_add_video_gl_texture_upload_meta (buffer,
GST_VIDEO_GL_TEXTURE_ORIENTATION_X_NORMAL_Y_NORMAL,
1, meta_texture->texture_type, gst_vaapi_texture_upload,
meta_texture, (GBoxedCopyFunc) meta_texture_copy,
(GBoxedFreeFunc) meta_texture_free);
if (!meta)
goto error;
return TRUE;
return (GstMeta *) gst_buffer_add_video_gl_texture_upload_meta (buffer,
GST_VIDEO_GL_TEXTURE_ORIENTATION_X_NORMAL_Y_NORMAL, 1,
meta_texture->texture_type, gst_vaapi_texture_upload, meta_texture,
(GBoxedCopyFunc) meta_texture_copy, (GBoxedFreeFunc) meta_texture_free);
/* ERRORS */
error:
{
meta_texture_free (meta_texture);
return FALSE;
return NULL;
}
}
......@@ -259,6 +254,6 @@ gst_buffer_ensure_texture_upload_meta (GstBuffer * buffer)
return meta ?
meta_texture_ensure_info_from_buffer (meta->user_data, buffer) :
gst_buffer_add_texture_upload_meta (buffer);
(gst_buffer_add_texture_upload_meta (buffer) != NULL);
}
#endif
......@@ -34,7 +34,7 @@ G_BEGIN_DECLS
typedef struct _GstVaapiVideoMetaTexture GstVaapiVideoMetaTexture;
G_GNUC_INTERNAL
gboolean
GstMeta *
gst_buffer_add_texture_upload_meta (GstBuffer * buffer);
G_GNUC_INTERNAL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment