From e92e561df9673ce77783d6fa3815a942a39a53c0 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 16 Jul 2013 07:23:07 +0200 Subject: FFMPEGMediaPlayer: Use GL_RED instead of deprecated GL_ALPHA, otherwise won't work w/ core >= GL3 profiles --- .../jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/util/av') diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java index a4178967c..1264d8986 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java +++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java @@ -193,9 +193,9 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl { System.out.println("setURL: p2 "+this); int tf, tif=GL.GL_RGBA; // texture format and internal format switch(vBytesPerPixelPerPlane) { - case 1: tf = GL2ES2.GL_ALPHA; tif=GL.GL_ALPHA; break; - case 3: tf = GL2ES2.GL_RGB; tif=GL.GL_RGB; break; - case 4: tf = GL2ES2.GL_RGBA; tif=GL.GL_RGBA; break; + case 1: tf = GL2ES2.GL_RED; tif=GL2ES2.GL_RED; break; // RED shall be supported on ES2, ES3 and GL3-core! + case 3: tf = GL2ES2.GL_RGB; tif=GL.GL_RGB; break; + case 4: tf = GL2ES2.GL_RGBA; tif=GL.GL_RGBA; break; default: throw new RuntimeException("Unsupported bytes-per-pixel / plane "+vBytesPerPixelPerPlane); } setTextureFormat(tif, tf); @@ -307,9 +307,9 @@ public class FFMPEGMediaPlayer extends EGLMediaPlayerImpl { " vec2 v_off = vec2("+tc_w_1+", 0.5);\n"+ " vec2 tc_half = texCoord*0.5;\n"+ " float y,u,v,r,g,b;\n"+ - " y = texture2D(image, texCoord).a;\n"+ - " u = texture2D(image, u_off+tc_half).a;\n"+ - " v = texture2D(image, v_off+tc_half).a;\n"+ + " y = texture2D(image, texCoord).r;\n"+ + " u = texture2D(image, u_off+tc_half).r;\n"+ + " v = texture2D(image, v_off+tc_half).r;\n"+ " y = 1.1643*(y-0.0625);\n"+ " u = u-0.5;\n"+ " v = v-0.5;\n"+ -- cgit v1.2.3