mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
gl/upload: switch the 'master' texture for YUY2, UYVY
From d4bcef3204
on, using a RGBA
texture to hold the data causes the glmemory to have half width
and a scaling of [2, 1]. Using a LA texture solves this problem
however cannot be attached to the framebuffer for copying into
a RGBA texture. Which will be solved by moving to EXT_texture_rg.
https://bugzilla.gnome.org/show_bug.cgi?id=728890
This commit is contained in:
parent
37c08c58c5
commit
2da979831e
3 changed files with 10 additions and 15 deletions
|
@ -727,12 +727,12 @@ _YUV_to_RGB (GstGLColorConvert * convert)
|
||||||
info->frag_prog = g_strdup_printf (frag_YUY2_UYVY_to_RGB, 'r', 'g', 'a',
|
info->frag_prog = g_strdup_printf (frag_YUY2_UYVY_to_RGB, 'r', 'g', 'a',
|
||||||
pixel_order[0], pixel_order[1], pixel_order[2], pixel_order[3]);
|
pixel_order[0], pixel_order[1], pixel_order[2], pixel_order[3]);
|
||||||
info->in_n_textures = 1;
|
info->in_n_textures = 1;
|
||||||
info->shader_tex_names[1] = "Ytex";
|
info->shader_tex_names[0] = "Ytex";
|
||||||
info->shader_tex_names[0] = "UVtex";
|
info->shader_tex_names[1] = "UVtex";
|
||||||
convert->priv->scratch =
|
convert->priv->scratch =
|
||||||
(GstGLMemory *) gst_gl_memory_alloc (convert->context,
|
(GstGLMemory *) gst_gl_memory_alloc (convert->context,
|
||||||
GST_VIDEO_GL_TEXTURE_TYPE_LUMINANCE_ALPHA,
|
GST_VIDEO_GL_TEXTURE_TYPE_RGBA,
|
||||||
GST_VIDEO_INFO_WIDTH (&convert->in_info),
|
GST_VIDEO_INFO_COMP_WIDTH (&convert->in_info, 1),
|
||||||
GST_VIDEO_INFO_HEIGHT (&convert->in_info),
|
GST_VIDEO_INFO_HEIGHT (&convert->in_info),
|
||||||
GST_VIDEO_INFO_PLANE_STRIDE (&convert->in_info, 0));
|
GST_VIDEO_INFO_PLANE_STRIDE (&convert->in_info, 0));
|
||||||
break;
|
break;
|
||||||
|
@ -754,12 +754,12 @@ _YUV_to_RGB (GstGLColorConvert * convert)
|
||||||
info->frag_prog = g_strdup_printf (frag_YUY2_UYVY_to_RGB, 'a', 'r', 'b',
|
info->frag_prog = g_strdup_printf (frag_YUY2_UYVY_to_RGB, 'a', 'r', 'b',
|
||||||
pixel_order[0], pixel_order[1], pixel_order[2], pixel_order[3]);
|
pixel_order[0], pixel_order[1], pixel_order[2], pixel_order[3]);
|
||||||
info->in_n_textures = 1;
|
info->in_n_textures = 1;
|
||||||
info->shader_tex_names[1] = "Ytex";
|
info->shader_tex_names[0] = "Ytex";
|
||||||
info->shader_tex_names[0] = "UVtex";
|
info->shader_tex_names[1] = "UVtex";
|
||||||
convert->priv->scratch =
|
convert->priv->scratch =
|
||||||
(GstGLMemory *) gst_gl_memory_alloc (convert->context,
|
(GstGLMemory *) gst_gl_memory_alloc (convert->context,
|
||||||
GST_VIDEO_GL_TEXTURE_TYPE_LUMINANCE_ALPHA,
|
GST_VIDEO_GL_TEXTURE_TYPE_RGBA,
|
||||||
GST_VIDEO_INFO_WIDTH (&convert->in_info),
|
GST_VIDEO_INFO_COMP_WIDTH (&convert->in_info, 1),
|
||||||
GST_VIDEO_INFO_HEIGHT (&convert->in_info),
|
GST_VIDEO_INFO_HEIGHT (&convert->in_info),
|
||||||
GST_VIDEO_INFO_PLANE_STRIDE (&convert->in_info, 0));
|
GST_VIDEO_INFO_PLANE_STRIDE (&convert->in_info, 0));
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -208,7 +208,7 @@ gst_gl_texture_type_from_format (GstVideoFormat v_format, guint plane)
|
||||||
break;
|
break;
|
||||||
case GST_VIDEO_FORMAT_YUY2:
|
case GST_VIDEO_FORMAT_YUY2:
|
||||||
case GST_VIDEO_FORMAT_UYVY:
|
case GST_VIDEO_FORMAT_UYVY:
|
||||||
return GST_VIDEO_GL_TEXTURE_TYPE_RGBA;
|
return GST_VIDEO_GL_TEXTURE_TYPE_LUMINANCE_ALPHA;
|
||||||
break;
|
break;
|
||||||
case GST_VIDEO_FORMAT_NV12:
|
case GST_VIDEO_FORMAT_NV12:
|
||||||
case GST_VIDEO_FORMAT_NV21:
|
case GST_VIDEO_FORMAT_NV21:
|
||||||
|
@ -233,11 +233,6 @@ gst_gl_texture_type_from_format (GstVideoFormat v_format, guint plane)
|
||||||
static inline guint
|
static inline guint
|
||||||
_get_plane_width (GstVideoInfo * info, guint plane)
|
_get_plane_width (GstVideoInfo * info, guint plane)
|
||||||
{
|
{
|
||||||
if (GST_VIDEO_INFO_FORMAT (info) == GST_VIDEO_FORMAT_YUY2
|
|
||||||
|| GST_VIDEO_INFO_FORMAT (info) == GST_VIDEO_FORMAT_UYVY) {
|
|
||||||
return GST_VIDEO_INFO_COMP_WIDTH (info, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (GST_VIDEO_INFO_IS_YUV (info))
|
if (GST_VIDEO_INFO_IS_YUV (info))
|
||||||
/* For now component width and plane width are the same and the
|
/* For now component width and plane width are the same and the
|
||||||
* plane-component mapping matches
|
* plane-component mapping matches
|
||||||
|
|
|
@ -287,7 +287,7 @@ gst_gl_upload_perform_with_buffer (GstGLUpload * upload, GstBuffer * buffer,
|
||||||
upload->out_tex = (GstGLMemory *) gst_gl_memory_alloc (upload->context,
|
upload->out_tex = (GstGLMemory *) gst_gl_memory_alloc (upload->context,
|
||||||
GST_VIDEO_GL_TEXTURE_TYPE_RGBA, GST_VIDEO_INFO_WIDTH (&upload->in_info),
|
GST_VIDEO_GL_TEXTURE_TYPE_RGBA, GST_VIDEO_INFO_WIDTH (&upload->in_info),
|
||||||
GST_VIDEO_INFO_HEIGHT (&upload->in_info),
|
GST_VIDEO_INFO_HEIGHT (&upload->in_info),
|
||||||
GST_VIDEO_INFO_PLANE_STRIDE (&upload->in_info, 0));
|
4 * GST_VIDEO_INFO_WIDTH (&upload->in_info));
|
||||||
|
|
||||||
GST_LOG_OBJECT (upload, "Attempting upload with GstGLMemory");
|
GST_LOG_OBJECT (upload, "Attempting upload with GstGLMemory");
|
||||||
for (i = 0; i < GST_VIDEO_INFO_N_PLANES (&upload->in_info); i++) {
|
for (i = 0; i < GST_VIDEO_INFO_N_PLANES (&upload->in_info); i++) {
|
||||||
|
|
Loading…
Reference in a new issue