mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
plugins: robustify GstVideoGLTextureUploadMeta implementation.
Make GstVideoGLTextureUploadMeta::upload() implementation more robust when the GstVaapiTexture associated with the supplied texture id could not be created.
This commit is contained in:
parent
6fe54964bb
commit
c7673f1cd6
1 changed files with 5 additions and 1 deletions
|
@ -55,14 +55,18 @@ gst_vaapi_texture_upload(GstVideoGLTextureUploadMeta *meta, guint texture_id[4])
|
|||
if (texture) {
|
||||
GstVaapiDisplay * const tex_dpy =
|
||||
gst_vaapi_object_get_display(GST_VAAPI_OBJECT(texture));
|
||||
if (tex_dpy != dpy)
|
||||
if (tex_dpy != dpy) {
|
||||
gst_vaapi_texture_replace(&texture, NULL);
|
||||
meta->user_data = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (!texture) {
|
||||
/* FIXME: should we assume target? */
|
||||
texture = gst_vaapi_texture_new_with_texture(dpy, texture_id[0],
|
||||
GL_TEXTURE_2D, GL_RGBA);
|
||||
if (!texture)
|
||||
return FALSE;
|
||||
meta->user_data = texture;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue