mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
glmemory: take subsampling into account for rectangle textures
Rectangle textures don't use normalized coordinates so subsampling needs to be factored in explicitly. Fixes YUV => RGB conversion for rectangle textures.
This commit is contained in:
parent
e8f966dcab
commit
fa1c4e552c
1 changed files with 12 additions and 0 deletions
|
@ -632,6 +632,18 @@ _calculate_unpack_length (GstGLMemory * gl_mem, GstGLContext * context)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (gl_mem->tex_target == GST_GL_TEXTURE_TARGET_RECTANGLE) {
|
||||
guint w_sub =
|
||||
GST_VIDEO_FORMAT_INFO_W_SUB (gl_mem->info.finfo, gl_mem->plane);
|
||||
guint h_sub =
|
||||
GST_VIDEO_FORMAT_INFO_H_SUB (gl_mem->info.finfo, gl_mem->plane);
|
||||
|
||||
if (w_sub)
|
||||
gl_mem->tex_scaling[0] /= (1 << w_sub);
|
||||
if (h_sub)
|
||||
gl_mem->tex_scaling[1] /= (1 << h_sub);
|
||||
}
|
||||
}
|
||||
|
||||
static guint
|
||||
|
|
Loading…
Reference in a new issue