GST_GL_TEXTURE_TARGET_2D
};
+static const gchar templ_VUYA_to_RGB_BODY[] =
+ "vec4 texel, rgba;\n"
+ "texel = texture2D(tex, texcoord * tex_scale0);\n"
+ "rgba.rgb = yuv_to_rgb (texel.zyx, offset, coeff1, coeff2, coeff3);\n"
+ "rgba.a = texel.w;\n"
+ "gl_FragColor=vec4(rgba.%c,rgba.%c,rgba.%c,rgba.%c);\n";
+
+static const struct shader_templ templ_VUYA_to_RGB =
+ { NULL,
+ DEFAULT_UNIFORMS YUV_TO_RGB_COEFFICIENTS "uniform sampler2D tex;\n",
+ { glsl_func_yuv_to_rgb, NULL, },
+ GST_GL_TEXTURE_TARGET_2D
+ };
+
+static const gchar templ_RGB_to_VUYA_BODY[] =
+ "vec4 texel, ayuv;\n"
+ "texel = texture2D(tex, texcoord).%c%c%c%c;\n"
+ "ayuv.zyx = rgb_to_yuv (texel.rgb, offset, coeff1, coeff2, coeff3);\n"
+ "ayuv.w = %s;\n"
+ "gl_FragColor = ayuv;\n";
+
+static const struct shader_templ templ_RGB_to_VUYA =
+ { NULL,
+ DEFAULT_UNIFORMS RGB_TO_YUV_COEFFICIENTS "uniform sampler2D tex;\n",
+ { glsl_func_rgb_to_yuv, NULL, },
+ GST_GL_TEXTURE_TARGET_2D
+ };
+
/* YUV to RGB conversion */
static const gchar templ_PLANAR_YUV_to_RGB_BODY[] =
"vec4 texel, rgba;\n"
/* Always supported input and output formats */
_init_value_string_list (supported_formats, "RGBA", "RGB", "RGBx", "BGR",
"BGRx", "BGRA", "xRGB", "xBGR", "ARGB", "ABGR", "GRAY8", "GRAY16_LE",
- "GRAY16_BE", "AYUV", "YUY2", "UYVY", NULL);
+ "GRAY16_BE", "AYUV", "VUYA", "YUY2", "UYVY", NULL);
/* Always supported input formats or output with multiple draw buffers */
if (!output || (!context || context->gl_vtable->DrawBuffers))
case GST_VIDEO_FORMAT_RGB:
case GST_VIDEO_FORMAT_BGR:
case GST_VIDEO_FORMAT_AYUV:
+ case GST_VIDEO_FORMAT_VUYA:
case GST_VIDEO_FORMAT_GRAY8:
case GST_VIDEO_FORMAT_GRAY16_LE:
case GST_VIDEO_FORMAT_GRAY16_BE:
pixel_order[0], pixel_order[1], pixel_order[2], pixel_order[3]);
info->shader_tex_names[0] = "tex";
break;
+ case GST_VIDEO_FORMAT_VUYA:
+ info->templ = &templ_VUYA_to_RGB;
+ info->frag_body = g_strdup_printf (templ_VUYA_to_RGB_BODY,
+ pixel_order[0], pixel_order[1], pixel_order[2], pixel_order[3]);
+ info->shader_tex_names[0] = "tex";
+ break;
case GST_VIDEO_FORMAT_I420:
case GST_VIDEO_FORMAT_Y444:
case GST_VIDEO_FORMAT_Y42B:
pixel_order[1], pixel_order[2], pixel_order[3], alpha);
info->out_n_textures = 1;
break;
+ case GST_VIDEO_FORMAT_VUYA:
+ alpha = _is_RGBx (in_format) ? "1.0" : "texel.a";
+ info->templ = &templ_RGB_to_VUYA;
+ info->frag_body = g_strdup_printf (templ_RGB_to_VUYA_BODY, pixel_order[0],
+ pixel_order[1], pixel_order[2], pixel_order[3], alpha);
+ info->out_n_textures = 1;
+ break;
case GST_VIDEO_FORMAT_I420:
case GST_VIDEO_FORMAT_YV12:
case GST_VIDEO_FORMAT_Y444:
*/
#define GST_GL_COLOR_CONVERT_FORMATS "{ RGBA, RGB, RGBx, BGR, BGRx, BGRA, xRGB, " \
"xBGR, ARGB, ABGR, Y444, I420, YV12, Y42B, " \
- "Y41B, NV12, NV21, YUY2, UYVY, AYUV, " \
+ "Y41B, NV12, NV21, YUY2, UYVY, AYUV, VUYA, " \
"GRAY8, GRAY16_LE, GRAY16_BE, RGB16, BGR16, ARGB64 }"
/**
*/
#define GST_GL_MEMORY_VIDEO_FORMATS_STR \
"{ RGBA, BGRA, RGBx, BGRx, ARGB, ABGR, xRGB, xBGR, RGB, BGR, RGB16, BGR16, " \
- "AYUV, I420, YV12, NV12, NV21, YUY2, UYVY, Y41B, Y42B, Y444, " \
+ "AYUV, VUYA, I420, YV12, NV12, NV21, YUY2, UYVY, Y41B, Y42B, Y444, " \
"GRAY8, GRAY16_LE, GRAY16_BE, ARGB64 }"
/**