diff options
author | Sven Gothel <[email protected]> | 2013-07-16 07:23:07 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-07-16 07:23:07 +0200 |
commit | e92e561df9673ce77783d6fa3815a942a39a53c0 (patch) | |
tree | 81fdeedeb35e2620f43ae4dee9d480a84dc9b962 | |
parent | 9a26c3acdf475b845cf092d20c364bed1ed70500 (diff) |
FFMPEGMediaPlayer: Use GL_RED instead of deprecated GL_ALPHA, otherwise won't work w/ core >= GL3 profiles
-rw-r--r-- | src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java | 12 |
1 files changed, 6 insertions, 6 deletions
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"+ |