diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2014-05-12 19:29:45 -0400 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2014-05-13 11:43:45 -0400 |
commit | d4bcef3204709159713ff1630978ecac0bd91dc9 (patch) | |
tree | 1c260bee5c5b5c31f3701f2e070d14616a6b2fe9 | |
parent | 16d969b945d897c931e7727641ef4cd0df7027a5 (diff) | |
download | gstreamer-plugins-bad-d4bcef3204709159713ff1630978ecac0bd91dc9.tar.gz |
glmemory: Fix handling of stride with alignement larger then 8
Setting a scaled factor for X coordinate is not enough as the indexer
will still think stride is shorter and will not fully skip it. Instead,
update width, so the lines are as expected. Combined with the scale, it
will hide the cropped portion.
https://bugzilla.gnome.org/show_bug.cgi?id=729896
-rw-r--r-- | gst-libs/gst/gl/gstglmemory.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gst-libs/gst/gl/gstglmemory.c b/gst-libs/gst/gl/gstglmemory.c index 785d93c67..8d6fed194 100644 --- a/gst-libs/gst/gl/gstglmemory.c +++ b/gst-libs/gst/gl/gstglmemory.c @@ -400,6 +400,7 @@ _calculate_unpack_length (GstGLMemory * gl_mem) gl_mem->unpack_length = j; gl_mem->tex_scaling[0] = (gfloat) (gl_mem->width * n_gl_bytes) / (gfloat) gl_mem->stride; + gl_mem->width = gl_mem->stride / n_gl_bytes; break; } j >>= 1; @@ -511,9 +512,12 @@ _gl_mem_new (GstAllocator * allocator, GstMemory * parent, { GstGLMemory *mem; GenTexture data = { 0, }; + mem = g_slice_new0 (GstGLMemory); + _gl_mem_init (mem, allocator, parent, context, tex_type, width, height, + stride, user_data, notify); - data.width = width; - data.height = height; + data.width = mem->width; + data.height = mem->height; data.gl_format = _gst_gl_format_from_gl_texture_type (tex_type); data.gl_type = GL_UNSIGNED_BYTE; if (tex_type == GST_VIDEO_GL_TEXTURE_TYPE_RGB16) @@ -528,10 +532,6 @@ _gl_mem_new (GstAllocator * allocator, GstMemory * parent, GST_CAT_TRACE (GST_CAT_GL_MEMORY, "created texture %u", data.result); - mem = g_slice_new0 (GstGLMemory); - _gl_mem_init (mem, allocator, parent, context, tex_type, width, height, - stride, user_data, notify); - mem->tex_id = data.result; return mem; |