1
0
Fork 0

cogl-gst: Use alpha textures instead of luminance textures

Luminance textures are not supported on GL3 and as the textures are
accessed via a shader anyway it doesn't seem like it should make much
difference which component the single-component textures are in. Cogl
already has code to fake alpha textures via the texture swizzle
extension on GL3.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit ca1666860a325fa4d2362cdd38297d6281e997d8)
This commit is contained in:
Neil Roberts 2013-04-10 16:27:57 +01:00 committed by Lionel Landwerlin
parent 52b0e91537
commit e46ad9a91e
2 changed files with 4 additions and 4 deletions

View file

@ -49,9 +49,9 @@ _cogl_gst_shader_yv12_to_rgba_decl[] =
"vec4\n" "vec4\n"
"cogl_gst_sample_video (vec2 UV)\n" "cogl_gst_sample_video (vec2 UV)\n"
"{\n" "{\n"
" float y = 1.1640625 * (texture2D (cogl_sampler0, UV).g - 0.0625);\n" " float y = 1.1640625 * (texture2D (cogl_sampler0, UV).a - 0.0625);\n"
" float u = texture2D (cogl_sampler1, UV).g - 0.5;\n" " float u = texture2D (cogl_sampler1, UV).a - 0.5;\n"
" float v = texture2D (cogl_sampler2, UV).g - 0.5;\n" " float v = texture2D (cogl_sampler2, UV).a - 0.5;\n"
" vec4 color;\n" " vec4 color;\n"
" color.r = y + 1.59765625 * v;\n" " color.r = y + 1.59765625 * v;\n"
" color.g = y - 0.390625 * u - 0.8125 * v;\n" " color.g = y - 0.390625 * u - 0.8125 * v;\n"

View file

@ -428,7 +428,7 @@ cogl_gst_yv12_upload (CoglGstVideoSink *sink,
{ {
CoglGstVideoSinkPrivate *priv = sink->priv; CoglGstVideoSinkPrivate *priv = sink->priv;
GstVideoFrame frame; GstVideoFrame frame;
CoglPixelFormat format = COGL_PIXEL_FORMAT_G_8; CoglPixelFormat format = COGL_PIXEL_FORMAT_A_8;
if (!gst_video_frame_map (&frame, &priv->info, buffer, GST_MAP_READ)) if (!gst_video_frame_map (&frame, &priv->info, buffer, GST_MAP_READ))
goto map_fail; goto map_fail;