From 89636392fa3fd2182dd13aa2193aca17edaa102d Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Thu, 31 Jul 2014 14:07:29 +1000 Subject: glmemory: use GstVideoInfo everywhere Simplifies a lot of the calling code https://bugzilla.gnome.org/show_bug.cgi?id=733717 --- gst-libs/gst/gl/gstgluploadmeta.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'gst-libs/gst/gl/gstgluploadmeta.c') diff --git a/gst-libs/gst/gl/gstgluploadmeta.c b/gst-libs/gst/gl/gstgluploadmeta.c index fe70d282b..c2dffd28d 100644 --- a/gst-libs/gst/gl/gstgluploadmeta.c +++ b/gst-libs/gst/gl/gstgluploadmeta.c @@ -219,12 +219,11 @@ _perform_with_gl_memory (GstGLUploadMeta * upload, GstVideoGLTextureUploadMeta * GST_GL_MEMORY_FLAG_SET (in_mem, GST_GL_MEMORY_FLAG_NEED_UPLOAD); } else { GstGLMemory *out_mem; + gint mem_width, mem_height; if (!upload->priv->out_tex[i]) upload->priv->out_tex[i] = gst_gl_memory_wrapped_texture (upload->context, - texture_id[i], meta->texture_type[i], - GST_VIDEO_INFO_WIDTH (&upload->info), - GST_VIDEO_INFO_HEIGHT (&upload->info), NULL, NULL); + texture_id[i], &upload->info, i, NULL, NULL); out_mem = upload->priv->out_tex[i]; @@ -233,8 +232,12 @@ _perform_with_gl_memory (GstGLUploadMeta * upload, GstVideoGLTextureUploadMeta * GST_GL_MEMORY_FLAG_SET (out_mem, GST_GL_MEMORY_FLAG_NEED_DOWNLOAD); } + mem_width = gst_gl_memory_get_texture_width (out_mem); + mem_height = gst_gl_memory_get_texture_height (out_mem); + if (!(res = gst_gl_memory_copy_into_texture (in_mem, out_mem->tex_id, - out_mem->tex_type, out_mem->width, out_mem->height, out_mem->stride, + out_mem->tex_type, mem_width, mem_height, + GST_VIDEO_INFO_PLANE_STRIDE (&out_mem->info, out_mem->plane), FALSE))) break; } @@ -253,9 +256,7 @@ _perform_with_data_unlocked (GstGLUploadMeta * upload, for (i = 0; i < GST_VIDEO_INFO_N_PLANES (&upload->info); i++) { if (!upload->priv->in_tex[i]) upload->priv->in_tex[i] = gst_gl_memory_wrapped (upload->context, - meta->texture_type[i], GST_VIDEO_INFO_WIDTH (&upload->info), - GST_VIDEO_INFO_HEIGHT (&upload->info), - GST_VIDEO_INFO_PLANE_STRIDE (&upload->info, i), data[i], NULL, NULL); + &upload->info, i, data[i], NULL, NULL); upload->priv->in_tex[i]->data = data[i]; } -- cgit v1.2.1