VAAPI + meta:GstVideoGLTextureUploadMeta

Víctor M. Jáquez L. vjaquez at igalia.com
Tue Feb 2 10:25:06 CET 2016


On 01/23/16 at 11:31pm, Christophe Lafolet wrote:
> Hello Vector
> 
> thanks for your examples that help me to solve my SIGSEGV : I was trying to
> retrieve a unusefull byte buffer by calling map/unmap on the GstBuffer,
> seems strange this SIGSEGV ....
> 
> 
> but others problems are still present :
> 
>  - in file gstvaapivideometa_texture.c ( method
> gst_buffer_add_texture_upload_meta()),  the code below is not compatible
> with the gst_buffer_add_video_gl_texture_upload_meta api :
> the method need a /|GstVideoGLTextureType[4] |/|(because a memcpy is made on
> the 4 elements) and only a|/||//|/|GstVideoGLTextureType|/[1] |/|is given|/|
> 
> |/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);
> - in file gstvideometa.c (method
> gst_buffer_add_video_gl_texture_upload_meta()),
>       memcpy (meta->texture_type, texture_type, sizeof (texture_type[0]) *
> 4);
> when there is only one texture (major case), it seems the caller need to
> feel the /|GstVideoGLTextureType[4]|/ with a "invalid" value to be defined
> (GST_VIDEO_GL_TEXTURE_TYPE_INVALID for example)
>   GstVideoGLTextureType texture_type[4] =
>     {meta_texture->texture_type,
>       GST_VIDEO_GL_TEXTURE_TYPE_INVALID,
>       GST_VIDEO_GL_TEXTURE_TYPE_INVALID,
>       GST_VIDEO_GL_TEXTURE_TYPE_INVALID};

I haven't noticed a problem with it, but yeah, it would be better to fix it,
to avoid a buffer overflow. Good catch!

Do you have a patch?

> - in gst_vaapi_texture_glx_new_wrapped(), a default gl_api seems to be
> searched once by calling the method gl_get_current_api() before reception of
> the query allocation containing my "gst.gl.GstGLContext"
> in my case, the GL version is "4.5.0 NVIDIA 358.16", GL_CONTEXT_PROFILE_MASK
> = 0 (seems to be a bug on nvidia card) : the method gl_get_current_api()
> can't decode the version and return GST_VAAPI_GL_API_NONE !!
> my gl_api (GL_API_OPENGL) contained in the GLContext (in the query
> allocation) is never read, nor the environment variable GST_GL_API,
> ........................................
> 
> 
> to continue, I modify gl_get_current_api() to return GST_VAAPI_GL_API_OPENGL

Perhaps vaapi element should query for the GstGLContext using the context
mechanism, rather than rely on the allocation query.

> 
> - the last problems is
> vaapi gstvaapiutils_glx.c:986:gl_unbind_pixmap_object: failed to release
> pixmap ??

I have saw that with NVIDIA cards, but I haven't dig on it further.

vmjl


More information about the gstreamer-devel mailing list