mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-13 02:45:35 +00:00
gl/upload: set out_tex after reset, not before
Fix a regression introduced recently with the lazy init. It was happening when calling gst_video_gl_texture_upload_meta_upload from an aplication. So not using gst_gl_upload_perform_with_buffer.
This commit is contained in:
parent
5cdfd51172
commit
c16ab9e66b
1 changed files with 15 additions and 20 deletions
|
@ -378,24 +378,6 @@ _do_upload_for_meta (GstGLUpload * upload, GstVideoGLTextureUploadMeta * meta)
|
||||||
g_return_val_if_fail (upload != NULL, FALSE);
|
g_return_val_if_fail (upload != NULL, FALSE);
|
||||||
g_return_val_if_fail (meta != NULL, FALSE);
|
g_return_val_if_fail (meta != NULL, FALSE);
|
||||||
|
|
||||||
v_meta = gst_buffer_get_video_meta (upload->priv->buffer);
|
|
||||||
|
|
||||||
if (!upload->initted) {
|
|
||||||
GstVideoFormat v_format;
|
|
||||||
guint width, height;
|
|
||||||
|
|
||||||
if (v_meta == NULL)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
v_format = v_meta->format;
|
|
||||||
width = v_meta->width;
|
|
||||||
height = v_meta->height;
|
|
||||||
|
|
||||||
gst_video_info_set_format (&in_info, v_format, width, height);
|
|
||||||
|
|
||||||
_gst_gl_upload_set_format_unlocked (upload, &in_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* GstGLMemory */
|
/* GstGLMemory */
|
||||||
mem = gst_buffer_peek_memory (upload->priv->buffer, 0);
|
mem = gst_buffer_peek_memory (upload->priv->buffer, 0);
|
||||||
|
|
||||||
|
@ -410,6 +392,8 @@ _do_upload_for_meta (GstGLUpload * upload, GstVideoGLTextureUploadMeta * meta)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
v_meta = gst_buffer_get_video_meta (upload->priv->buffer);
|
||||||
|
|
||||||
if (v_meta == NULL)
|
if (v_meta == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
@ -513,11 +497,22 @@ _gst_gl_upload_perform_for_gl_texture_upload_meta (GstVideoGLTextureUploadMeta *
|
||||||
|
|
||||||
g_mutex_lock (&upload->lock);
|
g_mutex_lock (&upload->lock);
|
||||||
|
|
||||||
if (!upload->out_tex)
|
if (!upload->initted) {
|
||||||
|
GstVideoInfo in_info;
|
||||||
|
GstVideoMeta *v_meta = gst_buffer_get_video_meta (upload->priv->buffer);
|
||||||
|
|
||||||
|
if (v_meta == NULL)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
gst_video_info_set_format (&in_info, v_meta->format, v_meta->width, v_meta->height);
|
||||||
|
|
||||||
|
_gst_gl_upload_set_format_unlocked (upload, &in_info);
|
||||||
|
|
||||||
upload->out_tex = gst_gl_memory_wrapped_texture (upload->context,
|
upload->out_tex = gst_gl_memory_wrapped_texture (upload->context,
|
||||||
texture_id[0], GST_VIDEO_GL_TEXTURE_TYPE_RGBA,
|
texture_id[0], GST_VIDEO_GL_TEXTURE_TYPE_RGBA,
|
||||||
GST_VIDEO_INFO_WIDTH (&upload->in_info),
|
GST_VIDEO_INFO_WIDTH (&upload->in_info),
|
||||||
GST_VIDEO_INFO_HEIGHT (&upload->in_info), NULL, NULL);;
|
GST_VIDEO_INFO_HEIGHT (&upload->in_info), NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME: kinda breaks the abstraction */
|
/* FIXME: kinda breaks the abstraction */
|
||||||
if (upload->out_tex->tex_id != texture_id[0]) {
|
if (upload->out_tex->tex_id != texture_id[0]) {
|
||||||
|
|
Loading…
Reference in a new issue