aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/util
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-07-16 10:18:54 +0200
committerSven Gothel <[email protected]>2013-07-16 10:18:54 +0200
commitdba2faf8520a43a809eb756869c6c97a0a2ef2cd (patch)
treeb2965cdb7bc6a7bb964fdcc23990c30965c32876 /src/jogl/classes/jogamp/opengl/util
parent9feaa5e48c7f8df0ad0f1e667d43008e6ca5b02a (diff)
Fix FFMPEGMediaPlayer: Only use RED for GL3ES3 profiles, otherwise stick w/ ALPHA (regression of e92e561df9673ce77783d6fa3815a942a39a53c0)
GLES2 does not and GL2 may not support RED!
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/util')
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java8
1 files changed, 7 insertions, 1 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 1264d8986..f416bb1f8 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
@@ -193,7 +193,13 @@ 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_RED; tif=GL2ES2.GL_RED; break; // RED shall be supported on ES2, ES3 and GL3-core!
+ case 1:
+ if( gl.isGL3ES3() ) {
+ tf = GL2ES2.GL_RED; tif=GL2ES2.GL_RED; // RED is supported on ES3 and >= GL3 [core]; ALPHA is deprecated on core!
+ } else {
+ tf = GL2ES2.GL_ALPHA; tif=GL2ES2.GL_ALPHA; // ALPHA is supported on ES2 and GL2
+ }
+ break;
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);