summaryrefslogtreecommitdiffstats
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
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!
-rw-r--r--make/scripts/tests.sh4
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java8
2 files changed, 9 insertions, 3 deletions
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index 9e7be06d9..bb8d2463f 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -291,7 +291,7 @@ function testawtswt() {
#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelsAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestLandscapeES2NewtCanvasAWT $*
-testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestLandscapeES2NEWT $*
#testawtswt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasSWT $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestElektronenMultipliziererNEWT $*
@@ -312,7 +312,7 @@ testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
# av demos
#
#testnoawt jogamp.opengl.openal.av.ALDummyUsage $*
-#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube $*
+testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube $*
#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple $*
#
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);