[cogl/wip/cogl-gst-1.x: 39/41] cogl-gst: Use alpha textures instead of luminance textures



commit 04f7ea7f258b4f5bb1e68bdd8f78e2175d7325b5
Author: Neil Roberts <neil linux intel com>
Date:   Wed Apr 10 16:27:57 2013 +0100

    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>

 cogl-gst/cogl-gst-shader.c     |    6 +++---
 cogl-gst/cogl-gst-video-sink.c |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/cogl-gst/cogl-gst-shader.c b/cogl-gst/cogl-gst-shader.c
index bc11f18..49d4671 100644
--- a/cogl-gst/cogl-gst-shader.c
+++ b/cogl-gst/cogl-gst-shader.c
@@ -49,9 +49,9 @@ _cogl_gst_shader_yv12_to_rgba_decl[] =
   "vec4\n"
   "cogl_gst_sample_video (vec2 UV)\n"
   "{\n"
-  "  float y = 1.1640625 * (texture2D (cogl_sampler0, UV).g - 0.0625);\n"
-  "  float u = texture2D (cogl_sampler1, UV).g - 0.5;\n"
-  "  float v = texture2D (cogl_sampler2, UV).g - 0.5;\n"
+  "  float y = 1.1640625 * (texture2D (cogl_sampler0, UV).a - 0.0625);\n"
+  "  float u = texture2D (cogl_sampler1, UV).a - 0.5;\n"
+  "  float v = texture2D (cogl_sampler2, UV).a - 0.5;\n"
   "  vec4 color;\n"
   "  color.r = y + 1.59765625 * v;\n"
   "  color.g = y - 0.390625 * u - 0.8125 * v;\n"
diff --git a/cogl-gst/cogl-gst-video-sink.c b/cogl-gst/cogl-gst-video-sink.c
index 414cc06..5b17e53 100644
--- a/cogl-gst/cogl-gst-video-sink.c
+++ b/cogl-gst/cogl-gst-video-sink.c
@@ -428,7 +428,7 @@ cogl_gst_yv12_upload (CoglGstVideoSink *sink,
 {
   CoglGstVideoSinkPrivate *priv = sink->priv;
   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))
     goto map_fail;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]