From 030fc8b7d0669243172c263ad6ba8a6b74d8ae2b Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Mon, 12 May 2014 13:50:47 -0400 Subject: [PATCH] glupload: Ensure we still have a texture after upload_set_format() gst_gl_upload_set_format() resets the upload, hence the texture. So we need to ensure we have a texture after this call when uploading. --- gst-libs/gst/gl/gstglupload.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c index 400dd2b322..3c5a5ffdbe 100644 --- a/gst-libs/gst/gl/gstglupload.c +++ b/gst-libs/gst/gl/gstglupload.c @@ -343,6 +343,11 @@ gst_gl_upload_perform_with_buffer (GstGLUpload * upload, GstBuffer * buffer, /* update the video info from the one updated by frame_map using video meta */ gst_gl_upload_set_format (upload, &upload->priv->frame.info); + if (!upload->priv->tex_id) + gst_gl_context_gen_texture (upload->context, &upload->priv->tex_id, + GST_VIDEO_FORMAT_RGBA, GST_VIDEO_INFO_WIDTH (&upload->in_info), + GST_VIDEO_INFO_HEIGHT (&upload->in_info)); + if (!gst_gl_upload_perform_with_data (upload, upload->priv->tex_id, upload->priv->frame.data)) { return FALSE; @@ -400,6 +405,11 @@ _do_upload_for_meta (GstGLUpload * upload, GstVideoGLTextureUploadMeta * meta) /* update the video info from the one updated by frame_map using video meta */ gst_gl_upload_set_format (upload, &upload->priv->frame.info); + if (!upload->priv->tex_id) + gst_gl_context_gen_texture (upload->context, &upload->priv->tex_id, + GST_VIDEO_FORMAT_RGBA, GST_VIDEO_INFO_WIDTH (&upload->in_info), + GST_VIDEO_INFO_HEIGHT (&upload->in_info)); + ret = _gst_gl_upload_perform_with_data_unlocked (upload, upload->out_tex->tex_id, frame.data);